home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wpsclass.zip / WPOBJECT.HH < prev    next >
Text File  |  1995-05-15  |  43KB  |  994 lines

  1. #if !defined(WPSPTRS) && !defined(WPSREFS)
  2.    #define WPSPTRS
  3. #endif
  4.  
  5. #ifndef WPObject_Source
  6. #define WPObject_Source
  7.  
  8. class WPObject;
  9.  
  10. #define WPObject_MajorVersion 1
  11. #define WPObject_MinorVersion 2
  12.  
  13.    #pragma off(som_bindings);
  14.    #define INCL_WINSTDCNR
  15.    #include <pmstddlg.h>
  16.    #pragma pop(som_bindings);
  17.  
  18.       class M_WPObject;
  19.       class WPObject;
  20.  
  21.       #pragma off(som_bindings);
  22.       /* Object style flags (see wpSetStyle) */
  23.  
  24.       #define OBJSTYLE_NOMOVE          2
  25.       #define OBJSTYLE_NOLINK          4
  26.       #define OBJSTYLE_NOCOPY          8
  27.       #define OBJSTYLE_NOTDEFAULTICON 16
  28.       #define OBJSTYLE_TEMPLATE       32
  29.       #define OBJSTYLE_NODELETE       64
  30.       #define OBJSTYLE_NOPRINT       128
  31.       #define OBJSTYLE_NODRAG        256
  32.       #define OBJSTYLE_NOTVISIBLE    512
  33.       #define OBJSTYLE_NOSETTINGS   1024
  34.       #define OBJSTYLE_NORENAME     2048
  35.       #define OBJSTYLE_NODROP       4096
  36.  
  37.       /*  Class style flags (see wpclsQueryStyle) */
  38.  
  39.       #define CLSSTYLE_NEVERMOVE      OBJSTYLE_NOMOVE
  40.       #define CLSSTYLE_NEVERLINK      OBJSTYLE_NOLINK
  41.       #define CLSSTYLE_NEVERCOPY      OBJSTYLE_NOCOPY
  42.       #define CLSSTYLE_NEVERTEMPLATE  16
  43.       #define CLSSTYLE_NEVERDELETE    OBJSTYLE_NODELETE
  44.       #define CLSSTYLE_NEVERPRINT     OBJSTYLE_NOPRINT
  45.       #define CLSSTYLE_NEVERDRAG      OBJSTYLE_NODRAG
  46.       #define CLSSTYLE_NEVERVISIBLE   OBJSTYLE_NOTVISIBLE
  47.       #define CLSSTYLE_NEVERRENAME    OBJSTYLE_NORENAME
  48.       #define CLSSTYLE_PRIVATE        4096
  49.  
  50.       /* Flags for wpObjectReady() method */
  51.       #define OR_NEW           0x00000001
  52.       #define OR_AWAKE         0x00000002
  53.       #define OR_REFERENCE     0x10000000
  54.       #define OR_FROMTEMPLATE (0x00000004 | OR_REFERENCE)
  55.       #define OR_FROMCOPY     (0x00000008 | OR_REFERENCE)
  56.       #define OR_SHADOW       (0x00000010 | OR_REFERENCE)
  57.  
  58.       /*  Flags for the wpFilterPopupMenu() method */
  59.  
  60.       #define CTXT_CRANOTHER     0x0001   /* Flags for ulFlags */
  61.       #define CTXT_NEW           CTXT_CRANOTHER
  62.       #define CTXT_OPEN          0x0002
  63.       #define CTXT_WINDOW        0x0004
  64.       #define CTXT_SWITCHTO      CTXT_WINDOW
  65.       #define CTXT_CLOSE         0x0008
  66.       #define CTXT_SETTINGS      0x0010
  67.       #define CTXT_PRINT         0x0020
  68.       #define CTXT_HELP          0x0040
  69.       #define CTXT_DELETE        0x0080
  70.       #define CTXT_COPY          0x0100
  71.       #define CTXT_MOVE          0x0200
  72.       #define CTXT_SHADOW        0x0400
  73.       #define CTXT_LINK          CTXT_SHADOW
  74.       #define CTXT_PROGRAM       0x0800
  75.       #define CTXT_ICON        0x001000
  76.       #define CTXT_TREE        0x002000
  77.       #define CTXT_DETAILS     0x004000
  78.       #define CTXT_FIND        0x008000
  79.       #define CTXT_SELECT      0x010000
  80.       #define CTXT_ARRANGE     0x020000
  81.       #define CTXT_SORT        0x040000
  82.       #define CTXT_SHUTDOWN    0x080000
  83.       #define CTXT_LOCKUP      0x100000
  84.       #define CTXT_PALETTE     0x200000
  85.       #define CTXT_REFRESH     0x400000
  86.  
  87.  
  88.  
  89.       /* common context menu ids */
  90.  
  91.       #define WPMENUID_USER          0x6500
  92.       #define WPMENUID_PRIMARY            0
  93.       #define WPMENUID_OPEN               1
  94.       #define WPMENUID_HELP               2
  95.       #define WPMENUID_PRINT              3
  96.       #define WPMENUID_SELECT     4
  97.       #define WPMENUID_SORT       5
  98.  
  99.  
  100.       /*  Open views for the wpOpen() method */
  101.  
  102.       #define OPEN_UNKNOWN      -1
  103.       #define OPEN_DEFAULT       0
  104.       #define OPEN_CONTENTS      1
  105.       #define OPEN_SETTINGS      2
  106.       #define OPEN_HELP          3
  107.       #define OPEN_RUNNING       4
  108.       #define OPEN_PROMPTDLG     5
  109.       #define OPEN_PALETTE       121                                   /*SPLIT*/
  110.       #define OPEN_USER          0x6500
  111.  
  112.       /*  Definitions for the INUSE list that is kept
  113.        *  for every object via wpAddToObjUseList and
  114.        *  wpRemoveFromObjUseList methods...
  115.        */
  116.  
  117.       /* This structure is always followed immediately by a type
  118.        * dependant struct such as MEMORYITEM,RECORDITEM,VIEWITEM
  119.        * or some other user defined structure...
  120.        */
  121.       typedef struct _USEITEM
  122.       {
  123.          ULONG  type;                  /* Type of this Item */
  124.          struct _USEITEM *pNext;   /* Next item in use list */
  125.       } USEITEM;
  126.       typedef USEITEM *PUSEITEM;
  127.  
  128.       #define USAGE_MEMORY          1  /* Values of 'type' */
  129.       #define USAGE_RECORD          4
  130.       #define USAGE_OPENVIEW        5
  131.       #define USAGE_LINK            6
  132.       #define USAGE_OPENFILE       20
  133.  
  134.       typedef struct _MEMORYITEM       /* USAGE_MEMORY struct */
  135.       {
  136.          ULONG     cbBuffer;           /* Number of bytes in memory block */
  137.       } MEMORYITEM;
  138.       typedef MEMORYITEM *PMEMORYITEM;
  139.  
  140.       typedef struct _RECORDITEM       /* USAGE_RECORD struct */
  141.       {
  142.          HWND            hwndCnr;      /* Cnr into which object is inserted */
  143.          PMINIRECORDCORE pRecord;      /* Record pointer within that cnr */
  144.          ULONG           ulUser;       /* For application use */
  145.       } RECORDITEM;
  146.       typedef RECORDITEM *PRECORDITEM;
  147.  
  148.       #define VIEWSTATE_OPENING       0x0001   /* The view is being opened */
  149.       #define VIEWSTATE_OBJECTDELETED 0x0002   /* The object is being deleted */
  150.       #define VIEWSTATE_USERHIDDEN    0x0004   /* The view was hidden by user */
  151.       #define VIEWSTATE_POPULATING    0x0008   /* The view is populating      */
  152.  
  153.       typedef struct _VIEWITEM         /* USAGE_OPENVIEW struct */
  154.       {
  155.          ULONG        view;            /* Object view that this represents */
  156.          LHANDLE      handle;          /* Open handle */
  157.          ULONG        ulViewState;     /* View State flags */
  158.          HWND         hwndCnr;         /* System use only (window animation) */
  159.          PMINIRECORDCORE pRecord;      /* System use only (window animation) */
  160.       } VIEWITEM;
  161.       typedef VIEWITEM *PVIEWITEM;
  162.  
  163.       typedef struct _LINKITEM         /* USAGE_LINK struct */
  164.       {
  165.          WPObject    *LinkObj;         /* The link object */
  166.       } LINKITEM;
  167.       typedef LINKITEM *PLINKITEM;
  168.  
  169.       typedef struct _VIEWFILE         /* USAGE_OPENFILE struct */
  170.       {
  171.          ULONG        ulMenuId;        /* Menu id if association or menu page */
  172.          LHANDLE      handle;          /* Open handle */
  173.          HWND         hwndCnr;         /* System use only (window animation) */
  174.          PMINIRECORDCORE pRecord;      /* System use only (window animation) */
  175.       } VIEWFILE;
  176.       typedef VIEWFILE *PVIEWFILE;
  177.  
  178.       /* Notes: The class name immediately follows the control block. The
  179.        *        first instance variable control block immediately follows
  180.        *        this.
  181.        */
  182.       typedef struct _WPSRCLASSBLOCK
  183.       {
  184.         SHORT   ClassNameLength;       /* Length of class name, including the
  185.                                         * .. null terminator. This must be a
  186.                                         * .. SHORT and must be at the beginning
  187.                                         * .. of the structure.
  188.                                         */
  189.         USHORT  IVarLength;            /* Length of instance variable
  190.                                         * .. information, including the two-
  191.                                         * .. byte null terminator
  192.                                         */
  193.       } WPSRCLASSBLOCK;
  194.  
  195.       /*  Persistant storage structures (see wpSaveShort
  196.        *  and wpRestoreShort etc...)
  197.        */
  198.  
  199.  
  200.       /* This control structure does not reside in the dormant state.
  201.        * It is used only when a persistant data block is
  202.        * resident in memory - either when an object is being saved or
  203.        * when it is being restored...
  204.        */
  205.       typedef struct _OBJDATA
  206.       {
  207.          WPSRCLASSBLOCK       *CurrentClass;
  208.          WPSRCLASSBLOCK       *First;
  209.          PUCHAR                NextData;
  210.          USHORT                Length;
  211.       } OBJDATA;
  212.       typedef OBJDATA *POBJDATA;
  213.  
  214.       /*  wpCnrInsertObject/wpCnrRemoveObject structs
  215.        *  and macros...
  216.        */
  217.  
  218.       typedef struct _CLASSDETAILS     /* Class Details struct */
  219.       {
  220.          PSZ          pszAttribute;    /* Translatable string for a class attribute*/
  221.          PVOID        pSortRecord;     /* Function pointer for sort function for attribute*/
  222.          struct _CLASSDETAILS *pNext; /* Next item in class details list */
  223.       } CLASSDETAILS;
  224.       typedef CLASSDETAILS *PCLASSDETAILS;
  225.  
  226.       /* Macro to return the object associated with a given MINIRECORDCORE
  227.        * that was inserted using the wpCnrInsertObject method
  228.        */
  229.       #define OBJECT_FROM_PREC( prec )   ( (PVOID)( * (((PULONG)prec)-2) ) )
  230.  
  231.       /* Macro to access the app defineable dword within the RECORDITEM
  232.        * structure that is created when an object is put into a list
  233.        * control using the wpCnrInsertObject method.
  234.        */
  235.       PULONG EXPENTRY ShlGetUserWordPtr(
  236.          HWND            hwndCnr,
  237.          PMINIRECORDCORE prec );
  238.  
  239.       #define USERWORD_FROM_PREC( hwnd, prec )              \
  240.          ( (ULONG)( *ShlGetUserWordPtr(hwnd,prec) ) )
  241.  
  242.       /* Details comparison function definition
  243.        *
  244.        *    Param1  PVOID   - Pointer to details field value
  245.        *    Param2  PVOID   - Pointer to value to be compared with
  246.        *
  247.        *    Returns LONG    - Must be CMP_EQUAL, CMP_GREATER, CMP_LESS
  248.        */
  249.       typedef LONG (EXPENTRY FNCOMPARE)(PVOID,PVOID);
  250.       typedef FNCOMPARE *PFNCOMPARE;
  251.  
  252.       #define CMP_EQUAL            0
  253.       #define CMP_GREATER          1
  254.       #define CMP_LESS             2
  255.       #define CMP_GREATER_OR_EQUAL 3
  256.       #define CMP_LESS_OR_EQUAL    4
  257.       #define CMP_NOT_EQUAL        5
  258.  
  259.       #define NUM_CMP_VALUES       6
  260.  
  261.       /* Owner draw function definition
  262.        *
  263.        *    Param1  HWND  - Handle of window that is being painted
  264.        *    Param2  PVOID - POWNERITEM structure pointer, see the container
  265.        *                    control programming reference for the meaning
  266.        *                    of the fields in this structure.
  267.        *    Param3  PVOID - Pointer to the comparison value to draw (this
  268.        *                    is NULL, except when this function is painting
  269.        *                    its value into the include criteria dialog
  270.        *                    when it points to Criteria.CompareValue...)
  271.        *
  272.        *    Returns BOOL  - TRUE if the field was ownerdrawn, FALSE if the
  273.        *                    container control should do default painting.
  274.        */
  275.       typedef BOOL (EXPENTRY FNOWNDRW)(HWND,PVOID,PVOID);
  276.       typedef FNOWNDRW *PFNOWNDRW;
  277.  
  278.       /* Details comparison criteria structure
  279.        */
  280.       typedef struct _CRITERIA
  281.       {
  282.          PVOID            pReserved;           /* Reserved - MUST be null!!!! */
  283.          struct _CRITERIA *pNext;
  284.          struct _CRITERIA *pPrev;
  285.          ULONG            ClassFieldInfoIndex; /* Index of the details field  */
  286.          ULONG            LogicalOperator;     /* CRITERIA_AND or CRITERIA_OR */
  287.          ULONG            ComparisonType;      /* CMP_LESS_OR_EQUAL etc...    */
  288.          ULONG            ulLenCompareValue;   /* sizeof(ComparisonData)      */
  289.          CHAR             CompareValue[1];     /* Value to be compared with   */
  290.       } CRITERIA;
  291.       typedef CRITERIA *PCRITERIA;
  292.  
  293.       #define CRITERIA_AND        0
  294.       #define CRITERIA_OR         1
  295.  
  296.       /* ClassCriteria structure: points to a linked list of CRITERIA
  297.        * for the given class. ClassCriteria may be linked into a list
  298.        * too - and passed to a filter object, or the wpclsFindObjectFirst
  299.        * method call...
  300.        */
  301.       typedef struct _CLASSCRITERIA                                     /*!INC*/
  302.       {
  303.          struct _CLASSCRITERIA *pNext;
  304.          struct _CLASSCRITERIA *pPrev;
  305.          M_WPObject            *Class;          /* Class object */
  306.          PCRITERIA              pCriteria;      /* Linked list of criteria */
  307.          WPObject              *NotifyObject;   /* Owner of the criteria list */
  308.       } CLASSCRITERIA;
  309.       typedef CLASSCRITERIA *PCLASSCRITERIA;
  310.  
  311.       /* This structure is passed to a details criteria edit window
  312.        * when it is created, so that it knows the current value and
  313.        * min/max values for the criteria to be edited.
  314.        *
  315.        * As the user modifies the compare value using the criteria
  316.        * edit window, it should update the buffer pointed to by
  317.        * 'pCompareValue'.
  318.        */
  319.       typedef struct _EDITCTLINIT                                       /*!INC*/
  320.       {
  321.          ULONG cb;                /* must have length in control data! MindyP */
  322.          PVOID pCompareValue;     /* Buffer containing the current value */
  323.          ULONG ulLenCompareValue; /* Length of pCompareValue buffer */
  324.          PVOID pMinCompareValue;  /* READ-ONLY parameter, NULL => default */
  325.          PVOID pMaxCompareValue;  /* READ-ONLY parameter, NULL => default */
  326.       } EDITCTLINIT;
  327.       typedef EDITCTLINIT *PEDITCTLINIT;
  328.  
  329.       /* Structure for wpclsQueryDetailsInfo method
  330.        *
  331.        * CLASSFIELDINFO is identical to the FIELDINFO structure of the
  332.        * container control with the following differences:
  333.        *
  334.        * - The offStruct field from FIELDINFO is reserved.
  335.        * - The offFieldData and usLenFieldData structure elements have
  336.        *   been added.
  337.        * - Compare/Sort/Ownerdraw fields have also been added for the
  338.        *   convenience of the programmer, so that object details can
  339.        *   be customized and objects can be found or included by any
  340.        *   of their displayable object details.
  341.        *
  342.        * For example if the application has the following details data:
  343.        *
  344.        * typedef struct _SAMPLE {
  345.        *   CDATE   cdate;
  346.        *   CTIME   ctime;
  347.        *   PSZ     psz;
  348.        * }  SAMPLE;
  349.        *
  350.        * classfieldinfo[0].offFieldData   = FIELDOFFSET(SAMPLE,cdate);
  351.        * classfieldinfo[0].ulLenFieldData = FIELDOFFSET(SAMPLE,ctime) -
  352.        *                                    FIELDOFFSET(SAMPLE,cdate);
  353.        *
  354.        * classfieldinfo[1].offFieldData   = FIELDOFFSET(SAMPLE,ctime);
  355.        * classfieldinfo[1].ulLenFieldData = FIELDOFFSET(SAMPLE,psz) -
  356.        *                                    FIELDOFFSET(SAMPLE,ctime);
  357.        *
  358.        * classfieldinfo[2].offFieldData   = FIELDOFFSET(SAMPLE,psz);
  359.        * classfieldinfo[2].ulLenFieldData = sizeof(SAMPLE) -
  360.        *                                    FIELDOFFSET(SAMPLE,psz);
  361.        *
  362.        * NOTE: It is essential that the fields be linked in order ex. above
  363.        *       cdate must be followed by ctime and finally psz.
  364.        */
  365.       typedef struct _CLASSFIELDINFO                                    /*!INC*/
  366.       {
  367.          /* Details field attributes
  368.           */
  369.          ULONG      cb;                  /* size of CLASSFIELDINFO struct  */
  370.          ULONG      flData;              /* attributes of field's data     */
  371.          ULONG      flTitle;             /* attributes of field's title    */
  372.          PVOID      pTitleData;          /* title data (default is string) */
  373.                                          /* If CFT_BITMAP, must be HBITMAP */
  374.          ULONG      ulReserved;          /* Reserved                       */
  375.          PVOID      pUserData;           /* pointer to user data           */
  376.          struct _CLASSFIELDINFO *pNextFieldInfo; /* pointer to next linked */
  377.                                                 /* CLASSFIELDINFO structure*/
  378.          ULONG      cxWidth;             /* width of field in pels         */
  379.          ULONG      offFieldData;        /* offset from beginning of       */
  380.                                          /*   this class's data for this   */
  381.                                          /*   field. (first field is 0).   */
  382.          ULONG      ulLenFieldData;      /* width of data in bytes.        */
  383.                                          /*   (4 for a pointer).           */
  384.          PFNOWNDRW  pfnOwnerDraw;        /* Ownerdraw procedure for detail */
  385.                                          /* column. Can be NULL except if  */
  386.                                          /* ownerdraw is being used.       */
  387.          /* Include/Sort parameters
  388.           */
  389.          ULONG      flCompare;           /* Flags: for example, use the    */
  390.                                          /*   COMPARE_SUPPORTED flag if    */
  391.                                          /*   your field can be compared   */
  392.          PFNCOMPARE pfnCompare;          /* Comparison function for this   */
  393.                                          /*   field. Can be NULL unless    */
  394.                                          /*   ownerdraw is used.           */
  395.          ULONG      DefaultComparison;   /* This is the default compare    */
  396.                                          /*   operator in the include      */
  397.                                          /*   page criteria dialog. (eg:   */
  398.                                          /*   CMP_LESS_OR_EQUAL)           */
  399.          ULONG      ulLenCompareValue;   /* Maximum length of the compare  */
  400.                                          /*   data. Can be NULL unless     */
  401.                                          /*   ownerdraw is used.           */
  402.          PVOID      pDefCompareValue;    /* The default value to be used   */
  403.                                          /*   for comparisons. Can be NULL */
  404.                                          /*   unless ownerdraw is used.    */
  405.          PVOID      pMinCompareValue;    /* The default value to be used   */
  406.                                          /*   for comparisons.Can be NULL  */
  407.                                          /*   unless ownerdraw is used.    */
  408.          PVOID      pMaxCompareValue;    /* The default value to be used   */
  409.                                          /*   for comparisons.Can be NULL  */
  410.                                          /*   unless ownerdraw is used.    */
  411.          PSZ        pszEditControlClass; /* Window class to be used to edit*/
  412.                                          /*   the compare value. Can be    */
  413.                                          /*   NULL unless ownerdraw is used*/
  414.          PFNCOMPARE pfnSort;             /* Sort function for this @SM09511*/
  415.                                          /*   field. Can be NULL unless    */
  416.                                          /*   ownerdraw is used.           */
  417.       } CLASSFIELDINFO;
  418.  
  419.       typedef CLASSFIELDINFO *PCLASSFIELDINFO;
  420.  
  421.       #define COMPARE_SUPPORTED      1
  422.       #define SORTBY_SUPPORTED       2
  423.  
  424.       /* Standard notebook size constants */
  425.       #define STDNOTEBOOKWIDTH    290
  426.       #define STDNOTEBOOKHEIGHT   275
  427.  
  428.       /* Confirm flags */
  429.       #define CONFIRM_DELETE        0x0001
  430.       #define CONFIRM_DELETEFOLDER  0x0002
  431.       #define CONFIRM_RENAMEFILESWITHEXT 0x0004
  432.       #define CONFIRM_KEEPASSOC          0x0008
  433.       #define CONFIRM_ACTION        0x0010
  434.       #define CONFIRM_PROGRESS      0x0020
  435.  
  436.       #define OK_DELETE             1
  437.       #define NO_DELETE             2
  438.       #define CANCEL_DELETE         3
  439.  
  440.       #define NUM_OBJDETAILS_FIELDS    2     /* number of object details */
  441.  
  442.       /* Search Type for wpclsQueryExtendedCriteria */
  443.  
  444.       #define SEARCH_ALL_FOLDERS 1
  445.       #define SEARCH_THIS_FOLDER 2
  446.       #define SEARCH_THIS_TREE   3
  447.  
  448.       /* Find method related types and constants */
  449.  
  450.       typedef WPObject   *OBJECT;                             /* FIND */
  451.       typedef OBJECT     *POBJECT;
  452.       typedef M_WPObject *CLASS;
  453.       typedef CLASS      *PCLASS;
  454.       typedef LHANDLE     HFIND;
  455.       typedef HFIND      *PHFIND;
  456.  
  457.       /* wpDrop method return code  */
  458.  
  459.       #define RC_DROP_DROPCOMPLETE 2
  460.       #define RC_DROP_ITEMCOMPLETE 1
  461.       #define RC_DROP_RENDERING    0
  462.       #define RC_DROP_ERROR       -1
  463.  
  464.       /*handle for files being tracked by the shell */
  465.  
  466.       typedef LHANDLE HFS;
  467.       #define MAXSZHFS 10       /* size of the translated string */
  468.  
  469.     #define SETTINGS_PAGE_REMOVED  -1
  470.  
  471.     /* wpSetConcurrentView values */
  472.       #define CCVIEW_DEFAULT 0
  473.       #define CCVIEW_ON      1
  474.       #define CCVIEW_OFF     2
  475.  
  476.     /* wpSetMinWindow values */
  477.       #define MINWIN_DEFAULT 0
  478.       #define MINWIN_HIDDEN  1
  479.       #define MINWIN_VIEWER  2
  480.       #define MINWIN_DESKTOP 3
  481.  
  482.     /* wpSetButtonAppearance values */
  483.       #define HIDEBUTTON      1
  484.       #define MINBUTTON      2
  485.       #define DEFAULTBUTTON  3
  486.  
  487.       #define  HIDDENMINWINDOW_DEFAULT MINWIN_VIEWER
  488.       #ifndef WPFolder_Source
  489.            #define WPFolder WPObject
  490.       #endif
  491.  
  492.       typedef struct _TASKREC
  493.       {
  494.          struct _TASKREC *next;     /* next in the list of current tasks   */
  495.          ULONG            useCount; /* can be referenced by multiple object*/
  496.          PVOID            pStdDlg;  /* ptr to standard WP task dialog      */
  497.          WPFolder        *folder;   /* intended folder for the object      */
  498.          LONG             xOrigin;  /* intended position for the object    */
  499.          LONG             yOrigin;  /* intended position for the object    */
  500.          PSZ              pszTitle; /* intended name for the object        */
  501.          ULONG            cbTitle;  /* length of the name buffer           */
  502.          PMINIRECORDCORE  positionAfterRecord; /* intended sort position   */
  503.          BOOL            fKeepAssociations;
  504.          PVOID            pReserved;    /* reserved - equal null           */
  505.  
  506.       }  TASKREC;
  507.       typedef TASKREC *PTASKREC;
  508.       #pragma pop(som_bindings);
  509.  
  510. /*
  511.  * Passthru some stuff to the .h file
  512.  */
  513. #include <somobj.hh>
  514. #pragma off(dts_class);
  515. #pragma on(somobject_assignment_operators);
  516. #pragma on(somobject_constructors);
  517. #pragma on(somobject_destructor);
  518. #pragma off(case_insensitive_class_names);
  519.  
  520. #pragma on(som_bindings);
  521.  
  522.  
  523. class WPObject : public SOMObject {
  524.  
  525.      #pragma SOMMap (WPObject, "WPObject", "M_WPObject")
  526.  
  527.      #pragma SOMClassVersion (WPObject, 1, 2)
  528.  
  529.      #pragma SOMCallstyle (WPObject, oidl)
  530.  
  531.      #pragma off(som_bindings);
  532.      #pragma pop(som_bindings);
  533.   public :
  534.  
  535. #pragma off(use_override_signature)
  536.      virtual ULONG wpAddObjectGeneralPage(HWND hwndNotebook);
  537.      virtual ULONG wpAddObjectWindowPage(HWND hwndNotebook);
  538.      virtual BOOL wpAddSettingsPages(HWND hwndNotebook);
  539.      virtual BOOL wpAddToObjUseList(PUSEITEM pUseItem);
  540.      virtual PBYTE wpAllocMem(ULONG cbBytes, PULONG prc);
  541. #if defined(WPSREFS)
  542.      virtual BOOL32 wpAppendObject(WPObject& targetObject, BOOL32 fMove);
  543. #else
  544.      virtual BOOL32 wpAppendObject(WPObject* targetObject, BOOL32 fMove);
  545. #endif
  546.      virtual BOOL wpAssertObjectMutexSem();
  547.      virtual BOOL wpClose();
  548.      virtual PMINIRECORDCORE wpCnrInsertObject(HWND hwndCnr,
  549.                                                PPOINTL pptlIcon,
  550.                                                PMINIRECORDCORE preccParent,
  551.                                                PRECORDINSERT pRecInsert);
  552.      virtual BOOL wpCnrRemoveObject(HWND hwndCnr);
  553.      virtual BOOL wpCnrSetEmphasis(ULONG ulEmphasisAttr, BOOL fTurnOn);
  554.      virtual ULONG wpConfirmDelete(ULONG fConfirmations);
  555. #if defined(WPSREFS)
  556.      virtual ULONG wpConfirmObjectTitle(WPFolder& Folder, WPObject*& ppDuplicate,
  557. #else
  558.      virtual ULONG wpConfirmObjectTitle(WPFolder* Folder, WPObject** ppDuplicate,
  559. #endif
  560.                                         PSZ pszTitle, ULONG cbTitle,
  561.                                         ULONG menuID);
  562.      virtual void wpCopiedFromTemplate();
  563. #if defined(WPSREFS)
  564.      virtual WPObject* wpCopyObject(WPFolder& Folder, BOOL fLock);
  565. #else
  566.      virtual WPObject* wpCopyObject(WPFolder* Folder, BOOL fLock);
  567. #endif
  568.      virtual WPObject* wpCreateAnother(PSZ pszTitle, PSZ pszSetupEnv,
  569. #if defined(WPSREFS)
  570.                                        WPFolder& Folder);
  571. #else
  572.                                        WPFolder* Folder);
  573. #endif
  574. #if defined(WPSREFS)
  575.      virtual WPObject* wpCreateFromTemplate(WPFolder& folder,
  576. #else
  577.      virtual WPObject* wpCreateFromTemplate(WPFolder* folder,
  578. #endif
  579.                                             BOOL fLock);
  580. #if defined(WPSREFS)
  581.      virtual WPObject* wpCreateShadowObject(WPFolder& Folder,
  582. #else
  583.      virtual WPObject* wpCreateShadowObject(WPFolder* Folder,
  584. #endif
  585.                                             BOOL fLock);
  586.      virtual ULONG wpDelete(ULONG fConfirmations);
  587.      virtual BOOL wpDeleteFromObjUseList(PUSEITEM pUseItem);
  588.      virtual BOOL wpDisplayHelp(ULONG HelpPanelId, PSZ HelpLibrary);
  589.      virtual BOOL wpDoesObjectMatch(PVOID pvoidExtendedCriteria);
  590. #if defined(WPSREFS)
  591.      virtual MRESULT wpDraggedOverObject(WPObject& DraggedOverObject);
  592. #else
  593.      virtual MRESULT wpDraggedOverObject(WPObject* DraggedOverObject);
  594. #endif
  595.      virtual MRESULT wpDragOver(HWND hwndCnr, PDRAGINFO pdrgInfo);
  596.      virtual MRESULT wpDrop(HWND hwndCnr, PDRAGINFO pdrgInfo,
  597.                             PDRAGITEM pdrgItem);
  598. #if defined(WPSREFS)
  599.      virtual BOOL wpDroppedOnObject(WPObject& DroppedOnObject);
  600. #else
  601.      virtual BOOL wpDroppedOnObject(WPObject* DroppedOnObject);
  602. #endif
  603.      virtual MRESULT wpEndConversation(ULONG ulItemID, ULONG flResult);
  604.      virtual ULONG wpFilterPopupMenu(ULONG ulFlags, HWND hwndCnr,
  605.                                      BOOL fMultiSelect);
  606.      virtual PUSEITEM wpFindUseItem(ULONG type, PUSEITEM pCurrentItem);
  607.      virtual BOOL wpFormatDragItem(PDRAGITEM pdrgItem);
  608.      virtual BOOL wpFree();
  609.      virtual BOOL wpFreeMem(PBYTE pByte);
  610.      virtual BOOL wpHide();
  611.      virtual void wpInitData();
  612.      virtual BOOL wpInsertPopupMenuItems(HWND hwndMenu, ULONG iPosition,
  613.                                          HMODULE hmod, ULONG MenuID,
  614.                                          ULONG SubMenuID);
  615.      virtual ULONG wpInsertSettingsPage(HWND hwndNotebook, PPAGEINFO ppageinfo);
  616.      virtual BOOL wpMenuItemHelpSelected(ULONG MenuId);
  617.      virtual BOOL wpMenuItemSelected(HWND hwndFrame, ULONG ulMenuId);
  618.      virtual BOOL wpModifyPopupMenu(HWND hwndMenu, HWND hwndCnr,
  619.                                     ULONG iPosition);
  620. #if defined(WPSREFS)
  621.      virtual BOOL wpMoveObject(WPFolder& Folder);
  622. #else
  623.      virtual BOOL wpMoveObject(WPFolder* Folder);
  624. #endif
  625.      virtual HWND wpOpen(HWND hwndCnr, ULONG ulView, ULONG param);
  626.      virtual BOOL wpPrintObject(PPRINTDEST pPrintDest, ULONG ulReserved);
  627.      virtual ULONG wpQueryConcurrentView();
  628.      virtual ULONG wpQueryButtonAppearance();
  629.      virtual ULONG wpQueryConfirmations();
  630.      virtual BOOL wpQueryDefaultHelp(PULONG pHelpPanelId, PSZ HelpLibrary);
  631.      virtual ULONG wpQueryDefaultView();
  632.      virtual ULONG wpQueryDetailsData(PVOID* ppDetailsData, PULONG pcp);
  633.      virtual ULONG wpQueryError();
  634.      virtual HPOINTER wpQueryIcon();
  635.      virtual ULONG wpQueryIconData(PICONINFO pIconInfo);
  636.      virtual ULONG wpQueryMinWindow();
  637.      virtual ULONG wpQueryNameClashOptions(ULONG menuID);
  638.      virtual ULONG wpQueryStyle();
  639.      virtual BOOL32 wpSetTaskRec(PTASKREC pNew, PTASKREC pOld);
  640.      virtual PTASKREC wpFindTaskRec();
  641.      virtual PSZ wpQueryTitle();
  642.      virtual BOOL wpRegisterView(HWND hwndFrame, PSZ pszViewTitle);
  643.      virtual ULONG wpReleaseObjectMutexSem();
  644.      virtual MRESULT wpRender(PDRAGTRANSFER pdxfer);
  645.      virtual MRESULT wpRenderComplete(PDRAGTRANSFER pdxfer, ULONG ulResult);
  646. #if defined(WPSREFS)
  647.      virtual BOOL32 wpReplaceObject(WPObject& targetObject, BOOL32 fMove);
  648. #else
  649.      virtual BOOL32 wpReplaceObject(WPObject* targetObject, BOOL32 fMove);
  650. #endif
  651.      virtual ULONG wpRequestObjectMutexSem(ULONG ulTimeout);
  652.      virtual BOOL wpRestore();
  653.      virtual BOOL wpRestoreData(PSZ pszClass, ULONG ulKey, PBYTE pValue,
  654.                                 PULONG pcbValue);
  655.      virtual BOOL wpRestoreLong(PSZ pszClass, ULONG ulKey, PULONG pulValue);
  656.      virtual BOOL wpRestoreState(ULONG ulReserved);
  657.      virtual BOOL wpRestoreString(PSZ pszClass, ULONG ulKey,
  658.                                   PSZ pszValue, PULONG pcbValue);
  659.      virtual BOOL wpSaveData(PSZ pszClass, ULONG ulKey, PBYTE pValue,
  660.                              ULONG cbValue);
  661.      virtual BOOL wpSaveImmediate();
  662.      virtual BOOL wpSaveDeferred();
  663.      virtual BOOL wpSaveLong(PSZ pszClass, ULONG ulKey, ULONG ulValue);
  664.      virtual BOOL wpSaveState();
  665.      virtual BOOL wpSaveString(PSZ pszClass, ULONG ulKey, PSZ pszValue);
  666.      virtual BOOL wpScanSetupString(PSZ pszSetupString, PSZ pszKey,
  667.                                     PSZ pszValue, PULONG pcbValue);
  668.      virtual void wpSetConcurrentView(ULONG ulCCView);
  669.  
  670.      //sahsom2 VOID -> void
  671.      virtual void wpSetButtonAppearance(ULONG ulButtonType);
  672.  
  673.      //sahsom2 VOID -> void
  674.      virtual BOOL wpSetDefaultHelp(ULONG HelpPanelId, PSZ HelpLibrary);
  675.      virtual BOOL wpSetDefaultView(ULONG ulView);
  676.      virtual BOOL wpSetError(ULONG ulErrorId);
  677.      virtual BOOL wpSetIcon(HPOINTER hptrNewIcon);
  678.      virtual BOOL wpSetIconData(PICONINFO pIconInfo);
  679.      virtual void wpSetMinWindow(ULONG ulMinWindow);
  680.  
  681.      //sahsom2 VOID -> void
  682.      virtual BOOL wpSetStyle(ULONG ulNewStyle);
  683.      virtual BOOL wpModifyStyle(ULONG ulStyleFlags, ULONG ulStyleMask);
  684.      virtual BOOL wpSetTitle(PSZ pszNewTitle);
  685.      virtual BOOL wpSetup(PSZ pszSetupString);
  686.      virtual BOOL wpSwitchTo(ULONG View);
  687.      virtual void wpUnInitData();
  688.      virtual HWND wpViewObject(HWND hwndCnr, ULONG ulView, ULONG param);
  689.      virtual ULONG wpQueryTrueStyle();
  690.      virtual HOBJECT wpQueryHandle();
  691.      virtual BOOL wpUnlockObject();
  692.      virtual void somInit();
  693.      virtual void somUninit();
  694. #pragma pop(use_override_signature)
  695.  
  696.      #pragma SOMReleaseOrder ( \
  697.                               wpSetTitle, \
  698.                               wpQueryTitle, \
  699.                               wpSetStyle, \
  700.                               wpQueryStyle, \
  701.                               wpSetIcon, \
  702.                               wpQueryIcon, \
  703.                               *, \
  704.                               *, \
  705.                               *, \
  706.                               *, \
  707.                               wpSetDefaultView, \
  708.                               wpQueryDefaultView, \
  709.                               *, \
  710.                               wpSaveState, \
  711.                               *, \
  712.                               *, \
  713.                               wpSaveLong, \
  714.                               wpSaveString, \
  715.                               wpSaveData, \
  716.                               *, \
  717.                               wpRestoreState, \
  718.                               *, \
  719.                               *, \
  720.                               wpRestoreLong, \
  721.                               wpRestoreString, \
  722.                               wpRestoreData, \
  723.                               *, \
  724.                               wpAllocMem, \
  725.                               wpFreeMem, \
  726.                               wpAddToObjUseList, \
  727.                               wpDeleteFromObjUseList, \
  728.                               wpFindUseItem, \
  729.                               wpSwitchTo, \
  730.                               *, \
  731.                               wpFilterPopupMenu, \
  732.                               wpModifyPopupMenu, \
  733.                               wpMenuItemSelected, \
  734.                               wpFormatDragItem, \
  735.                               wpDrop, \
  736.                               wpDragOver, \
  737.                               wpRender, \
  738.                               wpEndConversation, \
  739.                               *, \
  740.                               *, \
  741.                               *, \
  742.                               wpFree, \
  743.                               wpCopiedFromTemplate, \
  744.                               wpAddSettingsPages, \
  745.                               wpAddObjectGeneralPage, \
  746.                               wpDisplayHelp, \
  747.                               wpMenuItemHelpSelected, \
  748.                               wpInsertSettingsPage, \
  749.                               wpInsertPopupMenuItems, \
  750.                               *, \
  751.                               *, \
  752.                               *, \
  753.                               *, \
  754.                               wpCnrInsertObject, \
  755.                               wpCnrRemoveObject, \
  756.                               wpInitData, \
  757.                               wpUnInitData, \
  758.                               wpSetup, \
  759.                               wpScanSetupString, \
  760.                               wpSaveImmediate, \
  761.                               wpOpen, \
  762.                               wpClose, \
  763.                               wpHide, \
  764.                               wpRestore, \
  765.                               wpSetIconData, \
  766.                               wpQueryIconData, \
  767.                               *, \
  768.                               wpDelete, \
  769.                               wpConfirmDelete, \
  770.                               *, \
  771.                               *, \
  772.                               *, \
  773.                               wpRegisterView, \
  774.                               *, \
  775.                               wpSetDefaultHelp, \
  776.                               wpQueryDefaultHelp, \
  777.                               wpDoesObjectMatch, \
  778.                               *, \
  779.                               wpSetError, \
  780.                               wpQueryError, \
  781.                               wpDraggedOverObject, \
  782.                               wpDroppedOnObject, \
  783.                               *, \
  784.                               *, \
  785.                               *, \
  786.                               *, \
  787.                               *, \
  788.                               *, \
  789.                               *, \
  790.                               wpQueryHandle, \
  791.                               wpSaveDeferred, \
  792.                               wpAddObjectWindowPage, \
  793.                               wpQueryConcurrentView, \
  794.                               wpSetConcurrentView, \
  795.                               wpQueryMinWindow, \
  796.                               wpSetMinWindow, \
  797.                               wpViewObject, \
  798.                               wpQueryButtonAppearance, \
  799.                               wpSetButtonAppearance, \
  800.                               wpQueryConfirmations, \
  801.                               wpCnrSetEmphasis, \
  802.                               *, \
  803.                               *, \
  804.                               wpCreateFromTemplate, \
  805.                               wpQueryTrueStyle, \
  806.                               wpAssertObjectMutexSem, \
  807.                               wpReleaseObjectMutexSem, \
  808.                               wpRequestObjectMutexSem, \
  809.                               wpCreateAnother, \
  810.                               wpCreateShadowObject, \
  811.                               wpCopyObject, \
  812.                               wpMoveObject, \
  813.                               *, \
  814.                               wpUnlockObject, \
  815.                               *, \
  816.                               wpRenderComplete, \
  817.                               wpQueryDetailsData, \
  818.                               wpPrintObject, \
  819.                               *, \
  820.                               wpSetTaskRec, \
  821.                               *, \
  822.                               wpModifyStyle, \
  823.                               *, \
  824.                               wpFindTaskRec, \
  825.                               wpAppendObject, \
  826.                               wpReplaceObject, \
  827.                               wpQueryNameClashOptions, \
  828.                               wpConfirmObjectTitle, \
  829.                               *, \
  830.                               *, \
  831.                               *, \
  832.                               *, \
  833.                               *, \
  834.                               *)
  835. };
  836. #pragma pop(som_bindings);
  837.  
  838. #pragma pop(dts_class);
  839. #pragma pop(somobject_assignment_operators);
  840. #pragma pop(somobject_constructors);
  841. #pragma pop(somobject_destructor);
  842. #pragma pop(case_insensitive_class_names);
  843. #endif /* WPObject_Source */
  844.  
  845. #ifndef M_WPObject_Source
  846. #define M_WPObject_Source
  847.  
  848.  
  849. #include <somcls.hh>
  850. #include <somcls.hh>
  851. #pragma off(dts_class);
  852. #pragma on(somobject_assignment_operators);
  853. #pragma on(somobject_constructors);
  854. #pragma on(somobject_destructor);
  855. #pragma off(case_insensitive_class_names);
  856.  
  857. #pragma on(som_bindings);
  858. class M_WPObject : public SOMClass {
  859.  
  860.      #pragma SOMClassVersion (M_WPObject, 1, 2)
  861.  
  862.      #pragma SOMCallstyle (M_WPObject, oidl)
  863.  
  864.      #pragma off(som_bindings);
  865.      #pragma pop(som_bindings);
  866.   public :
  867.  
  868. #pragma off(use_override_signature)
  869. #if defined(WPSREFS)
  870.      virtual BOOL wpclsCreateDefaultTemplates(WPObject& Folder);
  871. #else
  872.      virtual BOOL wpclsCreateDefaultTemplates(WPObject* Folder);
  873. #endif
  874.      virtual void wpclsInitData();
  875.      virtual WPObject* wpclsMakeAwake(PSZ pszTitle, ULONG ulStyle,
  876.                                       HPOINTER hptrIcon, POBJDATA pObjData,
  877. #if defined(WPSREFS)
  878.                                       WPFolder& Folder, ULONG ulUser);
  879. #else
  880.                                       WPFolder* Folder, ULONG ulUser);
  881. #endif
  882.      virtual WPObject* wpclsNew(PSZ pszTitle, PSZ pszSetupEnv,
  883. #if defined(WPSREFS)
  884.                                 WPFolder& Folder, BOOL fLock);
  885. #else
  886.                                 WPFolder* Folder, BOOL fLock);
  887. #endif
  888.      virtual BOOL wpclsQueryDefaultHelp(PULONG pHelpPanelId,
  889.                                         PSZ pszHelpLibrary);
  890.      virtual ULONG wpclsQueryDefaultView();
  891.      virtual PCLASSDETAILS wpclsQueryDetails();
  892.      virtual ULONG wpclsQueryDetailsInfo(PCLASSFIELDINFO* ppClassFieldInfo,
  893.                                          PULONG pSize);
  894.      virtual BOOL wpclsQueryExtendedCriteria(PSZ pszName, ULONG ulSearchType,
  895.                                              PVOID pvoidExtendedCriteria);
  896.      virtual WPObject* wpclsQueryFolder(PSZ pszLocation, BOOL fLock);
  897.      virtual HPOINTER wpclsQueryIcon();
  898. #if defined(WPSREFS)
  899.      virtual void wpclsQuerySearchInfo(M_WPObject*& ClassExtended,
  900. #else
  901.      virtual void wpclsQuerySearchInfo(M_WPObject** ClassExtended,
  902. #endif
  903. #if defined(WPSREFS)
  904.                                        M_WPObject*& ClassCreate,
  905. #else
  906.                                        M_WPObject** ClassCreate,
  907. #endif
  908.                                        PULONG pulClassCriteriaSize);
  909.      virtual ULONG wpclsQueryStyle();
  910.      virtual PSZ wpclsQueryTitle();
  911.      virtual void wpclsUnInitData();
  912.      virtual BOOL wpclsFindObjectFirst(PCLASS pClassList, PHFIND phFind,
  913. #if defined(WPSREFS)
  914.                                        PSZ pszTitle, WPFolder& Folder,
  915. #else
  916.                                        PSZ pszTitle, WPFolder* Folder,
  917. #endif
  918.                                        BOOL fSubfolders, PVOID pExtendedCriteria,
  919.                                        POBJECT pBuffer, PULONG pCount);
  920.      virtual BOOL wpclsFindObjectNext(HFIND hFind, POBJECT pBuffer,
  921.                                       PULONG pCount);
  922.      virtual BOOL wpclsFindObjectEnd(HFIND hFind);
  923.      virtual BOOL wpclsSetError(ULONG ulErrorId);
  924.      virtual ULONG wpclsQueryError();
  925.      virtual BOOL wpclsQuerySettingsPageSize(PSIZEL pSizl);
  926.      virtual ULONG wpclsQueryIconData(PICONINFO pIconInfo);
  927.      virtual WPObject* wpclsQueryObject(HOBJECT hObject);
  928.      virtual ULONG wpclsQueryButtonAppearance();
  929.      virtual void somUninit();
  930. #if defined(WPSREFS)
  931.      virtual void somInitClass(string className, SOMClass& parentClass,
  932. #else
  933.      virtual void somInitClass(string className, SOMClass* parentClass,
  934. #endif
  935.                                long dataSize, long maxStaticMethods,
  936.                                long majorVersion, long minorVersion);
  937.      virtual SOMObject* somNew();
  938.      virtual SOMObject* somRenew(void* obj);
  939. #pragma pop(use_override_signature)
  940.  
  941.      #pragma SOMReleaseOrder ( \
  942.                               wpclsInitData, \
  943.                               wpclsUnInitData, \
  944.                               *, \
  945.                               wpclsMakeAwake, \
  946.                               *, \
  947.                               *, \
  948.                               wpclsQueryTitle, \
  949.                               wpclsQueryIcon, \
  950.                               wpclsQueryDefaultHelp, \
  951.                               wpclsQueryStyle, \
  952.                               wpclsQueryDetailsInfo, \
  953.                               wpclsQueryDefaultView, \
  954.                               wpclsQueryDetails, \
  955.                               wpclsQuerySearchInfo, \
  956.                               wpclsQueryExtendedCriteria, \
  957.                               wpclsCreateDefaultTemplates, \
  958.                               *, \
  959.                               wpclsFindObjectFirst, \
  960.                               wpclsFindObjectNext, \
  961.                               wpclsFindObjectEnd, \
  962.                               *, \
  963.                               wpclsSetError, \
  964.                               wpclsQueryError, \
  965.                               wpclsQuerySettingsPageSize, \
  966.                               *, \
  967.                               wpclsQueryIconData, \
  968.                               *, \
  969.                               *, \
  970.                               wpclsQueryObject, \
  971.                               *, \
  972.                               *, \
  973.                               *, \
  974.                               *, \
  975.                               *, \
  976.                               *, \
  977.                               wpclsQueryButtonAppearance, \
  978.                               wpclsNew, \
  979.                               wpclsQueryFolder, \
  980.                               *, \
  981.                               *, \
  982.                               *, \
  983.                               *)
  984. };
  985. #pragma pop(som_bindings);
  986.  
  987. #pragma pop(dts_class);
  988. #pragma pop(somobject_assignment_operators);
  989. #pragma pop(somobject_constructors);
  990. #pragma pop(somobject_destructor);
  991. #pragma pop(case_insensitive_class_names);
  992. #endif /* M_WPObject_Source */
  993.  
  994.