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.

167 lines
3.5 KiB

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