home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wpdsc093.zip / dscrlst.idl < prev    next >
Text File  |  1995-11-06  |  5KB  |  199 lines

  1.  
  2. #ifndef DSCRFileList_idl
  3. #define DSCRFileList_idl
  4.  
  5. #include <somcls.idl>
  6. #include <wpfolder.idl>
  7.  
  8. interface M_DSCRFileList;
  9.  
  10. interface DSCRFileList: WPFolder {
  11.  
  12.     struct  file_entry {
  13.         string filename;
  14.         string description;
  15.     };
  16.  
  17.    attribute sequence<file_entry> file_list;
  18.    // This attribute containes the digestible file list representation.
  19.    // It is initialized by InitAttrs method.
  20.  
  21.     attribute string name_of_file_list;
  22.     // This attribute containes the name of the file list for
  23.     // this folder.
  24.  
  25.    long file_list_len();
  26.    // Returns file_list._length
  27.  
  28.    BOOL InitAttrs();
  29.    // This method initializes attributes of this object.
  30.  
  31.    string File2Descr(in string fname);
  32.    // This method retrieves file description from this file list.
  33.    // If file was not found in this file list then "No description"
  34.    // is returned.
  35.  
  36.    string GetFileDescr(in string fname);
  37.    // This is an alias for File2Descr
  38.  
  39.    BOOL SetFileDescr(in string fname, in string dscr);
  40.    // This method sets the description for the given file
  41.  
  42.    void ApplyFileListSettingsToSubfolders();
  43.    // This method applies this's folder settings to it's subfolders
  44.  
  45.  
  46.  
  47. #ifdef __SOMIDL__
  48.    implementation {
  49.  
  50.    releaseorder: File2Descr, _get_file_list, _set_file_list,
  51.       InitAttrs, file_list_len,
  52.       _get_name_of_file_list, _set_name_of_file_list,_get_useEA,_set_useEA,
  53.       _get_lines_treshold, _set_lines_treshold,
  54.       _get_changed_name_of_file_list,
  55.       _set_changed_name_of_file_list,
  56.       ParseLine,
  57.       FileListHasBeenTouched,
  58.       GetFileDescr,
  59.       SetFileDescr,
  60.       LoadFilelist,
  61.       SaveFilelist,
  62.       ApplyFileListSettingsToSubfolders,
  63.       CopySettingsFrom;
  64.  
  65.    externalstem   = DSCRlst;
  66.    externalprefix = DSCRlst_;
  67.    filestem = DSCRlst;
  68.    local;
  69.    callstyle=oidl;
  70.  
  71.    majorversion = 1;
  72.    minorversion = 2;
  73.  
  74.  
  75.     metaclass = M_DSCRFileList;
  76.  
  77.  
  78.     name_of_file_list: noget,noset ;
  79.     useEA: noget;
  80.  
  81.     passthru C_xh =     ""
  82.    "   #include <somtypes.h>"
  83.    "   #define INCL_WIN"
  84.    "   #define INCL_DOS"
  85.    "   #define INCL_GPIBITMAPS"
  86.    "   #define INCL_DOSERRORS"
  87.         "   #define INCL_DOSNMPIPES"
  88.    "   #include <os2.h>"
  89.    "   #include <wpsdebug.h>"
  90.    ""
  91.    "   #define INCL_WPCLASS"
  92.    "   #define INCL_WPFOLDER"
  93.    ""
  94.    "   #include <pmwp.h>"
  95.    ""
  96.    "  #define DSCR_MAX_LINE 200 /* maximum length of file list line */"
  97.    " #define ID_ICON1                     101"
  98.    " #define ID_ICON2                     102"
  99.    ""
  100.    "  "
  101.    "   /*"
  102.    "    *  Keys for save-restore methods"
  103.    "    */"
  104.    "  #define IDKEY_FILELISTNAME            1"
  105.    "  #define IDKEY_USEEAFLAG               2"
  106.    ""
  107.    "/* Settings notebook dialog box IDs */        "
  108.    "   #include <dscrfl.h>"
  109.    "   typedef struct _DSCRFLSET_DLGDATA"
  110.    "   {"
  111.    "      USHORT   cb;                  /* size of this structure */"
  112.    "      DSCRFileList *somSelf;        /* pointer to this instance         */"
  113.    "      PSZ      FileListName;"
  114.    "      BOOL     useEA;"
  115.    "   } DSCRFLSET_DLGDATA;"
  116.    "   typedef DSCRFLSET_DLGDATA *PDSCRFLSET_DLGDATA;"
  117.    ""
  118.    "  /* Adding popup menu item */" 
  119.    ""
  120.    "  #define ID_MOREITEMS     (WPMENUID_USER+1)"
  121.    "  #define ID_MENU_FILELIST (WPMENUID_USER+2)"
  122.    "  #define ID_SUBMENU_APPLY (WPMENUID_USER+3)"
  123.    "  ";
  124.  
  125.  
  126.     passthru C_xh_after =  ""
  127.    "";
  128.  
  129.       wpInitData: override;
  130.       wpUnInitData: override;
  131.       wpPopulate: override;
  132.       wpSetup: override;
  133.       wpSaveState: override;
  134.       wpRestoreState: override;
  135.       wpAddSettingsPages: override;
  136.       wpModifyPopupMenu: override;
  137.       wpMenuItemSelected: override;
  138.  
  139.    };
  140. #endif //__SOMIDL__
  141.  
  142. };
  143.  
  144.  
  145. interface M_DSCRFileList: M_WPFolder {
  146.  
  147.   HMODULE clsQueryModuleHandle();
  148.  
  149.   //
  150.   // METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  151.   //                                                        (X) PUBLIC
  152.   // DESCRIPTION:
  153.   //
  154.   //   Gets the module handle.
  155.   //
  156.   // RETURN:
  157.   //      NULLHANDLE     - an error occured.
  158.   //      Not NULLHANDLE - The handle for DLL containing the DSCRFileList
  159.   //                       class.
  160.   //
  161.  
  162.    string GetDefault_file_list_name();
  163.    // this method returns the default file name for this class
  164.  
  165.  
  166.    DSCRFileList GetDefaultTemplate();
  167.    // this method returns template object of this class located in <WP_TEMPS> folder
  168.  
  169. #ifdef __SOMIDL__
  170.    implementation {
  171.    releaseorder: clsQueryModuleHandle,GetDefault_file_list_name, GetDefaultTemplate ;
  172.  
  173.    externalstem   = DSCRlst;
  174.    externalprefix = DSCRlstM_;
  175.     functionprefix = DSCRlstM_;
  176.    filestem = DSCRlst;
  177.    local;
  178.    callstyle=oidl;
  179.  
  180.    majorversion = 1;
  181.    minorversion = 2;
  182.  
  183.  
  184.  
  185.    wpclsInitData:                   override;
  186.    wpclsUnInitData:                 override;
  187.    wpclsQueryTitle:                 override;
  188.    wpclsQueryIconData:              override;
  189.    wpclsQueryIconDataN:             override;
  190.    wpclsCreateDefaultTemplates:     override;
  191.  
  192.    };
  193. #endif
  194.  
  195. };
  196.  
  197. #endif
  198.  
  199.