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

  1.  
  2. //# This file was generated by the SOM Compiler.
  3. //# FileName: wsfolder.id2.
  4. //# Generated using:
  5. //#     SOM Precompiler somopc: 2.29.1.2
  6. //#     SOM Emitter emitidl: 2.41
  7.  
  8. //
  9. //
  10. //   Module Name: WSFOLDER
  11. //
  12. //   OS/2 Work Place Shell Sample Program
  13. //
  14. //   Copyright (C) 1994,1995 IBM Corporation
  15. //
  16. //       DISCLAIMER OF WARRANTIES.  The following code is
  17. //       sample code created by IBM Corporation. This sample code is not
  18. //       part of any standard or IBM product and is provided to you solely
  19. //       for  the purpose of assisting you in the development of your
  20. //       applications.  The code is provided "AS IS", without
  21. //       warranty of any kind.  IBM shall not be liable for any damages
  22. //       arising out of your use of the sample code, even if they have been
  23. //       advised of the possibility of such damages.
  24. //
  25.  
  26. #ifndef wsfolder_idl
  27. #define wsfolder_idl
  28.  
  29. #include "wpfolder.idl"
  30. #include <somcls.idl>
  31.  
  32. interface M_WSFOLDER;
  33.  
  34. interface WSFOLDER : WPFolder
  35. //# Comment for parent WPFolder:
  36.  
  37. //
  38. // CLASS: WSFOLDER
  39. //
  40. // CLASS HIERARCHY:
  41. //
  42. //     SOMObject
  43. //       └── WPObject
  44. //             └── WPFileSystem
  45. //                   └── WPFolder
  46. //                         └──  WSFOLDER
  47. //
  48. // DESCRIPTION:
  49. //
  50. //    This is the sample WSFOLDER object class.
  51. //
  52. //    An instance of this class can be created as a Workplace object.
  53. //
  54.  
  55. {
  56.   void closeViews();
  57.  
  58.   //
  59.   //  METHOD: closeViews                                     ( ) PRIVATE
  60.   //                                                         (X) PUBLIC
  61.   //  DESCRIPTION:
  62.   //
  63.   //    Close all but the first open view of a wsfolder object.
  64.   //
  65.  
  66.   HWND queryFirstViewHandle();
  67.  
  68.   //
  69.   //  METHOD: queryFirstViewHandle                           ( ) PRIVATE
  70.   //                                                         (X) PUBLIC
  71.   //  DESCRIPTION:
  72.   //
  73.   //    return the handle of the view that was opened first of the
  74.   //    currently open views of this wsfolder object.
  75.   //
  76.  
  77.   BOOL setFirstViewHandle(in HWND hwndView);
  78.  
  79.   //
  80.   //  METHOD: setFirstViewHandle                             ( ) PRIVATE
  81.   //                                                         (X) PUBLIC
  82.   //  DESCRIPTION:
  83.   //
  84.   //    Do special processing on first open of folder (save hwnd of
  85.   //    first view opened for this object)
  86.   //
  87.   //  PARAMETERS:
  88.   //
  89.   //     HWND - hwnd of the first currently open view of this object
  90.   //
  91.   //  RETURNS:
  92.   //
  93.   //     TRUE - hwnd set successfully
  94.   //     FALSE - first hwnd wasn't set successfully
  95.   //
  96.  
  97.  
  98.  
  99. #ifdef __SOMIDL__
  100.   implementation {
  101.  
  102.     releaseorder: closeViews,queryFirstViewHandle,setFirstViewHandle;
  103.  
  104.     //# Class Modifiers
  105.     externalstem = wsfold;
  106.     local;
  107.     externalprefix = wsfold_;
  108.     majorversion = 1;
  109.     minorversion = 2;
  110.     filestem = wsfolder;
  111.     metaclass = M_WSFOLDER;
  112.     callstyle = oidl;
  113.  
  114. /* CSC2IDL:  CHANGED ph passthru to a private h passthru */
  115.  
  116.     passthru C_h_after =  ""
  117. #ifdef __PRIVATE__
  118. "   /*"
  119. "    *   Private Debug helpers go here.  They can be enabled/disabled by"
  120. "    *   defining DEBUG as a compiler directive."
  121. "    */"
  122. "   #if defined(DEBUG)"
  123. ""
  124. "      #define DebugBox(title, text) \ "
  125. "                                    \ "
  126. "                 WinMessageBox(     \ "
  127. "                    HWND_DESKTOP,   \ "
  128. "                    HWND_DESKTOP,   \ "
  129. "                    (PSZ) text,     \ "
  130. "                    (PSZ) title,    \ "
  131. "                    20,             \ "
  132. "                    MB_OK | MB_INFORMATION | MB_MOVEABLE)"
  133. "   #else"
  134. "      #define DebugBox(title, text)   /* do nothing if not debugging */"
  135. "   #endif"
  136. #endif /* __PRIVATE */
  137. "";
  138.  
  139.     passthru C_ih_before =  ""
  140. "   #define ID_TITLE           100"
  141. "   #define ID_ICON            101"
  142. "   #define ID_OPENICON        102"
  143. ""
  144. "   #define ID_CLOSEVIEWSMENU     (WPMENUID_USER+1) /* menus added to popup menu */"
  145. ""
  146. "   #define IDM_CLOSEVIEWS        (WPMENUID_USER+2) /* submenus of added menus */"
  147. ""
  148. "   /*"
  149. "    *   Help IDs"
  150. "    *"
  151. "    *   NOTE:  See wsfolder.ipf for the source of this class's help,"
  152. "    *   from which wsfolder.hlp is built"
  153. "    */"
  154. "   #define ID_HELP_DEFAULT    256"
  155. "   #define ID_HELP_CLOSEVIEWS 257"
  156. ""
  157. "";
  158.  
  159.  
  160.     //# Internal Instance Variables
  161.     HWND hwndFirstView;
  162.  
  163.     //# Method Modifiers
  164.     wpOpen: override;
  165.  
  166.     //
  167.     //  METHOD: wpOpen                                         ( ) PRIVATE
  168.     //                                                         (X) PUBLIC
  169.     //  DESCRIPTION:
  170.     //
  171.     //    Do special processing on first open of folder
  172.     //
  173.     wpInitData: override;
  174.  
  175.     //
  176.     //  METHOD: wpInitData                                     ( ) PRIVATE
  177.     //                                                         (X) PUBLIC
  178.     //  DESCRIPTION:
  179.     //
  180.     //    Set object's detail class to be WSFILE
  181.     //
  182.     wpModifyPopupMenu: override;
  183.  
  184.     //
  185.     // METHOD: wpModifyPopupMenu                              ( ) PRIVATE
  186.     //                                                        (X) PUBLIC
  187.     // DESCRIPTION:
  188.     //
  189.     //   Add our extra option to the context menu to close all but first view
  190.     //
  191.     wpMenuItemSelected: override;
  192.  
  193.     //
  194.     // METHOD: wpMenuItemSelected                             ( ) PRIVATE
  195.     //                                                        (X) PUBLIC
  196.     // DESCRIPTION:
  197.     //
  198.     //   Process input from the extra menu option that we added.
  199.     //
  200.     wpMenuItemHelpSelected: override;
  201.  
  202.     //
  203.     // METHOD: wpMenuItemHelpSelected                         ( ) PRIVATE
  204.     //                                                        (X) PUBLIC
  205.     // DESCRIPTION:
  206.     //
  207.     //   Process input from the extra menu option that we added.
  208.     //
  209.     wpClose: override;
  210.  
  211.     //
  212.     // METHOD: wpClose                                        ( ) PRIVATE
  213.     //                                                        (X) PUBLIC
  214.     // DESCRIPTION:
  215.     //
  216.     //   When a folder object is closed, we will zero out its first view
  217.     //   instance variable, so that the next time it has a first view opened,
  218.     //   we can keep track of that.
  219.     //
  220.     wpDragOver: override;
  221.  
  222.     //
  223.     // METHOD: wpDragOver                                     ( ) PRIVATE
  224.     //                                                        (X) PUBLIC
  225.     // DESCRIPTION:
  226.     //
  227.     //   Instances of class WSFOLDER are the only folders that accept a drop
  228.     //   of a WSFILE object.  This override returns DOR_DROP when a WSFILE
  229.     //   object is dragged over a WSFOLDER object.
  230.     //
  231.     wpDrop: override;
  232.  
  233.     //
  234.     // METHOD: wpDrop                                         ( ) PRIVATE
  235.     //                                                        (X) PUBLIC
  236.     // DESCRIPTION:
  237.     //
  238.     //   This override will be called after a drop of a WSFILE object, so that
  239.     //   the drop can actually be processed.
  240.     //
  241.     wpDeleteFromObjUseList: override;
  242.  
  243.     //
  244.     // METHOD: wpDeleteFromObjUseList                         ( ) PRIVATE
  245.     //                                                        (X) PUBLIC
  246.     // DESCRIPTION:
  247.     //
  248.     //   When a the last view of a WSFOLDER object is closed, we will zero out
  249.     //   its first view instance variable, so that the next time it has a first
  250.     //   view opened, we can keep track of that.
  251.     //
  252.     wpQueryConcurrentView: override;
  253.  
  254.     //
  255.     // METHOD: wpQueryConcurrentView                          ( ) PRIVATE
  256.     //                                                        (X) PUBLIC
  257.     // DESCRIPTION:
  258.     //
  259.     //   Objects of WSFOLDER class have concurrent views set on
  260.     //   by default
  261.     //
  262.     wpPrintObject: override;
  263.  
  264.     //
  265.     // METHOD: wpPrintObject                                  ( ) PRIVATE
  266.     //                                                        (X) PUBLIC
  267.     // DESCRIPTION:
  268.     //
  269.     //   We will simply beep when a WSFOLDER object is "printed"
  270.     //
  271.     wpAddToContent: override;
  272.  
  273.     //
  274.     // METHOD: wpAddToContent                                 ( ) PRIVATE
  275.     //                                                        (X) PUBLIC
  276.     // DESCRIPTION:
  277.     //
  278.     //   We will put up a dialog containing the title of
  279.     //   the newly added object whenever one is added to a WSFOLDER
  280.     //   object
  281.     //
  282.     wpDeleteFromContent: override;
  283.  
  284.     //
  285.     // METHOD: wpDeleteFromContent                            ( ) PRIVATE
  286.     //                                                        (X) PUBLIC
  287.     // DESCRIPTION:
  288.     //
  289.     //   We will put up a dialog containing the title of
  290.     //   the newly removed object whenever one is removed from a WSFOLDER
  291.     //   object
  292.     //
  293.  
  294.  
  295.     //# Data Modifiers
  296.  
  297.   };
  298. #endif /* __SOMIDL__ */
  299. };
  300.  
  301. interface M_WSFOLDER
  302. //# Comment for parent WPFolder:
  303.  
  304. {
  305.   HMODULE clsQueryModuleHandle();
  306.  
  307.   //
  308.   // METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  309.   //                                                        (X) PUBLIC
  310.   // DESCRIPTION:
  311.   //
  312.   //   This method returns the module handle of this class.  If this is the
  313.   //   first invocation, DosQueryModuleHandle is called to save the handle
  314.   //   for future invocations.
  315.   //
  316.   // RETURN:
  317.   //
  318.   //   0              Unsuccessful
  319.   //   non-zero       module handle
  320.   //
  321.  
  322.  
  323.  
  324. #ifdef __SOMIDL__
  325.   implementation {
  326.  
  327.     releaseorder: clsQueryModuleHandle;
  328.  
  329.     //# Class Modifiers
  330.     externalstem = wsfold;
  331.     local;
  332.     externalprefix = wsfoldM_;   /* CSC2IDL:  CHANGED from wsfold_ after ctoi step */
  333.     functionprefix = wsfoldM_;
  334.     majorversion = 1;
  335.     minorversion = 2;
  336.     filestem = wsfolder;
  337.     callstyle = oidl;
  338.  
  339.     //# Method Modifiers
  340.     wpclsInitData: override;
  341.  
  342.     //
  343.     // METHOD: wpclsInitData
  344.     //
  345.     // DESCRIPTION:
  346.     //
  347.     //   Initalize the class data
  348.     //
  349.     wpclsQueryTitle: override;
  350.  
  351.     //
  352.     // METHOD: wpclsQueryTitle
  353.     //
  354.     // DESCRIPTION:
  355.     //
  356.     //   Return class title for WSFOLDER class
  357.     //
  358.     wpclsQueryIconData: override;
  359.  
  360.     //
  361.     // METHOD: wpclsQueryIconData                            ( ) PRIVATE
  362.     //                                                        (X) PUBLIC
  363.     // DESCRIPTION:
  364.     //
  365.     //   Return the class icon
  366.     //
  367.     wpclsQueryIconDataN: override;
  368.  
  369.     //
  370.     // METHOD: wpclsQueryIconDataN                            ( ) PRIVATE
  371.     //                                                        (X) PUBLIC
  372.     // DESCRIPTION:
  373.     //
  374.     //   Return the class open icon
  375.     //
  376.     wpclsQueryDefaultHelp: override;
  377.  
  378.     //
  379.     // METHOD: wpclsQueryDefaultHelp                          ( ) PRIVATE
  380.     //                                                        (X) PUBLIC
  381.     // DESCRIPTION:
  382.     //
  383.     //   Define help for objects of our class
  384.     //
  385.     wpclsQueryDefaultView: override;
  386.  
  387.     //
  388.     // METHOD: wpclsQueryDefaultView                          ( ) PRIVATE
  389.     //                                                        (X) PUBLIC
  390.     // DESCRIPTION:
  391.     //
  392.     //   WSFOLDER objects will default to details view
  393.     //
  394.     wpclsQueryStyle: override;
  395.  
  396.     //
  397.     // METHOD: wpclsQueryDefaultView                          ( ) PRIVATE
  398.     //                                                        (X) PUBLIC
  399.     // DESCRIPTION:
  400.     //
  401.     //   Change default class style so that WSFOLDER objects can be
  402.     //   "printed" (we'll just beep), ans so that this class is not
  403.     //   templatable.
  404.     //
  405.  
  406.   };
  407. #endif /* __SOMIDL__ */
  408. };
  409.  
  410. #endif  /* wsfolder_idl */
  411.