home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / shr93.zip / PERSON.CSC < prev    next >
Text File  |  1993-07-12  |  7KB  |  214 lines

  1. #***********************************************************************
  2. #
  3. #  OS/2 Work Place Shell Sample Program - ShrPerson
  4. #
  5. #  Copyright (C) 1993 IBM Corporation
  6. #
  7. #    DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  8. #    sample code created by IBM Corporation.  This sample code is
  9. #    not part of any standard or IBM product and is provided to you
  10. #    solely for the purpose of assisting you in the development of
  11. #    your applications.  The code is provided "AS IS".  ALL
  12. #    WARRANTIES ARE EXPRESSLY DISCLAIMED, INCLUDING THE IMPLIED
  13. #    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  14. #    PURPOSE.  IBM shall not be liable for any damages arising out
  15. #    of your use of the sample code, even if IBM has been advised of
  16. #    the possibility of such damages.
  17. #
  18. #
  19. #***********************************************************************
  20.  
  21. #***********************************************************************
  22. #   Include the class definition file for the parent class
  23. #***********************************************************************
  24.  
  25. include <wpabs.sc>
  26.  
  27. #***********************************************************************
  28. #   Define the new class
  29. #***********************************************************************
  30.  
  31. class: ShrPerson,
  32.        external stem   = per,
  33.        local,
  34.        external prefix = per_,
  35.        classprefix     = perM_,
  36.        major version   = 1,
  37.        minor version   = 2;
  38.  
  39. --
  40. -- CLASS: ShrPerson
  41. --
  42. -- CLASS HIERARCHY:
  43. --
  44. --     SOMObject
  45. --       └── WPObject
  46. --             └── WPAbstract
  47. --                   └── ShrPerson
  48. --
  49. -- DESCRIPTION:
  50. --
  51. --   See PERSON.C and PERSONV.C for more details.
  52. --
  53.  
  54. #***********************************************************************
  55. #   Specify the parent class
  56. #***********************************************************************
  57.  
  58. parent: WPAbstract;
  59.  
  60. #***********************************************************************
  61. #   Passthru IMPLEMENTATION definitions to the .ih file
  62. #***********************************************************************
  63.  
  64. passthru: C.ih;
  65.  
  66. /*
  67.  * Data keys for wpSaveString (see wpSaveState and wpRestoreState).
  68.  */
  69.  
  70. #define IDK_ADDRESS                     1
  71. #define IDK_CITY                        2
  72. #define IDK_STATE                       3
  73. #define IDK_ZIPCODE                     4
  74. #define IDK_PHONE                       5
  75.  
  76. /*
  77.  * Details structure (see wpclsQueryDetailsInfo).
  78.  */
  79.  
  80. typedef struct
  81. {
  82.   PSZ pszPhone;
  83.   PSZ pszAddress;
  84.   PSZ pszCity;
  85.   PSZ pszState;
  86.   PSZ pszZipCode;
  87. } PERSONDETAILS, *PPERSONDETAILS;
  88.  
  89. #define NUM_PERSONDETAILS_FIELDS        5
  90.  
  91. endpassthru;   /* .ih */
  92.  
  93. #***********************************************************************
  94. #   Passthru PUBLIC definitions to the .h file
  95. #***********************************************************************
  96.  
  97. passthru: C.h, after;
  98.  
  99. extern SOMClass *ShrFindPersonClass(VOID);
  100.  
  101. endpassthru;   /* C.h */
  102.  
  103. #***********************************************************************
  104. #   Define instance data
  105. #***********************************************************************
  106.  
  107. data:
  108.  
  109.    SOMObject *somNotifier;              // see shrQueryNotifier
  110.                                         //   in PERSON.C
  111.  
  112.    PSZ pszAddress;
  113.    PSZ pszCity;
  114.    PSZ pszState;
  115.    PSZ pszZipCode;
  116.    PSZ pszPhone;
  117.  
  118.    HMODULE hmod, class;                 // see shrclsQueryModuleHandle
  119.                                         //   in PERSON.C
  120.  
  121.    CLASSFIELDINFO acfiPerson[NUM_PERSONDETAILS_FIELDS], class;
  122.                                         // see wpclsQueryDetailsInfo
  123.                                         //   in PERSON.C
  124.  
  125. #***********************************************************************
  126. #   Define methods
  127. #***********************************************************************
  128.  
  129. methods:
  130.  
  131. #***********************************************************************
  132. #   Define instance methods
  133. #***********************************************************************
  134.  
  135. BOOL shrAddPersonInfoPage(HWND hwndNotebook);
  136.  
  137. #***********************************************************************
  138. #   Define instance methods for setting instance data
  139. #***********************************************************************
  140.  
  141. BOOL shrSetAddress(PSZ pszNewAddress);
  142. BOOL shrSetCity(PSZ pszNewCity);
  143. BOOL shrSetState(PSZ pszNewState);
  144. BOOL shrSetZipCode(PSZ pszNewZipCode);
  145. BOOL shrSetPhone(PSZ pszNewPhone);
  146.  
  147. #***********************************************************************
  148. #   Define instance methods for querying instance data
  149. #***********************************************************************
  150.  
  151. ULONG shrQueryAddress(ULONG cchAddressMax, PCHAR pchAddress);
  152. ULONG shrQueryCity(ULONG cchCityMax, PCHAR pchCity);
  153. ULONG shrQueryState(ULONG cchStateMax, PCHAR pchState);
  154. ULONG shrQueryZipCode(ULONG cchZipCodeMax, PCHAR pchZipCode);
  155. ULONG shrQueryPhone(ULONG cchPhoneMax, PCHAR pchPhone);
  156.  
  157. #***********************************************************************
  158. # Generally, methods are invoked on the basis of information provided 
  159. # the class that introduces the method definition (called "offset
  160. # resolution").  However, this requires that the class of the method's
  161. # target object be known at compile time.  Sometimes a method 
  162. # definition is introduced by several classes.  For such methods,
  163. # "name lookup" (which invokes the method using the method's name
  164. # as a key) is a more appropriate choice.
  165. #
  166. # In this case shrQueryNotifier and shrclsQueryModuleHandle are
  167. # defined by ShrAddressBook and ShrPerson.  See "Determining an 
  168. # Object's Protocol" in README.TXT for more details. 
  169. #***********************************************************************
  170.  
  171. SOMObject *shrQueryNotifier(), name lookup;
  172.  
  173. #***********************************************************************
  174. # The shrUnderstandsProtocol method, while currently only defined by
  175. # ShrPerson, would likely be defined in other classes, so it has
  176. # been declared "name lookup" below.
  177. #***********************************************************************
  178.  
  179. BOOL shrUnderstandsProtocol(ULONG idProtocol), name lookup;
  180.  
  181. #***********************************************************************
  182. #   Specify instance methods being overridden
  183. #***********************************************************************
  184.  
  185. override wpUnInitData;
  186.  
  187. override wpSetTitle;
  188.  
  189. override wpSaveState;
  190. override wpRestoreState;
  191.  
  192. override wpAddSettingsPages;
  193.  
  194. override wpQueryDetailsData;
  195.  
  196. #***********************************************************************
  197. #   Define class methods
  198. #***********************************************************************
  199.  
  200. HMODULE shrclsQueryModuleHandle(), class, name lookup;
  201.  
  202. #***********************************************************************
  203. #   Specify class methods being overridden
  204. #***********************************************************************
  205.  
  206. override wpclsInitData, class;
  207.  
  208. override wpclsQueryDetailsInfo, class;
  209.  
  210. override wpclsQueryTitle, class;
  211. override wpclsQueryIconData, class;
  212. override wpclsQueryDefaultView, class;
  213. override wpclsQueryStyle, class;
  214.