home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / toolkt21 / cplus / os2h / wppower.xh < prev    next >
Encoding:
Text File  |  1993-05-02  |  7.7 KB  |  320 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: wppower.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitxh: 1.11
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Module Header
  13.  * 
  14.  *  Module Name: WPPOWER
  15.  * 
  16.  *  OS/2 Presentation Manager Workplace class definitions
  17.  * 
  18.  *  Copyright (c) International Business Machines Corporation 1991, 1992
  19.  * 
  20.  */
  21.  
  22. #ifndef wppower_xh
  23. #define wppower_xh
  24. class WPPower;
  25.  
  26. #define WPPower_MajorVersion 1
  27. #define WPPower_MinorVersion 2
  28.  
  29.  
  30. /*
  31.  * Passthru lines: File: "C.xh", "before"
  32.  */
  33. #define OPEN_STATUS  131
  34.     #define OPEN_BATTERY 132
  35. /* C++ som defs */
  36. #include <somcls.xh>
  37.  
  38. /* C++ parent def */
  39. #ifndef wpabs_xh
  40. #include "wpabs.xh"
  41. #endif
  42.  
  43. #ifndef WPPower_API
  44. #define WPPower_API
  45. /*
  46.  * The Class API
  47.  */
  48.  
  49. /* A procedure to create the WPPower Class */
  50. SOMEXTERN SOMClass * SOMLINK WPPowerNewClass(
  51.         integer4 majorVersion,
  52.         integer4 minorVersion);
  53.  
  54. /* A macro to return the WPPower class object */
  55. class M_WPPower;
  56. #define _WPPower ((M_WPPower*)WPPowerClassData.classObject)
  57.  
  58. /* The static interface to WPPower and its instances */
  59. SOMEXTERN struct WPPowerClassDataStructure {
  60.     SOMClass *classObject;
  61.     somMToken wpChangePowerState;
  62.     somMToken wpSetPowerManagement;
  63.     somMToken wpQueryPowerManagement;
  64.     somMToken wpSetPowerConfirmation;
  65.     somMToken wpQueryPowerConfirmation;
  66.     somMToken wpAddPowerPage;
  67.     somMToken wpAddPowerViewPage;
  68.     somMToken wpSetAutoRefresh;
  69.     somMToken wpQueryAutoRefresh;
  70.     somMToken wpQueryRefreshRate;
  71.     somMToken wpSetRefreshRate;
  72.     somMToken wpQueryEventSemaphore;
  73.     somMToken wpSetEventSemaphore;
  74.     somMToken wpQueryDefStatusView;
  75.     somMToken wpSetDefStatusView;
  76. } WPPowerClassData;
  77.  
  78. /*
  79.  * -- Typedefs for Procedures that support WPPower Methods
  80.  */
  81. extern "C" {
  82. typedef ULONG    (SOMLINK *somTD_WPPower_wpAddPowerPage)(WPPower *somSelf,HWND hwndNotebook);
  83. typedef ULONG    (SOMLINK *somTD_WPPower_wpAddPowerViewPage)(WPPower *somSelf,HWND hwndNotebook);
  84. typedef BOOL    (SOMLINK *somTD_WPPower_wpChangePowerState)(WPPower *somSelf,ULONG ulParm1,ULONG ulParm2);
  85. typedef BOOL    (SOMLINK *somTD_WPPower_wpQueryAutoRefresh)(WPPower *somSelf);
  86. typedef ULONG    (SOMLINK *somTD_WPPower_wpQueryDefStatusView)(WPPower *somSelf);
  87. typedef BOOL    (SOMLINK *somTD_WPPower_wpQueryPowerConfirmation)(WPPower *somSelf);
  88. typedef BOOL    (SOMLINK *somTD_WPPower_wpQueryPowerManagement)(WPPower *somSelf);
  89. typedef ULONG    (SOMLINK *somTD_WPPower_wpQueryRefreshRate)(WPPower *somSelf);
  90. typedef VOID    (SOMLINK *somTD_WPPower_wpSetAutoRefresh)(WPPower *somSelf,BOOL fAutoRefresh);
  91. typedef VOID    (SOMLINK *somTD_WPPower_wpSetDefStatusView)(WPPower *somSelf,ULONG ulDefStatus);
  92. typedef VOID    (SOMLINK *somTD_WPPower_wpSetPowerConfirmation)(WPPower *somSelf,BOOL fConfirm);
  93. typedef BOOL    (SOMLINK *somTD_WPPower_wpSetPowerManagement)(WPPower *somSelf,BOOL fPower);
  94. typedef BOOL    (SOMLINK *somTD_WPPower_wpSetRefreshRate)(WPPower *somSelf,ULONG ulRefreshRate);
  95. }
  96.  
  97.  
  98. #endif /* WPPower_API */
  99.  
  100.  
  101. /*
  102.  * -- The C++ Wrapper Class for WPPower
  103.  */
  104. class WPPower : public WPAbstract
  105. {
  106. public:
  107.  
  108. void *operator new(size_t size)
  109. {
  110.    (void) size;
  111.    if (!WPPowerClassData.classObject) 
  112.       WPPowerNewClass(WPPower_MajorVersion,WPPower_MinorVersion);
  113.    return (void *)
  114.       ((somTD_SOMClass_somNew)
  115.       somResolve(SOM_TestCls((SOMAny *)(WPPowerClassData.classObject),
  116.                              SOMClassClassData.classObject),
  117.                  SOMClassClassData.somNew))
  118.          ((SOMClass*)(WPPowerClassData.classObject));
  119. }
  120.  
  121. void operator delete(void * obj)
  122. {
  123.    ((SOMObject *)obj)->somFree();
  124. }
  125.  
  126. /* public method: wpAddPowerPage */
  127. ULONG    wpAddPowerPage(HWND hwndNotebook)
  128. {
  129.    return (ULONG) SOM_Resolve((SOMAny *)this,WPPower,wpAddPowerPage)
  130.     (this,hwndNotebook);
  131. }
  132.  
  133.  
  134. /* public method: wpAddPowerViewPage */
  135. ULONG    wpAddPowerViewPage(HWND hwndNotebook)
  136. {
  137.    return (ULONG) SOM_Resolve((SOMAny *)this,WPPower,wpAddPowerViewPage)
  138.     (this,hwndNotebook);
  139. }
  140.  
  141.  
  142. /* public method: wpChangePowerState */
  143. BOOL    wpChangePowerState(ULONG ulParm1,
  144.         ULONG ulParm2)
  145. {
  146.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpChangePowerState)
  147.     (this,ulParm1,ulParm2);
  148. }
  149.  
  150.  
  151. /* public method: wpQueryAutoRefresh */
  152. BOOL    wpQueryAutoRefresh()
  153. {
  154.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpQueryAutoRefresh)
  155.     (this);
  156. }
  157.  
  158.  
  159. /* public method: wpQueryDefStatusView */
  160. ULONG    wpQueryDefStatusView()
  161. {
  162.    return (ULONG) SOM_Resolve((SOMAny *)this,WPPower,wpQueryDefStatusView)
  163.     (this);
  164. }
  165.  
  166.  
  167. /* public method: wpQueryPowerConfirmation */
  168. BOOL    wpQueryPowerConfirmation()
  169. {
  170.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpQueryPowerConfirmation)
  171.     (this);
  172. }
  173.  
  174.  
  175. /* public method: wpQueryPowerManagement */
  176. BOOL    wpQueryPowerManagement()
  177. {
  178.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpQueryPowerManagement)
  179.     (this);
  180. }
  181.  
  182.  
  183. /* public method: wpQueryRefreshRate */
  184. ULONG    wpQueryRefreshRate()
  185. {
  186.    return (ULONG) SOM_Resolve((SOMAny *)this,WPPower,wpQueryRefreshRate)
  187.     (this);
  188. }
  189.  
  190.  
  191. /* public method: wpSetAutoRefresh */
  192. VOID    wpSetAutoRefresh(BOOL fAutoRefresh)
  193. {
  194.    SOM_Resolve((SOMAny *)this,WPPower,wpSetAutoRefresh)
  195.     (this,fAutoRefresh);
  196. }
  197.  
  198.  
  199. /* public method: wpSetDefStatusView */
  200. VOID    wpSetDefStatusView(ULONG ulDefStatus)
  201. {
  202.    SOM_Resolve((SOMAny *)this,WPPower,wpSetDefStatusView)
  203.     (this,ulDefStatus);
  204. }
  205.  
  206.  
  207. /* public method: wpSetPowerConfirmation */
  208. VOID    wpSetPowerConfirmation(BOOL fConfirm)
  209. {
  210.    SOM_Resolve((SOMAny *)this,WPPower,wpSetPowerConfirmation)
  211.     (this,fConfirm);
  212. }
  213.  
  214.  
  215. /* public method: wpSetPowerManagement */
  216. BOOL    wpSetPowerManagement(BOOL fPower)
  217. {
  218.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpSetPowerManagement)
  219.     (this,fPower);
  220. }
  221.  
  222.  
  223. /* public method: wpSetRefreshRate */
  224. BOOL    wpSetRefreshRate(ULONG ulRefreshRate)
  225. {
  226.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPower,wpSetRefreshRate)
  227.     (this,ulRefreshRate);
  228. }
  229.  
  230.  
  231.  
  232. };   /* WPPower */
  233.  
  234.  
  235.  
  236. #endif       /* wppower_xh */
  237.  
  238. /*
  239.  * This file was generated by the SOM Compiler.
  240.  * FileName: wppower.xh.
  241.  * Generated using:
  242.  *     SOM Precompiler spc: 1.22
  243.  *     SOM Emitter emitxh: 1.11
  244.  */
  245. #ifndef wppower_mxh
  246. #define wppower_mxh
  247. class M_WPPower;
  248.  
  249. #define M_WPPower_MajorVersion 1
  250. #define M_WPPower_MinorVersion 2
  251.  
  252. /* C++ som defs */
  253. #include <somcls.xh>
  254.  
  255. /* C++ parent def */
  256. #ifndef wpabs_xh
  257. #include "wpabs.xh"
  258. #endif
  259.  
  260. #ifndef M_WPPower_API
  261. #define M_WPPower_API
  262. /*
  263.  * The Class API
  264.  */
  265.  
  266. /* A procedure to create the M_WPPower Class */
  267. SOMEXTERN SOMClass * SOMLINK M_WPPowerNewClass(
  268.         integer4 majorVersion,
  269.         integer4 minorVersion);
  270.  
  271. /* A macro to return the M_WPPower class object */
  272. #define _M_WPPower ((SOMClass*)M_WPPowerClassData.classObject)
  273.  
  274. /* The static interface to M_WPPower and its instances */
  275. SOMEXTERN struct M_WPPowerClassDataStructure {
  276.     SOMClass *classObject;
  277. } M_WPPowerClassData;
  278.  
  279. /*
  280.  * -- Typedefs for Procedures that support M_WPPower Methods
  281.  */
  282. extern "C" {
  283. }
  284.  
  285.  
  286. #endif /* M_WPPower_API */
  287.  
  288.  
  289. /*
  290.  * -- The C++ Wrapper Class for M_WPPower
  291.  */
  292. class M_WPPower : public M_WPAbstract
  293. {
  294. public:
  295.  
  296. void *operator new(size_t size)
  297. {
  298.    (void) size;
  299.    if (!M_WPPowerClassData.classObject) 
  300.       M_WPPowerNewClass(M_WPPower_MajorVersion,M_WPPower_MinorVersion);
  301.    return (void *)
  302.       ((somTD_SOMClass_somNew)
  303.       somResolve(SOM_TestCls((SOMAny *)(M_WPPowerClassData.classObject),
  304.                              SOMClassClassData.classObject),
  305.                  SOMClassClassData.somNew))
  306.          ((SOMClass*)(M_WPPowerClassData.classObject));
  307. }
  308.  
  309. void operator delete(void * obj)
  310. {
  311.    ((SOMObject *)obj)->somFree();
  312. }
  313.  
  314.  
  315. };   /* M_WPPower */
  316.  
  317.  
  318.  
  319. #endif       /* wppower_mxh */
  320.