Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1079 lines
24 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: locitem.inl
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // Inline functions for the CLocItem class. This is included by locitem.h.
  8. //
  9. //-----------------------------------------------------------------------------
  10. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  11. //
  12. // Returns whether or not the item has a localizable string.
  13. //
  14. //-----------------------------------------------------------------------------
  15. inline
  16. BOOL // TRUE if there's a localizable string
  17. CLocItem::HasLocString(void)
  18. const
  19. {
  20. return !GetLocString().GetString().IsNull();
  21. }
  22. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  23. //
  24. // Returns whether or not the item has binary info.
  25. //
  26. //-----------------------------------------------------------------------------
  27. inline
  28. BOOL // TRUE if the item has bin. content
  29. CLocItem::HasBinary(void)
  30. const
  31. {
  32. return m_pBinary!= NULL;
  33. }
  34. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  35. //
  36. // Returns the database id for the item. This is internal to the DB, and
  37. // should not be used except to indicate parent child relationships and for
  38. // database operations.
  39. //
  40. //-----------------------------------------------------------------------------
  41. inline
  42. const DBID& // The database id for the item.
  43. CLocItem::GetMyDatabaseId(void)
  44. const
  45. {
  46. return m_dbid;
  47. }
  48. inline
  49. const DBID &
  50. CLocItem::GetPseudoParentId(void)
  51. const
  52. {
  53. return m_PseudoParent;
  54. }
  55. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  56. //
  57. // Returns the ID for the item.
  58. //
  59. //-----------------------------------------------------------------------------
  60. inline
  61. const CLocUniqueId &
  62. CLocItem::GetUniqueId(void)
  63. const
  64. {
  65. return m_uid;
  66. }
  67. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  68. //
  69. // Returns the ID for the item.
  70. //
  71. //-----------------------------------------------------------------------------
  72. inline
  73. CLocUniqueId &
  74. CLocItem::GetUniqueId(void)
  75. {
  76. return m_uid;
  77. }
  78. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  79. //
  80. // Returns the current localization status for the translation of the item.
  81. //
  82. //-----------------------------------------------------------------------------
  83. inline
  84. CLS::LocStatus // Status for the item.
  85. CLocItem::GetTranslationStatus(void)
  86. const
  87. {
  88. return m_lsTranslationStatus;
  89. }
  90. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  91. //
  92. // Returns the current localization status for the binary part of the item.
  93. //
  94. //-----------------------------------------------------------------------------
  95. inline
  96. CLS::LocStatus // Status for the item.
  97. CLocItem::GetBinaryStatus(void)
  98. const
  99. {
  100. return m_lsBinaryStatus;
  101. }
  102. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  103. //
  104. // Returns the current translation origin for the item.
  105. //
  106. //-----------------------------------------------------------------------------
  107. inline
  108. CTO::TranslationOrigin // origin for the item.
  109. CLocItem::GetTranslationOrigin(void)
  110. const
  111. {
  112. return m_toTranslationOrigin;
  113. }
  114. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  115. //
  116. // Returns the current approval status for the item.
  117. //
  118. //-----------------------------------------------------------------------------
  119. inline
  120. CAS::ApprovalState // Status for the item.
  121. CLocItem::GetApprovalStatus(void)
  122. const
  123. {
  124. return m_asApprovalStatus;
  125. }
  126. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  127. //
  128. // Returns the current auto approval status for the item.
  129. //
  130. //-----------------------------------------------------------------------------
  131. inline
  132. CAA::AutoApproved // Status for the item.
  133. CLocItem::GetAutoApproved(void)
  134. const
  135. {
  136. return m_auto_approved;
  137. }
  138. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  139. //
  140. // Returns the current confidence level for the item.
  141. //
  142. //-----------------------------------------------------------------------------
  143. inline
  144. long
  145. CLocItem::GetConfidenceLevel(void)
  146. const
  147. {
  148. return m_confidence_level;
  149. }
  150. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  151. //
  152. // Returns the current custom1 for the item.
  153. //
  154. //-----------------------------------------------------------------------------
  155. inline
  156. long
  157. CLocItem::GetCustom1(void)
  158. const
  159. {
  160. return m_custom1;
  161. }
  162. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  163. //
  164. // Returns the current custom2 for the item.
  165. //
  166. //-----------------------------------------------------------------------------
  167. inline
  168. long
  169. CLocItem::GetCustom2(void)
  170. const
  171. {
  172. return m_custom2;
  173. }
  174. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  175. //
  176. // Returns the current custom3 for the item.
  177. //
  178. //-----------------------------------------------------------------------------
  179. inline
  180. long
  181. CLocItem::GetCustom3(void)
  182. const
  183. {
  184. return m_custom3;
  185. }
  186. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  187. //
  188. // Returns the current custom4 for the item.
  189. //
  190. //-----------------------------------------------------------------------------
  191. inline
  192. long
  193. CLocItem::GetCustom4(void)
  194. const
  195. {
  196. return m_custom4;
  197. }
  198. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  199. //
  200. // Returns the current custom5 for the item.
  201. //
  202. //-----------------------------------------------------------------------------
  203. inline
  204. long
  205. CLocItem::GetCustom5(void)
  206. const
  207. {
  208. return m_custom5;
  209. }
  210. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  211. //
  212. // Returns the current custom6 for the item.
  213. //
  214. //-----------------------------------------------------------------------------
  215. inline
  216. long
  217. CLocItem::GetCustom6(void)
  218. const
  219. {
  220. return m_custom6;
  221. }
  222. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  223. //
  224. // Gets the display order for the item. This is used to provide a default
  225. // ordering of items in the resource table. Lower values are displayed first.
  226. //
  227. //-----------------------------------------------------------------------------
  228. inline
  229. UINT // Display order for the item.
  230. CLocItem::GetDisplayOrder(void)
  231. const
  232. {
  233. return m_uiDisplayOrder;
  234. }
  235. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  236. //
  237. // Returns the CLocString for the item. To determine if it is valid, use
  238. // HasLocString(). A valid string can be blank!
  239. //
  240. //-----------------------------------------------------------------------------
  241. inline
  242. const CLocString & // Current string for the item.
  243. CLocItem::GetLocString(void)
  244. const
  245. {
  246. return m_lsString;
  247. }
  248. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  249. //
  250. // Get the 'intructions' (developer provided comments) for an item.
  251. //
  252. //-----------------------------------------------------------------------------
  253. inline
  254. const CPascalString & // Developer intructions.
  255. CLocItem::GetInstructions(void)
  256. const
  257. {
  258. return m_pstrInstructions;
  259. }
  260. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  261. //
  262. // Get the 'term notes' (glossary note) for an item.
  263. //
  264. //-----------------------------------------------------------------------------
  265. inline
  266. const CPascalString & // Glossary Notes.
  267. CLocItem::GetTermNotes(void)
  268. const
  269. {
  270. return m_pstrTermNotes;
  271. }
  272. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  273. //
  274. // Get the 'InstrAtt' for an item.
  275. //
  276. //-----------------------------------------------------------------------------
  277. inline
  278. BOOL
  279. CLocItem::GetFInstrAtt(void)
  280. const
  281. {
  282. return m_Flags.m_fInstrAtt;
  283. }
  284. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  285. //
  286. // Gets the binary content for an item. If this function returns FALSE, the
  287. // return pointer is set to NULL.
  288. //
  289. //-----------------------------------------------------------------------------
  290. inline
  291. BOOL // TRUE if the content is valid.
  292. CLocItem::GetBinary(
  293. const CLocBinary *&pBinary) // RETURN pointer
  294. const
  295. {
  296. pBinary = m_pBinary;
  297. return pBinary != NULL;
  298. }
  299. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  300. //
  301. // Similar to GetBinary() but after this call
  302. // the item will no longer have a CLocBinary.
  303. // By calling this member, the caller gets
  304. // ownership of the CLocBinary, so he is responsible
  305. // of either deleting the CLocBinary or assigning
  306. // it to another CLocItem via the SetBinary() member.
  307. //
  308. //-----------------------------------------------------------------------------
  309. inline
  310. BOOL // TRUE if a CLocBinary was extracted.
  311. CLocItem::ExtractBinary(
  312. CLocBinary *&pBinary) // RETURN pointer
  313. {
  314. pBinary = m_pBinary;
  315. m_pBinary = NULL;
  316. return pBinary != NULL;
  317. }
  318. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  319. //
  320. // Returns the icon type fro the item.
  321. //
  322. //-----------------------------------------------------------------------------
  323. inline
  324. CIT::IconType
  325. CLocItem::GetIconType(void)
  326. const
  327. {
  328. return m_icIconType;
  329. }
  330. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  331. //
  332. // Returns the editor for this item (and all it's children!).
  333. //
  334. //-----------------------------------------------------------------------------
  335. inline
  336. VisualEditor
  337. CLocItem::GetVisualEditor(void)
  338. const
  339. {
  340. return m_veEditor;
  341. }
  342. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  343. //
  344. // Sets the database id for the item. ONLY the database code should use
  345. // this method. This may become protected/private in the future!
  346. //
  347. // The Database id will not allow itself be set twice!
  348. //
  349. //-----------------------------------------------------------------------------
  350. inline
  351. void
  352. CLocItem::SetMyDatabaseId(
  353. const DBID& dbid) // New datbase id for this item.
  354. {
  355. m_dbid = dbid;
  356. }
  357. inline void
  358. CLocItem::SetPseudoParent(
  359. const DBID &dbid)
  360. {
  361. m_PseudoParent.Clear();
  362. m_PseudoParent = dbid;
  363. }
  364. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  365. //
  366. // Sets the localization status for the translation part of the item.
  367. // This is of interest to the Updater code, for example.
  368. //
  369. //-----------------------------------------------------------------------------
  370. inline
  371. void
  372. CLocItem::SetTranslationStatus(
  373. CLS::LocStatus lsNewStatus) // New status for the item.
  374. {
  375. m_lsTranslationStatus = lsNewStatus;
  376. }
  377. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  378. //
  379. // Sets the localization status for the binary part of the item.
  380. // This is of interest to the Updater code, for example.
  381. //
  382. //-----------------------------------------------------------------------------
  383. inline
  384. void
  385. CLocItem::SetBinaryStatus(
  386. CLS::LocStatus lsNewStatus) // New status for the item.
  387. {
  388. m_lsBinaryStatus = lsNewStatus;
  389. }
  390. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  391. //
  392. // Sets the translation origin for the item. This is of interest to the
  393. // Updater code, for example.
  394. //
  395. //-----------------------------------------------------------------------------
  396. inline
  397. void
  398. CLocItem::SetTranslationOrigin(
  399. CTO::TranslationOrigin toNewOrigin) // New origin for the item.
  400. {
  401. m_toTranslationOrigin = toNewOrigin;
  402. }
  403. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  404. //
  405. // Sets the approval status for the item.
  406. // This is of interest to the Updater code, for example.
  407. //
  408. //-----------------------------------------------------------------------------
  409. inline
  410. void
  411. CLocItem::SetApprovalStatus(
  412. CAS::ApprovalState asNewStatus) // New status for the item.
  413. {
  414. m_asApprovalStatus = asNewStatus;
  415. }
  416. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  417. //
  418. // Sets the auto approval status for the item.
  419. //
  420. //-----------------------------------------------------------------------------
  421. inline
  422. void
  423. CLocItem::SetAutoApproved(
  424. CAA::AutoApproved aaNewStatus) // New status for the item.
  425. {
  426. m_auto_approved = aaNewStatus;
  427. }
  428. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  429. //
  430. // Sets the confidence level for the item.
  431. //
  432. //-----------------------------------------------------------------------------
  433. inline
  434. void
  435. CLocItem::SetConfidenceLevel(
  436. long lConfLevel) // New confidence level for the item.
  437. {
  438. m_confidence_level = lConfLevel;
  439. }
  440. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  441. //
  442. // Sets the custom1 for the item.
  443. //
  444. //-----------------------------------------------------------------------------
  445. inline
  446. void
  447. CLocItem::SetCustom1(
  448. long lCustom1)
  449. {
  450. m_custom1 = lCustom1;
  451. }
  452. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  453. //
  454. // Sets the custom2 for the item.
  455. //
  456. //-----------------------------------------------------------------------------
  457. inline
  458. void
  459. CLocItem::SetCustom2(
  460. long lCustom2)
  461. {
  462. m_custom2 = lCustom2;
  463. }
  464. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  465. //
  466. // Sets the custom3 for the item.
  467. //
  468. //-----------------------------------------------------------------------------
  469. inline
  470. void
  471. CLocItem::SetCustom3(
  472. long lCustom3)
  473. {
  474. m_custom3 = lCustom3;
  475. }
  476. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  477. //
  478. // Sets the custom4 for the item.
  479. //
  480. //-----------------------------------------------------------------------------
  481. inline
  482. void
  483. CLocItem::SetCustom4(
  484. long lCustom4)
  485. {
  486. m_custom4 = lCustom4;
  487. }
  488. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  489. //
  490. // Sets the custom5 for the item.
  491. //
  492. //-----------------------------------------------------------------------------
  493. inline
  494. void
  495. CLocItem::SetCustom5(
  496. long lCustom5)
  497. {
  498. m_custom5 = lCustom5;
  499. }
  500. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  501. //
  502. // Sets the custom6 for the item.
  503. //
  504. //-----------------------------------------------------------------------------
  505. inline
  506. void
  507. CLocItem::SetCustom6(
  508. long lCustom6)
  509. {
  510. m_custom6 = lCustom6;
  511. }
  512. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  513. //
  514. // Sets the display order for an item. This is used to provide a default
  515. // ordering of items in the resource table.
  516. //
  517. //-----------------------------------------------------------------------------
  518. inline
  519. void
  520. CLocItem::SetDisplayOrder(
  521. UINT uiNewDisplayOrder) // New display order for the item.
  522. {
  523. m_uiDisplayOrder = uiNewDisplayOrder;
  524. }
  525. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  526. //
  527. // Sets the visual editor for the item. The parser sets this.
  528. //
  529. //-----------------------------------------------------------------------------
  530. inline
  531. void
  532. CLocItem::SetVisualEditor(
  533. VisualEditor veNewEditor)
  534. {
  535. m_veEditor = veNewEditor;
  536. }
  537. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  538. //
  539. // Set the icon type. This is displayed bside the item in the Translation
  540. // table.
  541. //
  542. //-----------------------------------------------------------------------------
  543. inline
  544. void
  545. CLocItem::SetIconType(
  546. CIT::IconType itNewIconType)
  547. {
  548. m_icIconType = itNewIconType;
  549. }
  550. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  551. //
  552. // Sets the intstructions for the item.
  553. //
  554. //-----------------------------------------------------------------------------
  555. inline
  556. void
  557. CLocItem::SetInstructions(
  558. const CPascalString &pstrNewInstructions) // New instructions.
  559. {
  560. if (pstrNewInstructions != m_pstrInstructions)
  561. {
  562. m_pstrInstructions = pstrNewInstructions;
  563. SetFInstructionsDirty(TRUE);
  564. }
  565. }
  566. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  567. //
  568. // Sets the term notes for the item.
  569. //
  570. //-----------------------------------------------------------------------------
  571. inline
  572. void
  573. CLocItem::SetTermNotes(
  574. const CPascalString &pstrNewTermNotes) // New Term Notes.
  575. {
  576. if (pstrNewTermNotes != m_pstrTermNotes)
  577. {
  578. m_pstrTermNotes = pstrNewTermNotes;
  579. }
  580. }
  581. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  582. //
  583. // Sets the InstrAtt for the item.
  584. //
  585. //-----------------------------------------------------------------------------
  586. inline
  587. void
  588. CLocItem::SetFInstrAtt(
  589. BOOL f)
  590. {
  591. m_Flags.m_fInstrAtt = f;
  592. }
  593. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  594. //
  595. // Clears all the dirty flags for the item and its sub-components.
  596. //
  597. //-----------------------------------------------------------------------------
  598. inline
  599. void
  600. CLocItem::ClearDirtyFlags(void)
  601. {
  602. m_Flags.m_fTargetStringDirty = m_Flags.m_fStringDirty =
  603. m_Flags.m_fItemDirty = m_Flags.m_fInstructionsDirty = 0;
  604. }
  605. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  606. //
  607. // Clear/Set various internal state flags
  608. //
  609. //-----------------------------------------------------------------------------
  610. inline
  611. BOOL
  612. CLocItem::GetFEqualSrcTgtString(void) const
  613. {
  614. return m_Flags.m_fEqualSrcTgtString;
  615. }
  616. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  617. //
  618. // TODO (eduardof) - comment this function
  619. //
  620. //-----------------------------------------------------------------------------
  621. inline
  622. void
  623. CLocItem::SetFEqualSrcTgtString(BOOL f)
  624. {
  625. m_Flags.m_fEqualSrcTgtString = f;
  626. }
  627. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  628. //
  629. // TODO (eduardof) - comment this function
  630. //
  631. //-----------------------------------------------------------------------------
  632. inline
  633. BOOL
  634. CLocItem::GetFEqualSrcTgtBinary(void) const
  635. {
  636. return m_Flags.m_fEqualSrcTgtBinary;
  637. }
  638. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  639. //
  640. // TODO (eduardof) - comment this function
  641. //
  642. //-----------------------------------------------------------------------------
  643. inline
  644. void
  645. CLocItem::SetFEqualSrcTgtBinary(BOOL f)
  646. {
  647. m_Flags.m_fEqualSrcTgtBinary = f;
  648. }
  649. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  650. //
  651. // Get and set methods for all the Dirty flags. Used by the update code.
  652. //
  653. //-----------------------------------------------------------------------------
  654. inline
  655. BOOL
  656. CLocItem::GetFStringDirty(void) const
  657. {
  658. return m_Flags.m_fStringDirty;
  659. }
  660. inline
  661. void
  662. CLocItem::SetFStringDirty(BOOL f)
  663. {
  664. m_Flags.m_fStringDirty = f;
  665. }
  666. inline
  667. BOOL
  668. CLocItem::GetFTargetStringDirty(void) const
  669. {
  670. return m_Flags.m_fTargetStringDirty;
  671. }
  672. inline
  673. void
  674. CLocItem::SetFTargetStringDirty(BOOL f)
  675. {
  676. m_Flags.m_fTargetStringDirty = f;
  677. }
  678. inline
  679. BOOL
  680. CLocItem::GetFItemDirty(void) const
  681. {
  682. return m_Flags.m_fItemDirty;
  683. }
  684. inline
  685. void
  686. CLocItem::SetFItemDirty(BOOL f)
  687. {
  688. m_Flags.m_fItemDirty = f;
  689. }
  690. inline
  691. BOOL
  692. CLocItem::GetFInstructionsDirty(void)
  693. const
  694. {
  695. return m_Flags.m_fInstructionsDirty;
  696. }
  697. inline
  698. void
  699. CLocItem::SetFInstructionsDirty(
  700. BOOL f)
  701. {
  702. m_Flags.m_fInstructionsDirty = f;
  703. }
  704. inline
  705. BOOL
  706. CLocItem::GetFValidTranslation(void) const
  707. {
  708. return m_Flags.m_fValidTranslation;
  709. }
  710. inline
  711. void
  712. CLocItem::SetFValidTranslation(BOOL f)
  713. {
  714. m_Flags.m_fValidTranslation = f;
  715. }
  716. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  717. //
  718. // Global is anything in this CBinary dirty
  719. //
  720. //-----------------------------------------------------------------------------
  721. inline
  722. BOOL
  723. CLocItem::IsAnyDirty()
  724. {
  725. return m_Flags.m_fItemDirty ||
  726. m_Flags.m_fStringDirty ||
  727. m_Flags.m_fTargetStringDirty ||
  728. m_Flags.m_fInstructionsDirty ||
  729. (m_pBinary==NULL ? FALSE : m_pBinary->GetFBinaryDirty());
  730. }
  731. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  732. //
  733. // Clear/Set various parser flags
  734. //
  735. //-----------------------------------------------------------------------------
  736. inline
  737. BOOL
  738. CLocItem::GetFDevLock(void) const
  739. {
  740. return m_Flags.m_fDevLock;
  741. }
  742. inline
  743. void
  744. CLocItem::SetFDevLock(BOOL f)
  745. {
  746. m_Flags.m_fDevLock = f;
  747. }
  748. inline
  749. BOOL
  750. CLocItem::GetFUsrLock(void) const
  751. {
  752. return m_Flags.m_fUsrLock;
  753. }
  754. inline
  755. void
  756. CLocItem::SetFUsrLock(BOOL f)
  757. {
  758. m_Flags.m_fUsrLock = f;
  759. }
  760. inline
  761. BOOL
  762. CLocItem::GetFTransLock(void) const
  763. {
  764. return m_Flags.m_fTransLock;
  765. }
  766. inline
  767. void
  768. CLocItem::SetFTransLock(BOOL f)
  769. {
  770. m_Flags.m_fTransLock = f;
  771. }
  772. inline
  773. BOOL
  774. CLocItem::GetFExpandable(void) const
  775. {
  776. return m_Flags.m_fExpandable;
  777. }
  778. inline
  779. void
  780. CLocItem::SetFExpandable(BOOL f)
  781. {
  782. m_Flags.m_fExpandable = f;
  783. }
  784. inline
  785. BOOL
  786. CLocItem::GetFDisplayable(void) const
  787. {
  788. return m_Flags.m_fDisplayable;
  789. }
  790. inline
  791. void
  792. CLocItem::SetFDisplayable(BOOL f)
  793. {
  794. m_Flags.m_fDisplayable = f;
  795. }
  796. inline
  797. BOOL
  798. CLocItem::GetFNoResTable(void) const
  799. {
  800. return m_Flags.m_fNoResTable;
  801. }
  802. inline
  803. void
  804. CLocItem::SetFNoResTable(BOOL f)
  805. {
  806. m_Flags.m_fNoResTable = f;
  807. }
  808. inline
  809. void
  810. CLocItem::SetLocString(
  811. const CLocString &lsNewString)
  812. {
  813. m_lsString = lsNewString;
  814. }
  815. inline
  816. void
  817. CLocItem::SetUniqueId(
  818. const CLocUniqueId &uid)
  819. {
  820. m_uid = uid;
  821. }
  822. inline
  823. void
  824. CLocItem::ClearUniqueId(void)
  825. {
  826. m_uid.ClearId();
  827. }
  828. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  829. //
  830. // Sets the binary content for the item. If there was a previous binary
  831. // content, it is deleted.
  832. //
  833. //-----------------------------------------------------------------------------
  834. inline
  835. void
  836. CLocItem::SetBinary(
  837. CLocBinary *pNewBinary)
  838. {
  839. if (m_pBinary != NULL)
  840. {
  841. delete m_pBinary;
  842. }
  843. m_pBinary = pNewBinary;
  844. }
  845. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  846. //
  847. // Is the item editable?
  848. //
  849. //-----------------------------------------------------------------------------
  850. inline
  851. BOOL
  852. CLocItem::IsLocked(void) const
  853. {
  854. return (GetFDevLock() || GetFUsrLock());
  855. }
  856. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  857. //
  858. // Is the item ignored by the visual editor
  859. //
  860. //-----------------------------------------------------------------------------
  861. inline
  862. BOOL CLocItem::GetFVisEditorIgnore(void) const
  863. {
  864. return m_Flags.m_fVisEditorIgnore;
  865. }
  866. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  867. //
  868. // Set if the item is ignored by the visual editor
  869. //
  870. //-----------------------------------------------------------------------------
  871. inline
  872. void
  873. CLocItem::SetFVisEditorIgnore(BOOL f)
  874. {
  875. m_Flags.m_fVisEditorIgnore = f;
  876. }
  877. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  878. //
  879. // Needed so that the CMnemonic class can be used as the key of a CMap
  880. //
  881. //-----------------------------------------------------------------------------
  882. inline
  883. CMnemonic::operator unsigned long() const
  884. {
  885. return MAKELONG(m_cHotkeyChar, m_nHotkeyScope);
  886. }