home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / wps / wpstutor / wpstutor.idl < prev    next >
Text File  |  1999-05-11  |  9KB  |  312 lines

  1.  
  2. //# This file was generated by the SOM Compiler.
  3. //# FileName: wpstutor.id2.
  4. //# Generated using:
  5. //#     SOM Precompiler somopc: 2.7
  6. //#     SOM Emitter emitidl: 2.22
  7.  
  8. //
  9. //
  10. //   Module Name: WPSTUTOR
  11. //
  12. //   Description: OS/2 Work Place Shell Sample Program
  13. //
  14. //                This class subclasses the WPDataFile class.  Most WPS
  15. //                instance and class methods are overridden to invoke
  16. //                'DisplayMethodInfo'.  This function uses a named pipe
  17. //                to communicate with the 'Show Method Description'
  18. //                (SHOWDESC.EXE) program, which displays the name and a
  19. //                description of the method that invoked
  20. //                'DisplayMethodInfo'.
  21. //
  22. //   Copyright (C) 1993 IBM Corporation
  23. //
  24. //       DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  25. //       sample code created by IBM Corporation. This sample code is not
  26. //       part of any standard or IBM product and is provided to you solely
  27. //       for  the purpose of assisting you in the development of your
  28. //       applications.  The code is provided "AS IS", without
  29. //       warranty of any kind.  IBM shall not be liable for any damages
  30. //       arising out of your use of the sample code, even if they have been
  31. //       advised of the possibility of such damages.
  32. //
  33.  
  34. #ifndef wpstutor_idl
  35. #define wpstutor_idl
  36.  
  37. #include "wpdataf.idl"
  38. #include <somcls.idl>
  39.  
  40. interface M_WPSTutorial;
  41.  
  42. interface WPSTutorial : WPDataFile
  43.  
  44. //
  45. // CLASS: WPSTutorial
  46. //
  47. // CLASS HIERARCHY:
  48. //
  49. //     SOMObject
  50. //       └── WPObject
  51. //             └── WPFileSystem
  52. //                   └── WPDataFile
  53. //                         └── WPSTutorial
  54. //
  55. // DESCRIPTION:
  56. //
  57. //    This is the sample WPS tutorial object class.  This class subclasses
  58. //    the WPDataFile class.  Most WPS instance and class methods are
  59. //    overridden to invoke 'DisplayMethodInfo'.  This function uses a named
  60. //    pipe to communicate with the 'Show Method Description' (SHOWDESC.EXE)
  61. //    program, which displays the name and a description of the method that
  62. //    invoked 'DisplayMethodInfo'.
  63. //
  64. //    An instance of this class can be created as a Workplace object.
  65. //
  66.  
  67. {
  68.   HWND DisplayTitleInfo();
  69.  
  70.   //
  71.   // METHOD: DisplayTitleInfo                               ( ) PRIVATE
  72.   //                                                        (X) PUBLIC
  73.   // DESCRIPTION:
  74.   //
  75.   //   This method handles the processing of the "Open tutorial" menu item
  76.   //   in the "Open" menu of the object's context menu.  The method creates a
  77.   //   PM window in order to display the (backwards) title of the object in
  78.   //   the window's title bar.
  79.   //
  80.   // RETURN:
  81.   //
  82.   //   HWND - Handle to the window created
  83.   //
  84.  
  85.  
  86.  
  87. #ifdef __SOMIDL__
  88.   implementation {
  89.  
  90.     releaseorder: DisplayTitleInfo;
  91.  
  92.     //# Class Modifiers
  93.     filestem = wpstutor;
  94.     functionprefix = wpstut_;
  95.     majorversion = 1;
  96.     minorversion = 1;
  97.     local;
  98.     metaclass = M_WPSTutorial;
  99.     callstyle = oidl;
  100.  
  101. #ifdef __PRIVATE__
  102.     passthru C_h_after =      ""
  103. "/*"
  104. "**  The following structure is used to store window specific data"
  105. "**  and a pointer to the object that created the window."
  106. "**"
  107. "**  This structure is allocated when the Client window is created."
  108. "**  This allows us to pass the *somSelf pointer and use it in our window"
  109. "**  and dialog procedures (the system only passes this pointer to"
  110. "**  methods)."
  111. "*/"
  112. ""
  113. "typedef struct _WINDOWDATA"
  114. "{"
  115. "   USHORT       cb;            /* size of this structure */"
  116. "   WPSTutorial  *somSelf;       /* pointer to this instance */"
  117. "   USEITEM      UseItem;       /* global class usage information */"
  118. "   VIEWITEM     ViewItem;      /* global class view information */"
  119. "} WINDOWDATA;"
  120. "typedef WINDOWDATA *PWINDOWDATA;"
  121. ""
  122. "/*"
  123. "**  Private debug helpers go here.  They can be enabled or disabled by"
  124. "**  defining DEBUG as a compiler directive."
  125. "*/"
  126. "#if defined(DEBUG)"
  127. ""
  128. "   #define DebugBox(title, text) \"
  129. "                                 \"
  130. "              WinMessageBox(     \"
  131. "                 HWND_DESKTOP,   \"
  132. "                 HWND_DESKTOP,   \"
  133. "                 (PSZ) text,     \"
  134. "                 (PSZ) title,    \"
  135. "                 20,             \"
  136. "                 MB_OK | MB_INFORMATION | MB_MOVEABLE)"
  137. "#else"
  138. ""
  139. "   #define DebugBox(title, text)   /* do nothing if not debugging */"
  140. ""
  141. "#endif  /* DEBUG */"
  142. "";
  143. #endif  /*__ PRIVATE__ */
  144.  
  145.     passthru C_ih =     ""
  146. "#define INCL_WIN"
  147. "#define INCL_DOS"
  148. "#define INCL_WPCLASS"
  149. ""
  150. "#include <os2.h>"
  151. "#include <stdlib.h>"
  152. "#include <string.h>"
  153. ""
  154. "/*"
  155. "**   The following user-defined Popup menu items (ID_xxx) should be higher"
  156. "**   than WPMENUID_USER."
  157. "**"
  158. "**   The ID_OPENMENU will become a submenu of the system's popup open menu"
  159. "**   id, WPMENUID_OPEN."
  160. "*/"
  161. "#define ID_OPENMENU     (WPMENUID_USER+1)   /* \"Open\" item in context menu   */"
  162. "#define IDM_OPENTUT     (WPMENUID_USER+2)   /* \"Open tutorial\" item added    */"
  163. "                                            /*   to \"Open\" menu              */"
  164. "#define ID_ICON         101                 /* Icon for the WPSTutorial class*/"
  165. ""
  166. "/*"
  167. "**  Window IDs"
  168. "*/"
  169. "#define ID_FRAME        3000                /* Client window ID for the      */"
  170. "                                            /*   \"open\" view                 */"
  171. "/*"
  172. "**  Unique view IDs"
  173. "*/"
  174. "#define OPEN_TUTORIAL   ID_OPENMENU         /* \"Open tutorial\" view ID       */"
  175. "";
  176.  
  177.  
  178.     //# Method Modifiers
  179.     wpAddFileMenuPage: override;
  180.     wpAddFileTypePage: override;
  181.     wpAddFile1Page: override;
  182.     wpAddFile2Page: override;
  183.     wpAddFile3Page: override;
  184.     wpAddObjectGeneralPage: override;
  185.     wpAddSettingsPages: override;
  186.     wpAddToObjUseList: override;
  187.     wpAllocMem: override;
  188.     wpClose: override;
  189.     wpCopiedFromTemplate: override;
  190.     wpCopyObject: override;
  191.     wpCreateFromTemplate: override;
  192.     wpCreateShadowObject: override;
  193.     wpDelete: override;
  194.     wpDeleteFromObjUseList: override;
  195.     wpDoesObjectMatch: override;
  196.     wpDraggedOverObject: override;
  197.     wpDragOver: override;
  198.     wpDrop: override;
  199.     wpDroppedOnObject: override;
  200.     wpEndConversation: override;
  201.     wpFilterPopupMenu: override;
  202.     wpFindUseItem: override;
  203.     wpFormatDragItem: override;
  204.     wpFree: override;
  205.     wpFreeMem: override;
  206.     wpHide: override;
  207.     wpInitData: override;
  208.     wpInsertPopupMenuItems: override;
  209.     wpInsertSettingsPage: override;
  210.     wpMenuItemSelected: override;
  211.     wpModifyPopupMenu: override;
  212.     wpOpen: override;
  213.     wpQueryConfirmations: override;
  214.     wpQueryDefaultView: override;
  215.     wpQueryDetailsData: override;
  216.     wpQueryHandle: override;
  217.     wpQueryIcon: override;
  218.     wpQueryIconData: override;
  219.     wpQueryRealName: override;
  220.     wpQueryStyle: override;
  221.     wpQueryTitle: override;
  222.     wpQueryType: override;
  223.     wpRegisterView: override;
  224.     wpRender: override;
  225.     wpRenderComplete: override;
  226.     wpRestore: override;
  227.     wpRestoreData: override;
  228.     wpRestoreLong: override;
  229.     wpRestoreState: override;
  230.     wpRestoreString: override;
  231.     wpSaveData: override;
  232.     wpSaveDeferred: override;
  233.     wpSaveImmediate: override;
  234.     wpSaveLong: override;
  235.     wpSaveState: override;
  236.     wpSaveString: override;
  237.     wpSetDefaultView: override;
  238.     wpSetIcon: override;
  239.     wpSetIconData: override;
  240.     wpSetRealName: override;
  241.     wpSetStyle: override;
  242.     wpSetTitle: override;
  243.     wpSetType: override;
  244.     wpSetup: override;
  245.     wpSwitchTo: override;
  246.     wpUnlockObject: override;
  247.     wpUnInitData: override;
  248.  
  249.   };
  250. #endif /* __SOMIDL__ */
  251. };
  252.  
  253. interface M_WPSTutorial
  254. {
  255.   HMODULE clsQueryModuleHandle();
  256.  
  257.   //
  258.   // METHOD: clsQueryModuleHandle
  259.   //
  260.   // DESCRIPTION:
  261.   //
  262.   //   This method obtains and returns the module handle for the object class.
  263.   //
  264.   // RETURN:
  265.   //
  266.   //   0        - Unsuccessful execution
  267.   //   Non-zero - Module handle
  268.   //
  269.  
  270.  
  271.  
  272. #ifdef __SOMIDL__
  273.   implementation {
  274.  
  275.     releaseorder: clsQueryModuleHandle;
  276.  
  277.     //# Class Modifiers
  278.     filestem = wpstutor;
  279.     functionprefix = wpstutM_;
  280.     majorversion = 1;
  281.     minorversion = 1;
  282.     local;
  283.     callstyle = oidl;
  284.  
  285.     //# Method Modifiers
  286.     wpclsCreateDefaultTemplates: override;
  287.     wpclsFindObjectEnd: override;
  288.     wpclsFindObjectFirst: override;
  289.     wpclsFindObjectNext: override;
  290.     wpclsInitData: override;
  291.     wpclsMakeAwake: override;
  292.     wpclsNew: override;
  293.     wpclsQueryDefaultView: override;
  294.     wpclsQueryDetails: override;
  295.     wpclsQueryDetailsInfo: override;
  296.     wpclsQueryFolder: override;
  297.     wpclsQueryIcon: override;
  298.     wpclsQueryIconData: override;
  299.     wpclsQueryInstanceFilter: override;
  300.     wpclsQueryInstanceType: override;
  301.     wpclsQueryObject: override;
  302.     wpclsQuerySettingsPageSize: override;
  303.     wpclsQueryStyle: override;
  304.     wpclsQueryTitle: override;
  305.     wpclsUnInitData: override;
  306.  
  307.   };
  308. #endif /* __SOMIDL__ */
  309. };
  310.  
  311. #endif  /* wpstutor_idl */
  312.