home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / WPPOWER.XH < prev    next >
Text File  |  1997-07-09  |  12KB  |  501 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: E:\cwpsh\rel\os2c\include\base\os2\wppower.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.14
  7.  *     SOM Emitter emitxh: 2.43
  8.  */
  9.  
  10. /*
  11.  *   Module Header
  12.  * 
  13.  *   Module Name: WPPOWER
  14.  * 
  15.  *   OS/2 Presentation Manager Workplace class definitions
  16.  * 
  17.  *   Copyright (c) International Business Machines Corporation 1991, 1992
  18.  * 
  19.  */
  20.  
  21.  
  22. #ifndef SOM_WPPower_xh
  23. #define SOM_WPPower_xh
  24.  
  25. class WPPower;
  26.  
  27. #define WPPower_MajorVersion 1
  28. #define WPPower_MinorVersion 2
  29.  
  30. /*
  31.  * Passthru lines: File: "C.h", "before"
  32.  */
  33. #define OPEN_STATUS  131
  34.     #define OPEN_BATTERY 132
  35.  
  36.  
  37. /* C++ SOM defs */
  38. #include <somcls.xh>
  39. #include <somcm.xh>
  40.  
  41. /* C++ parent defs */
  42. #ifndef SOM_WPAbstract_xh
  43. #include <wpabs.xh>
  44. #endif
  45.  
  46. #ifndef WPPower_API
  47. #define WPPower_API
  48. /*
  49.  * -- The Class API
  50.  */
  51.  
  52. /*
  53.  * Start of bindings for IDL types
  54.  */
  55.  
  56. class SOMClass;
  57. class SOMObject;
  58. class WPFolder;
  59. class M_WPObject;
  60. class WPObject;
  61. class WPImageFile;
  62. class M_WPAbstract;
  63. class M_WPPower;
  64.  
  65. /*
  66.  * End of bindings for IDL types.
  67.  */
  68.  
  69. /* A procedure to create the WPPower Class */
  70. class M_WPPower;
  71. SOMEXTERN M_WPPower * SOMLINK WPPowerNewClass(
  72.         integer4 majorVersion,
  73.         integer4 minorVersion);
  74.  
  75. /* The API to the WPPower class object, and the methods it introduces. */
  76. SOMEXTERN struct WPPowerClassDataStructure {
  77.     M_WPPower *classObject;
  78.     somMToken wpChangePowerState;
  79.     somMToken wpSetPowerManagement;
  80.     somMToken wpQueryPowerManagement;
  81.     somMToken wpSetPowerConfirmation;
  82.     somMToken wpQueryPowerConfirmation;
  83.     somMToken wpAddPowerPage;
  84.     somMToken wpAddPowerViewPage;
  85.     somMToken wpSetAutoRefresh;
  86.     somMToken wpQueryAutoRefresh;
  87.     somMToken wpQueryRefreshRate;
  88.     somMToken wpSetRefreshRate;
  89.     somMToken wpPowerPrivate1;
  90.     somMToken wpPowerPrivate2;
  91.     somMToken wpQueryDefStatusView;
  92.     somMToken wpSetDefStatusView;
  93. } SOMDLINK WPPowerClassData;
  94. #define _WPPower WPPowerClassData.classObject
  95.  
  96. /* The API to parentMtabs for WPPower, and the instance data it introduces. */
  97. SOMEXTERN struct WPPowerCClassDataStructure {
  98.     somMethodTabs parentMtab;
  99.     somDToken              instanceDataToken;
  100. } SOMDLINK WPPowerCClassData;
  101.  
  102. /*
  103.  * -- Typedefs for WPPower Method Procedures
  104.  */
  105. SOMEXTERN {
  106. typedef ULONG   SOMLINK somTP_WPPower_wpAddPowerPage(WPPower *somSelf, 
  107.         HWND hwndNotebook);
  108. typedef somTP_WPPower_wpAddPowerPage *somTD_WPPower_wpAddPowerPage;
  109. typedef ULONG   SOMLINK somTP_WPPower_wpAddPowerViewPage(WPPower *somSelf, 
  110.         HWND hwndNotebook);
  111. typedef somTP_WPPower_wpAddPowerViewPage *somTD_WPPower_wpAddPowerViewPage;
  112. typedef BOOL   SOMLINK somTP_WPPower_wpChangePowerState(WPPower *somSelf, 
  113.         ULONG ulParm1, 
  114.         ULONG ulParm2);
  115. typedef somTP_WPPower_wpChangePowerState *somTD_WPPower_wpChangePowerState;
  116. typedef BOOL   SOMLINK somTP_WPPower_wpQueryAutoRefresh(WPPower *somSelf);
  117. typedef somTP_WPPower_wpQueryAutoRefresh *somTD_WPPower_wpQueryAutoRefresh;
  118. typedef ULONG   SOMLINK somTP_WPPower_wpQueryDefStatusView(WPPower *somSelf);
  119. typedef somTP_WPPower_wpQueryDefStatusView *somTD_WPPower_wpQueryDefStatusView;
  120. typedef BOOL   SOMLINK somTP_WPPower_wpQueryPowerConfirmation(WPPower *somSelf);
  121. typedef somTP_WPPower_wpQueryPowerConfirmation *somTD_WPPower_wpQueryPowerConfirmation;
  122. typedef BOOL   SOMLINK somTP_WPPower_wpQueryPowerManagement(WPPower *somSelf);
  123. typedef somTP_WPPower_wpQueryPowerManagement *somTD_WPPower_wpQueryPowerManagement;
  124. typedef ULONG   SOMLINK somTP_WPPower_wpQueryRefreshRate(WPPower *somSelf);
  125. typedef somTP_WPPower_wpQueryRefreshRate *somTD_WPPower_wpQueryRefreshRate;
  126. typedef void   SOMLINK somTP_WPPower_wpSetAutoRefresh(WPPower *somSelf, 
  127.         BOOL fAutoRefresh);
  128. typedef somTP_WPPower_wpSetAutoRefresh *somTD_WPPower_wpSetAutoRefresh;
  129. typedef void   SOMLINK somTP_WPPower_wpSetDefStatusView(WPPower *somSelf, 
  130.         ULONG ulDefStatus);
  131. typedef somTP_WPPower_wpSetDefStatusView *somTD_WPPower_wpSetDefStatusView;
  132. typedef void   SOMLINK somTP_WPPower_wpSetPowerConfirmation(WPPower *somSelf, 
  133.         BOOL fConfirm);
  134. typedef somTP_WPPower_wpSetPowerConfirmation *somTD_WPPower_wpSetPowerConfirmation;
  135. typedef BOOL   SOMLINK somTP_WPPower_wpSetPowerManagement(WPPower *somSelf, 
  136.         BOOL fPower);
  137. typedef somTP_WPPower_wpSetPowerManagement *somTD_WPPower_wpSetPowerManagement;
  138. typedef BOOL   SOMLINK somTP_WPPower_wpSetRefreshRate(WPPower *somSelf, 
  139.         ULONG ulRefreshRate);
  140. typedef somTP_WPPower_wpSetRefreshRate *somTD_WPPower_wpSetRefreshRate;
  141.  
  142. /*
  143.  * -- Typedefs for Reintroduced Wrapper Methods
  144.  */
  145. typedef M_WPPower*   SOMLINK somTP_WPPower_somGetClass(WPPower *somSelf);
  146. typedef somTP_WPPower_somGetClass *somTD_WPPower_somGetClass;
  147. }
  148.  
  149. #endif /* WPPower_API */
  150.  
  151.  
  152. /*
  153.  * -- This emitter treats Method Tokens as Thunks by default.
  154.  * -- Use the sc modifier "nothunks" to change this default
  155.  */
  156. #undef somresolve_
  157. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  158.  
  159. /*
  160.  * -- The C++ Wrapper Class for WPPower
  161.  */
  162. class WPPower : public WPAbstract
  163. {
  164. public:
  165.  
  166. // WPPower::new creates the class object if necessary, and then uses somNewNoInit
  167. // to allocate memory and create the object. Initialization is in ctors.
  168. void *operator new(size_t)
  169. {
  170.    if (!_WPPower) WPPowerNewClass(WPPower_MajorVersion,WPPower_MinorVersion);
  171.    return (void*)
  172.       SOM_Resolve(_WPPower,SOMClass,somNewNoInit)
  173.          ((SOMClass *)((void*)_WPPower));
  174. }
  175.  
  176. // WPPower::delete uses somDestruct.
  177. void operator delete(void * obj)
  178. {
  179.    if (obj && *(void**)obj) {
  180.       SOM_Resolve(obj,SOMObject,somDestruct)
  181.          ((SOMObject*)obj, 1, 0);
  182.    }
  183. }
  184.  
  185. WPPower& operator=(WPPower& fromObj)
  186. {
  187.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  188.    return *this;
  189. }
  190.  
  191. WPPower()
  192. {
  193.    if (*(void**)this != 
  194.        ((somParentMtabStructPtr)
  195.         (WPPowerCClassData.parentMtab))->mtab)
  196.       return;
  197.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  198. }
  199.  
  200. WPPower(WPPower* fromObj)
  201. {
  202.    if (*(void**)this != 
  203.        ((somParentMtabStructPtr)
  204.         (WPPowerCClassData.parentMtab))->mtab)
  205.       return;
  206.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  207. }
  208.  
  209. WPPower(const WPPower* fromObj)
  210. {
  211.    if (*(void**)this != 
  212.        ((somParentMtabStructPtr)
  213.         (WPPowerCClassData.parentMtab))->mtab)
  214.       return;
  215.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  216. }
  217.  
  218.  
  219. /* method: wpAddPowerPage */
  220. ULONG   wpAddPowerPage(HWND hwndNotebook)
  221. {
  222.    return SOM_ResolveD(this,WPPower,WPPower,wpAddPowerPage)
  223.     (this,hwndNotebook);
  224. }
  225.  
  226.  
  227. /* method: wpAddPowerViewPage */
  228. ULONG   wpAddPowerViewPage(HWND hwndNotebook)
  229. {
  230.    return SOM_ResolveD(this,WPPower,WPPower,wpAddPowerViewPage)
  231.     (this,hwndNotebook);
  232. }
  233.  
  234.  
  235. /* method: wpChangePowerState */
  236. BOOL   wpChangePowerState(ULONG ulParm1, 
  237.         ULONG ulParm2)
  238. {
  239.    return SOM_ResolveD(this,WPPower,WPPower,wpChangePowerState)
  240.     (this,ulParm1,ulParm2);
  241. }
  242.  
  243.  
  244. /* method: wpQueryAutoRefresh */
  245. BOOL   wpQueryAutoRefresh()
  246. {
  247.    return SOM_ResolveD(this,WPPower,WPPower,wpQueryAutoRefresh)
  248.     (this);
  249. }
  250.  
  251.  
  252. /* method: wpQueryDefStatusView */
  253. ULONG   wpQueryDefStatusView()
  254. {
  255.    return SOM_ResolveD(this,WPPower,WPPower,wpQueryDefStatusView)
  256.     (this);
  257. }
  258.  
  259.  
  260. /* method: wpQueryPowerConfirmation */
  261. BOOL   wpQueryPowerConfirmation()
  262. {
  263.    return SOM_ResolveD(this,WPPower,WPPower,wpQueryPowerConfirmation)
  264.     (this);
  265. }
  266.  
  267.  
  268. /* method: wpQueryPowerManagement */
  269. BOOL   wpQueryPowerManagement()
  270. {
  271.    return SOM_ResolveD(this,WPPower,WPPower,wpQueryPowerManagement)
  272.     (this);
  273. }
  274.  
  275.  
  276. /* method: wpQueryRefreshRate */
  277. ULONG   wpQueryRefreshRate()
  278. {
  279.    return SOM_ResolveD(this,WPPower,WPPower,wpQueryRefreshRate)
  280.     (this);
  281. }
  282.  
  283.  
  284. /* method: wpSetAutoRefresh */
  285. void   wpSetAutoRefresh(BOOL fAutoRefresh)
  286. {
  287.    SOM_ResolveD(this,WPPower,WPPower,wpSetAutoRefresh)
  288.     (this,fAutoRefresh);
  289. }
  290.  
  291.  
  292. /* method: wpSetDefStatusView */
  293. void   wpSetDefStatusView(ULONG ulDefStatus)
  294. {
  295.    SOM_ResolveD(this,WPPower,WPPower,wpSetDefStatusView)
  296.     (this,ulDefStatus);
  297. }
  298.  
  299.  
  300. /* method: wpSetPowerConfirmation */
  301. void   wpSetPowerConfirmation(BOOL fConfirm)
  302. {
  303.    SOM_ResolveD(this,WPPower,WPPower,wpSetPowerConfirmation)
  304.     (this,fConfirm);
  305. }
  306.  
  307.  
  308. /* method: wpSetPowerManagement */
  309. BOOL   wpSetPowerManagement(BOOL fPower)
  310. {
  311.    return SOM_ResolveD(this,WPPower,WPPower,wpSetPowerManagement)
  312.     (this,fPower);
  313. }
  314.  
  315.  
  316. /* method: wpSetRefreshRate */
  317. BOOL   wpSetRefreshRate(ULONG ulRefreshRate)
  318. {
  319.    return SOM_ResolveD(this,WPPower,WPPower,wpSetRefreshRate)
  320.     (this,ulRefreshRate);
  321. }
  322.  
  323.  
  324. /*
  325.  * Reintroduce inherited methods
  326.  */
  327.  
  328. /* method: somGetClass */
  329. M_WPPower*  somGetClass()
  330. {
  331. /*
  332.  *  Return the receiver's class.
  333.  */
  334.    return SOM_ResolveD(this,WPPower,SOMObject,somGetClass)
  335.     (this);
  336. }
  337.  
  338.  
  339.  
  340. };   /* WPPower */
  341.  
  342.  
  343.  
  344. #endif       /* SOM_WPPower_xh */
  345.  
  346. #ifndef SOM_M_WPPower_xh
  347. #define SOM_M_WPPower_xh
  348.  
  349. class M_WPPower;
  350.  
  351. #define M_WPPower_MajorVersion 1
  352. #define M_WPPower_MinorVersion 2
  353.  
  354. /* C++ SOM defs */
  355. #include <somcls.xh>
  356. #include <somcm.xh>
  357.  
  358. /* C++ parent defs */
  359. #ifndef SOM_M_WPAbstract_xh
  360. #include <wpabs.xh>
  361. #endif
  362.  
  363. #ifndef M_WPPower_API
  364. #define M_WPPower_API
  365. /*
  366.  * -- The Class API
  367.  */
  368.  
  369. /*
  370.  * Start of bindings for IDL types
  371.  */
  372.  
  373.  
  374. /*
  375.  * End of bindings for IDL types.
  376.  */
  377.  
  378. /*
  379.  * -- M_WPPower is a metaclass for WPPower. Make sure WPPower is known.
  380.  */
  381. class WPPower;
  382.  
  383.  
  384. /* A procedure to create the M_WPPower Class */
  385. SOMEXTERN SOMClass * SOMLINK M_WPPowerNewClass(
  386.         integer4 majorVersion,
  387.         integer4 minorVersion);
  388.  
  389. /* The API to the M_WPPower class object, and the methods it introduces. */
  390. SOMEXTERN struct M_WPPowerClassDataStructure {
  391.     SOMClass *classObject;
  392. } SOMDLINK M_WPPowerClassData;
  393. #define _M_WPPower M_WPPowerClassData.classObject
  394.  
  395. /* The API to parentMtabs for M_WPPower, and the instance data it introduces. */
  396. SOMEXTERN struct M_WPPowerCClassDataStructure {
  397.     somMethodTabs parentMtab;
  398.     somDToken              instanceDataToken;
  399. } SOMDLINK M_WPPowerCClassData;
  400.  
  401. /*
  402.  * -- Typedefs for M_WPPower Method Procedures
  403.  */
  404. SOMEXTERN {
  405.  
  406. /*
  407.  * -- Typedefs for Reintroduced Wrapper Methods
  408.  */
  409. typedef WPPower*   SOMLINK somTP_M_WPPower_somNew(M_WPPower *somSelf);
  410. typedef somTP_M_WPPower_somNew *somTD_M_WPPower_somNew;
  411. }
  412.  
  413. #endif /* M_WPPower_API */
  414.  
  415.  
  416. /*
  417.  * -- This emitter treats Method Tokens as Thunks by default.
  418.  * -- Use the sc modifier "nothunks" to change this default
  419.  */
  420. #undef somresolve_
  421. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  422.  
  423. /*
  424.  * -- The C++ Wrapper Class for M_WPPower
  425.  */
  426. class M_WPPower : public M_WPAbstract
  427. {
  428. public:
  429.  
  430. // M_WPPower::new creates the class object if necessary, and then uses somNewNoInit
  431. // to allocate memory and create the object. Initialization is in ctors.
  432. void *operator new(size_t)
  433. {
  434.    if (!_M_WPPower) M_WPPowerNewClass(M_WPPower_MajorVersion,M_WPPower_MinorVersion);
  435.    return (void*)
  436.       SOM_Resolve(_M_WPPower,SOMClass,somNewNoInit)
  437.          ((SOMClass *)((void*)_M_WPPower));
  438. }
  439.  
  440. // M_WPPower::delete uses somDestruct.
  441. void operator delete(void * obj)
  442. {
  443.    if (obj && *(void**)obj) {
  444.       SOM_Resolve(obj,SOMObject,somDestruct)
  445.          ((SOMObject*)obj, 1, 0);
  446.    }
  447. }
  448.  
  449. M_WPPower& operator=(M_WPPower& fromObj)
  450. {
  451.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  452.    return *this;
  453. }
  454.  
  455. M_WPPower()
  456. {
  457.    if (*(void**)this != 
  458.        ((somParentMtabStructPtr)
  459.         (M_WPPowerCClassData.parentMtab))->mtab)
  460.       return;
  461.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  462. }
  463.  
  464. M_WPPower(M_WPPower* fromObj)
  465. {
  466.    if (*(void**)this != 
  467.        ((somParentMtabStructPtr)
  468.         (M_WPPowerCClassData.parentMtab))->mtab)
  469.       return;
  470.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  471. }
  472.  
  473. M_WPPower(const M_WPPower* fromObj)
  474. {
  475.    if (*(void**)this != 
  476.        ((somParentMtabStructPtr)
  477.         (M_WPPowerCClassData.parentMtab))->mtab)
  478.       return;
  479.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  480. }
  481.  
  482.  
  483. /*
  484.  * Reintroduce inherited methods
  485.  */
  486.  
  487. /* method: somNew */
  488. WPPower*  somNew()
  489. {
  490.    return SOM_ResolveD(this,M_WPPower,SOMClass,somNew)
  491.     (this);
  492. }
  493.  
  494.  
  495.  
  496. };   /* M_WPPower */
  497.  
  498.  
  499.  
  500. #endif       /* SOM_M_WPPower_xh */
  501.