Source code of Windows XP (NT5)
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.

165 lines
3.5 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: binary.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. #ifndef ESPUTIL_BINARY_H
  11. #define ESPUTIL_BINARY_H
  12. //
  13. // Base class for binary classes. This allows serialization
  14. // of arbitrary data.
  15. //
  16. class CLocVariant;
  17. class CLocItem;
  18. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  19. // as base for dll-interface class 'bar'
  20. class LTAPIENTRY CLocBinary : public CObject
  21. {
  22. public:
  23. CLocBinary();
  24. virtual void AssertValid(void) const;
  25. //
  26. // Serialization routines. Supports serialization withour dynamic creation
  27. //
  28. virtual void Serialize(CArchive &archive); //Afx serialize function
  29. //
  30. // Result code for comparing one binary class from another.
  31. //
  32. enum CompareCode
  33. {
  34. noChange,
  35. partialChange, //Only non-localizable data changed
  36. fullChange //Localizable data changed
  37. };
  38. virtual CompareCode Compare (const CLocBinary *) = 0;
  39. // Called to update the non-localizable data - Used when compare returns
  40. // partialChange
  41. virtual void PartialUpdate(const CLocBinary * binSource) = 0;
  42. enum Alignment
  43. {
  44. a_Default,
  45. a_Left,
  46. a_Center,
  47. a_Right,
  48. a_Top,
  49. a_VCenter,
  50. a_Bottom
  51. };
  52. //
  53. // The universe of possible binary properties that may be queried for.
  54. // This order must NOT change, or you may break old parsers! Put new
  55. // properties at the end.
  56. //
  57. enum Property
  58. {
  59. //
  60. // Native formats..
  61. //
  62. p_dwXPosition,
  63. p_dwYPosition,
  64. p_dwXDimension,
  65. p_dwYDimension,
  66. p_dwAlignment,
  67. p_blbNativeImage,
  68. p_dwFontSize,
  69. p_pasFontName,
  70. p_dwFontWeight,
  71. p_dwFontStyle,
  72. //
  73. // Interchange formats..
  74. //
  75. p_dwWin32XPosition,
  76. p_dwWin32YPosition,
  77. p_dwWin32XDimension,
  78. p_dwWin32YDimension,
  79. p_dwWin32Alignment, // Use Alignment enum
  80. p_dwWin32ExtAlignment, // Extended - Use Alignment enum
  81. p_blbWin32Bitmap,
  82. p_blbWin32DialogInit,
  83. //
  84. // Generic - usable both for Native and Interchange
  85. //
  86. p_bVisible, // Is the item visable?
  87. p_bDisabled, // Is the item disabled?
  88. p_bLTRReadingOrder, // Is the reading order L to R?
  89. p_bLeftScrollBar, // Scroll bar on left?
  90. //
  91. // "Styles" tab for dialog controls.
  92. //
  93. p_bLeftText, // Display text to left of control?
  94. p_bWin32LTRLayout, // WS_EX_LAYOUT_RTL
  95. p_bWin32NoInheritLayout, // WS_EX_NOINHERIT_LAYOUT
  96. p_dwWin32VAlignment, // Use Alignment enum
  97. // Insert new entries here
  98. };
  99. virtual BOOL GetProp(const Property, CLocVariant &) const;
  100. virtual BOOL SetProp(const Property, const CLocVariant &);
  101. //
  102. // Attempts to convert CBinary in CLocItem to same type as this
  103. //
  104. virtual BOOL Convert(CLocItem *);
  105. virtual BinaryId GetBinaryId(void) const = 0;
  106. virtual ~CLocBinary();
  107. BOOL NOTHROW GetFBinaryDirty(void) const;
  108. BOOL NOTHROW GetFPartialUpdateBinary(void) const;
  109. void NOTHROW SetFBinaryDirty(BOOL);
  110. void NOTHROW SetFPartialUpdateBinary(BOOL);
  111. protected:
  112. private:
  113. //
  114. // Copy constructor and assignment are hidden, since we
  115. // shouldn't be copying these things around.
  116. //
  117. CLocBinary(const CLocBinary &);
  118. const CLocBinary& operator=(const CLocBinary &);
  119. //
  120. // These allow a user to determine what parts of the item have been
  121. // changed.
  122. //
  123. struct Flags
  124. {
  125. BOOL m_fBinaryDirty :1;
  126. BOOL m_fPartialUpdateBinary :1;
  127. };
  128. Flags m_Flags;
  129. };
  130. #pragma warning(default: 4275)
  131. #include "binary.inl"
  132. #endif