home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / wpshidl / samples / pwfolder / pwfolder.idl < prev    next >
Encoding:
Text File  |  1993-11-18  |  4.8 KB  |  185 lines

  1.  
  2. //# This file was generated by the SOM Compiler.
  3. //# FileName: pwfolder.id2.
  4. //# Generated using:
  5. //#     SOM Precompiler somopc: 2.2
  6. //#     SOM Emitter emitidl: 2.7
  7.  
  8. //
  9. //
  10. //   Module Name: PWFolder
  11. //
  12. //   SOM 2.0 / IDL Version
  13. //
  14. //   Copyright (C) 1992, 1993 IBM Corporation
  15. //
  16. //       DISCLAIMER OF WARRANTIES.  The following [enclosed] 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 pwfolder_idl
  27. #define pwfolder_idl
  28.  
  29. #include <wpfolder.idl>       //som2 changed "" to <>
  30. #include <somcls.idl>
  31.  
  32. //som2: equivalent idl type definition for user defined type PPWF_INFO added
  33. struct PWF_INFO {
  34.    char   szPassword[20];
  35.    char   szCurrentPassword[20];
  36.    char   szUserid[20];
  37. };
  38. typedef PWF_INFO *PPWF_INFO;
  39.  
  40. interface M_PWFolder;
  41.  
  42. interface PWFolder : WPFolder
  43.  
  44. // PWFolder is a Password protected folder.
  45. // It is derived as follows:
  46. //        SOMOject
  47. //          - WPObject
  48. //             - WPFileSystem
  49. //                - WPFolder
  50. //                   - PWFolder
  51.  
  52. {
  53.   BOOL LockFolder();
  54.  
  55.   //
  56.   //  METHOD:   LockFolder                                  PUBLIC
  57.   //
  58.   //  PURPOSE:  Invalidates the current password, thereby locking the folder.
  59.   //
  60.   //  INVOKED:  From _wpMenuItemSelected
  61.   //
  62.  
  63.  
  64. #ifdef __PRIVATE__
  65.  
  66.   BOOL QueryInfo(in PPWF_INFO pPWFolderInfo);
  67.  
  68.   //
  69.   //  METHOD:   QueryInfo                                   PRIVATE
  70.   //
  71.   //  PURPOSE:  Copies instance data into the PWF_INFO structure.
  72.   //
  73.   //  INVOKED:  From PasswordDlgProc
  74.   //
  75.  
  76.   BOOL SetInfo(in PPWF_INFO pPWFolderInfo);
  77.  
  78.   //
  79.   //  METHOD:   SetInfo                                     PRIVATE
  80.   //
  81.   //  PURPOSE:  Sets instance data from the PWF_INFO structure.
  82.   //
  83.   //  INVOKED:  From PasswordDlgProc
  84.   //
  85.  
  86.  
  87. #endif
  88.  
  89.  
  90. #ifdef __SOMIDL__
  91.   implementation {
  92.  
  93.     releaseorder: LockFolder,QueryInfo,SetInfo;
  94.  
  95.     //# Class Modifiers
  96.     filestem = pwfolder;
  97.     externalprefix = pwfolder_;
  98.     majorversion = 1;
  99.     minorversion = 1;
  100.     local;
  101.     metaclass = M_PWFolder;
  102.     callstyle = oidl;
  103.  
  104. /* SOM2 Compiler no longer generates a .ph file, so you must change all
  105.    references to ph -> h and enclose private information with an ifdef
  106.    __PRIVATE__ */
  107.  
  108. /* som2   CHAR -> char, since IDL won't allow CHAR to be typedefed as char */
  109.  
  110.     passthru C_h =  ""
  111. #ifdef __PRIVATE__
  112. "typedef struct _PWF_INFO {                       /* Define password structure */"
  113. "  char   szPassword[20];                         /* Folder current password   */"
  114. "  char   szCurrentPassword[20];                  /* User-entered password     */"
  115. "  char   szUserid[20];                           /* Userid                    */"
  116. "} PWF_INFO;"
  117. "typedef PWF_INFO *PPWF_INFO;                     /* Define pointer type       */"
  118. #endif
  119. "";
  120.  
  121. /* som2 The continuation mark '\' must have a space before the " in the
  122.    passthru section i.e., \" -> \ " */
  123.  
  124.     passthru C_h_after =  ""
  125. "#define DebugBox(title, text)  WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, \ "
  126. "                               (PSZ) text , (PSZ) title, 0, \ "
  127. "                               MB_OK | MB_INFORMATION )"
  128. "";
  129.  
  130.     //# Internal Instance Variables
  131.     char szPassword[20];          //  This is the password which locks the folder
  132.     char szCurrentPassword[20];   //  This is the password the user has typed in to be
  133.                                   //  checked against the lock password
  134.     char szUserid[20];            //  Userid
  135.  
  136.     //# Method Modifiers
  137.     wpInitData: override;
  138.     wpModifyPopupMenu: override;
  139.     wpMenuItemSelected: override;
  140.     wpOpen: override;
  141.     wpSetTitle: override;
  142.     wpSetup: override;
  143.     wpSaveState: override;
  144.     wpRestoreState: override;
  145.     wpSetIcon: override;
  146.  
  147.     //# Data Modifiers
  148.  
  149. #ifdef __PRIVATE__
  150.  
  151.     //# Data Modifiers
  152.  
  153. #endif
  154.  
  155.   };
  156. #endif /* __SOMIDL__ */
  157. };
  158.  
  159. interface M_PWFolder
  160. {
  161.  
  162. #ifdef __SOMIDL__
  163.   implementation {
  164.  
  165.     //# Class Modifiers
  166.     filestem = pwfolder;
  167.     externalprefix = pwfoldercls_;         /* som2  changed pwfolder_ to pwfoldercls_ */
  168.     functionprefix = pwfoldercls_;
  169.     majorversion = 1;
  170.     minorversion = 1;
  171.     local;
  172.     callstyle = oidl;
  173.  
  174.     //# Method Modifiers
  175.     wpclsQueryTitle: override;
  176.     wpclsInitData: override;
  177.     wpclsQueryIcon: override;
  178.     wpclsUnInitData: override;
  179.  
  180.   };
  181. #endif /* __SOMIDL__ */
  182. };
  183.  
  184. #endif  /* pwfolder_idl */
  185.