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.

206 lines
2.8 KiB

  1. //
  2. // propdata.h - CandidateUI property data type
  3. //
  4. #ifndef PROPDATA_H
  5. #define PROPDATA_H
  6. //
  7. //
  8. //
  9. typedef enum _PROPFONTORIENTATION
  10. {
  11. PROPFONTORT_DONTCARE,
  12. PROPFONTORT_ORT0,
  13. PROPFONTORT_ORT90,
  14. PROPFONTORT_ORT180,
  15. PROPFONTORT_ORT270,
  16. } PROPFONTORIENTATION;
  17. //
  18. // CPropBool
  19. // = CandidateUI property data - boolean =
  20. //
  21. class CPropBool
  22. {
  23. public:
  24. CPropBool( void );
  25. virtual ~CPropBool( void );
  26. HRESULT Set( BOOL flag );
  27. HRESULT Get( BOOL *pflag );
  28. __inline BOOL Get( void )
  29. {
  30. return m_flag;
  31. }
  32. protected:
  33. BOOL m_flag;
  34. };
  35. //
  36. // CPropUINT
  37. // = CandidateUI property data - UINT =
  38. //
  39. class CPropUINT
  40. {
  41. public:
  42. CPropUINT( void );
  43. virtual ~CPropUINT( void );
  44. HRESULT Set( UINT val );
  45. HRESULT Get( UINT *pval );
  46. __inline UINT Get( void )
  47. {
  48. return m_val;
  49. }
  50. protected:
  51. UINT m_val;
  52. };
  53. //
  54. // CPropLong
  55. // = CandidateUI property data - Long =
  56. //
  57. class CPropLong
  58. {
  59. public:
  60. CPropLong( void );
  61. virtual ~CPropLong( void );
  62. HRESULT Set( LONG val );
  63. HRESULT Get( LONG *pval );
  64. __inline LONG Get( void )
  65. {
  66. return m_val;
  67. }
  68. protected:
  69. LONG m_val;
  70. };
  71. //
  72. // CPropSize
  73. // = CandidateUI property data - size =
  74. //
  75. class CPropSize
  76. {
  77. public:
  78. CPropSize( void );
  79. virtual ~CPropSize( void );
  80. HRESULT Set( SIZE *psize );
  81. HRESULT Get( SIZE *psize );
  82. __inline LONG GetWidth( void )
  83. {
  84. return m_size.cx;
  85. }
  86. __inline LONG GetHeight( void )
  87. {
  88. return m_size.cy;
  89. }
  90. __inline Set( LONG cx, LONG cy )
  91. {
  92. m_size.cx = cx;
  93. m_size.cy = cy;
  94. }
  95. protected:
  96. SIZE m_size;
  97. };
  98. //
  99. // CPropPoint
  100. // = CandidateUI property data - point =
  101. //
  102. class CPropPoint
  103. {
  104. public:
  105. CPropPoint( void );
  106. virtual ~CPropPoint( void );
  107. HRESULT Set( POINT *ppt );
  108. HRESULT Get( POINT *ppt );
  109. __inline LONG GetX( void )
  110. {
  111. return m_pt.x;
  112. }
  113. __inline LONG GetY( void )
  114. {
  115. return m_pt.y;
  116. }
  117. __inline Set( LONG px, LONG py )
  118. {
  119. m_pt.x = px;
  120. m_pt.y = py;
  121. }
  122. protected:
  123. POINT m_pt;
  124. };
  125. //
  126. // CPropText
  127. // = CandidateUI property data - text =
  128. //
  129. class CPropText
  130. {
  131. public:
  132. CPropText( void );
  133. virtual ~CPropText( void );
  134. HRESULT Set( BSTR bstr );
  135. HRESULT Get( BSTR *pbstr );
  136. __inline LPCWSTR Get( void )
  137. {
  138. return m_pwch;
  139. }
  140. protected:
  141. LPWSTR m_pwch;
  142. };
  143. //
  144. // CPropFont
  145. // = CandidateUI property data - font =
  146. //
  147. class CPropFont
  148. {
  149. public:
  150. CPropFont( void );
  151. virtual ~CPropFont( void );
  152. HRESULT Set( LOGFONTW *plf );
  153. HRESULT Get( LOGFONTW *plf );
  154. HRESULT SetOrientation( PROPFONTORIENTATION ort );
  155. __inline HFONT Get( void )
  156. {
  157. return m_hFont;
  158. }
  159. protected:
  160. LOGFONTW m_lf;
  161. PROPFONTORIENTATION m_ort;
  162. HFONT m_hFont;
  163. HFONT CreateFontProc( const LOGFONTW *plf, PROPFONTORIENTATION ort );
  164. };
  165. #endif // PROPDATA_H