home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bento / headers / semtintf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  11.0 KB  |  351 lines

  1. /*
  2.     File:        SemtIntf.h
  3.  
  4.     Contains:    SemanticInterface class
  5.  
  6.     Written by:    Nick Pilch
  7.  
  8.     Copyright:    ⌐ 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <32>     2/16/94    JA        Minor tweak for CodeWarrior (look for
  13.                                     __MWERKS__ below...)
  14.         <31>      2/9/94    NP        Tiger Team cleanup.
  15.         <30>      2/8/94    JA        Minor tweak for CodeWarrior.
  16.         <29>      2/7/94    NP        Tiger Team doings.
  17.         <28>     1/28/94    NP        Changed parameter in
  18.                                     XMPAEDescCoercionHandler from AEDesc to
  19.                                     AEDesc*.
  20.         <27>     1/17/94    NP        Removed consts from public API.
  21.         <26>     1/17/94    NP        Changes to callback typedefs.
  22.         <25>     1/14/94    NP        Init changes.
  23.         <24>    12/20/93    NP        Removed inadvertant character.
  24.         <23>    12/20/93    NP        Removed private parts from XMPOSLToken.
  25.         <22>    12/17/93    eeh        constants for part frame info properties
  26.         <21>     12/9/93    eeh        added enum cFrame
  27.         <20>    11/30/93    NP        Added token inquiry proc.
  28.         <19>     11/5/93    NP        Removed CallObjectAccessor to
  29.                                     XMPNameResolver.
  30.         <18>    10/22/93    NP        Removed private method.
  31.         <17>    10/18/93    NP        InstallErrDescProc -> InstallGetErrDescProc
  32.                                     and removed code name.
  33.         <16>    10/11/93    NP        Many tweaks to callback func type
  34.                                     definitions. Changed SetObjectCallbacks to
  35.                                     7 new routines which each take a new refCon
  36.                                     parameter.
  37.         <15>     9/20/93    NP        Fixed some types that were platform
  38.                                     dependent. Changed XMPOSLToken temporarily.
  39.         <14>      9/3/93    NP        Added "Part" class.
  40.         <13>     8/25/93    NP        Moved some defs to here.
  41.         <12>     8/18/93    NP        Added OSLSupportFlags getters and setters.
  42.         <11>     8/16/93    NP        Adjusted for latest OSL proposal.
  43.         <10>     7/28/93    NP        Tweaks to interfaces.
  44.          <9>     7/27/93    CG        Added typedef for XMPErrDescProcPtr
  45.          <8>     7/23/93    CG        fixed coercionProcPtr
  46.          <7>      7/2/93    CG        Abstract/Concrete breakout.
  47.          <6>     6/30/93    CG        Added SICoercionValue field to
  48.                                     XMPSemanticInterface class.
  49.          <5>     6/10/93    NP        Added some private members.
  50.          <4>     4/28/93    NP        File name changes.
  51.          <3>     4/23/93    NP        Added Initialize member function.
  52.          <2>     4/16/93    NP        XMPHashTable -> XMPAEHashTable.
  53.          <1>     4/13/93    NP        first checked in
  54.  
  55.     To Do:
  56. */
  57.  
  58. #ifndef _SEMTINTF_
  59. #define _SEMTINTF_
  60.  
  61.  
  62. #ifndef _XMPTYPES_
  63. #include "XMPTypes.h"
  64. #endif
  65.  
  66. #ifndef _EXTENSN_
  67. #include "Extensn.h"
  68. #endif
  69.  
  70. //==============================================================================
  71. // Classes defined in this interface
  72. //==============================================================================
  73.  
  74. class    XMPAbsSemanticInterface;
  75. class    XMPAEHashTable;
  76.  
  77. //==============================================================================
  78. // Classes used by this interface
  79. //==============================================================================
  80.  
  81. class    XMPPart;
  82. class    XMPExtension;
  83. class    XMPMessageInterface;
  84.  
  85. //==============================================================================
  86. // Constants
  87. //==============================================================================
  88.  
  89. enum
  90. {
  91.     cPart = 0x70617274 // 'part'
  92.  
  93.     // for part info dialog properties
  94.     ,kXMPPCategory = 0x63617465 // 'cate'
  95.     ,kXMPPSize = 0x73697A65 // 'size'
  96.     ,kXMPPCreationDate = 0x63726474 // 'crdt'
  97.     ,kXMPPModDate = 0x6D6F6474 // 'modt'
  98.     ,kXMPPAuthor = 0x61757468 // 'auth'
  99.     ,kXMPPIcon = 0x69636F6E // 'icon'
  100.     ,kXMPPName = 0x706E616D // 'pnam'
  101.     ,kXMPPKind = 0x706B6E64 // 'pknd'
  102.     ,kXMPPEditor = 0x65647472 // 'edtr'
  103.     ,kXMPPComments = 0x636D6E74 // 'cmnt'
  104.     ,kXMPPView = 0x76696577 // 'view'
  105.     ,kXMPPIsFrozen = 0x66727A6E // 'frzn'
  106.     ,kXMPPIsStationery = pIsStationeryPad
  107. };
  108.  
  109. #ifdef __MWERKS__
  110.     // $$$$$ CodeWarrior a1 generates global storage for the const declaration,
  111.     // so #define it instead.
  112.     #define kXMPAppShell ((XMPPart*)0)
  113. #else
  114.     XMPPart* const    kXMPAppShell = 0;
  115. #endif
  116.  
  117. struct OSLContext;
  118. typedef OSLContext XMPOSLContext;
  119. const XMPSize    kOSLContextSize = sizeof(XMPOSLContext*);
  120.  
  121. //==============================================================================
  122. // Types
  123. //==============================================================================
  124.  
  125. struct XMPOSLToken
  126. {
  127. public:                            // $$$$$ The 'public:' works around a CodeWarrior a1 bug
  128.     DescType    GetDescType() const {return descriptorType;}
  129.     Handle        GetDataHandle() const {return dataHandle;}
  130.     void        SetDescType(DescType type) {descriptorType = type;}
  131.     void        SetDataHandle(Handle hand) {dataHandle = hand;}
  132.     DescType    descriptorType;
  133.     Handle        dataHandle;
  134. };
  135.  
  136. typedef XMPError (*XMPEventHandlerProcPtr)(XMPPart*        thePart,
  137.                                             AppleEvent*    theAppleEvent,
  138.                                             AppleEvent*    reply,
  139.                                             XMPSLong    handlerRefcon);
  140.  
  141. typedef XMPError (*XMPCoercionHandler)();
  142.  
  143. typedef XMPError (*XMPDescCoercionHandler)(XMPPart*        thePart,
  144.                                             AEDesc*        theAEDesc,
  145.                                             DescType    toType,
  146.                                             XMPSLong    handlerRefCon,
  147.                                             AEDesc*        result);
  148.  
  149. typedef XMPError (*XMPPtrCoercionHandler)(XMPPart*        thePart,
  150.                                             DescType    typeCode,
  151.                                             XMPPtr        dataPtr,
  152.                                             XMPSize        dataSize,
  153.                                             DescType    toType,
  154.                                             XMPSLong    handlerRefCon,
  155.                                             AEDesc*        result);
  156.  
  157. typedef XMPError (*XMPAccessorProcPtr)(XMPPart*                thePart,
  158.                                         DescType            desiredClass,
  159.                                         XMPOSLToken*        container,
  160.                                         DescType            containerClass,
  161.                                         DescType            form,
  162.                                         AEDesc*                selectionData,
  163.                                         XMPOSLToken*        value,
  164.                                         XMPSLong            handlerRefCon);
  165.  
  166. typedef XMPError (*XMPCompareProcPtr)(XMPPart*                thePart,
  167.                                         DescType            oper,
  168.                                         XMPOSLToken*        obj1,
  169.                                         XMPOSLToken*        obj2,
  170.                                         XMPBoolean*            result,
  171.                                         XMPSLong            refCon);
  172.  
  173. typedef XMPError (*XMPCountProcPtr)(XMPPart*            thePart,
  174.                                     DescType            desiredType,
  175.                                     DescType            containerClass,
  176.                                     XMPOSLToken*        container,
  177.                                     XMPSLong*            result,
  178.                                     XMPSLong            refCon);
  179.  
  180. typedef XMPError (*XMPDisposeTokenProcPtr)(XMPPart*            thePart,
  181.                                             XMPOSLToken*    unneededToken,
  182.                                             XMPSLong        refCon);
  183.  
  184. typedef XMPError (*XMPGetErrDescProcPtr)(XMPPart*        thePart,
  185.                                             AEDesc**    errDesc,
  186.                                             XMPSLong    refCon);
  187.  
  188. typedef XMPError (*XMPGetMarkTokenProcPtr)(XMPPart*                thePart,
  189.                                             XMPOSLToken*        dContainerToken,
  190.                                             DescType            containerClass,
  191.                                             XMPOSLToken*        result,
  192.                                             XMPSLong            refCon);
  193.  
  194. typedef XMPError (*XMPMarkProcPtr)(XMPPart*                thePart,
  195.                                     XMPOSLToken*        dToken,
  196.                                     XMPOSLToken*        markToken,
  197.                                     XMPSLong            index,
  198.                                     XMPSLong            refCon);
  199.  
  200. typedef XMPError (*XMPAdjustMarksProcPtr)(XMPPart*                thePart,
  201.                                             XMPSLong            newStart,
  202.                                             XMPSLong            newStop,
  203.                                             XMPOSLToken*        markToken,
  204.                                             XMPSLong            refCon);
  205.  
  206. typedef XMPError (*XMPSpecialHandlerPtr)();
  207.  
  208. typedef XMPPart* (*XMPTokenInquiryProcPtr)(XMPOSLToken*    token,
  209.                                             XMPSLong        refCon);
  210.  
  211. //==============================================================================
  212. // XMPSemanticInterface
  213. //==============================================================================
  214.  
  215. class XMPAbsSemanticInterface : public XMPExtension
  216. {
  217.   public:
  218.  
  219.     XMPAbsSemanticInterface() {}
  220.     XMPVMethod ~XMPAbsSemanticInterface() {}
  221.  
  222.     //--------------------------------------------------------------------------
  223.     // Extension Interface
  224.     //--------------------------------------------------------------------------
  225.  
  226.     XMPVMethod void Release()
  227.         =0;
  228.  
  229.     //--------------------------------------------------------------------------
  230.     // Content Model
  231.     //--------------------------------------------------------------------------
  232.  
  233.     XMPVMethod void        InstallObjectAccessor(DescType                desiredClass,
  234.                                                 DescType            containerType,
  235.                                                 XMPAccessorProcPtr    theAccessor,
  236.                                                 XMPSLong            accessorRefcon)
  237.         = 0;
  238.  
  239.     XMPVMethod void        GetObjectAccessor(DescType                desiredClass,
  240.                                            DescType                containerType,
  241.                                            XMPAccessorProcPtr*    theAccessor,        // return parameter
  242.                                            XMPSLong*            accessorRefcon)        // return parameter
  243.         = 0;    
  244.  
  245.     XMPVMethod void        RemoveObjectAccessor(DescType                desiredClass,
  246.                                               DescType                containerType,
  247.                                               XMPAccessorProcPtr    theAccessor)
  248.         = 0;
  249.  
  250.     XMPVMethod void InstallCompareProc(XMPCompareProcPtr    compareProc,
  251.                                             XMPSLong        refCon)
  252.         = 0;
  253.  
  254.     XMPVMethod void InstallCountProc(XMPCountProcPtr    countProc,
  255.                                             XMPSLong    refCon)
  256.         = 0;
  257.  
  258.     XMPVMethod void InstallDisposeTokenProc(XMPDisposeTokenProcPtr    disposeTokenProc,
  259.                                             XMPSLong                    refCon)
  260.         = 0;
  261.  
  262.     XMPVMethod void InstallGetMarkTokenProc(XMPGetMarkTokenProcPtr    getMarkTokenProc,
  263.                                                 XMPSLong                refCon)
  264.         = 0;
  265.  
  266.     XMPVMethod void InstallMarkProc(XMPMarkProcPtr    markProc,
  267.                                             XMPSLong    refCon)
  268.         = 0;
  269.  
  270.     XMPVMethod void InstallAdjustMarksProc(XMPAdjustMarksProcPtr    adjustMarksProc,
  271.                                             XMPSLong                refCon)
  272.         = 0;
  273.  
  274.     XMPVMethod void InstallGetErrDescProc(XMPGetErrDescProcPtr    errorDescProc,
  275.                                             XMPSLong            refCon)
  276.         = 0;
  277.  
  278.     XMPVMethod void InstallTokenInquiryProc(XMPTokenInquiryProcPtr    tokenInquiryProc,
  279.                                                 XMPSLong            refCon)
  280.         = 0;
  281.  
  282.     //--------------------------------------------------------------------------
  283.     // Semantic Events
  284.     //--------------------------------------------------------------------------
  285.  
  286.     XMPVMethod void    InstallEventHandler(AEEventClass                theAEEventClass,
  287.                                            AEEventID                theAEEventID,
  288.                                            XMPEventHandlerProcPtr    handler,
  289.                                            XMPSLong                    handlerRefcon)
  290.         = 0;
  291.     
  292.     XMPVMethod void    RemoveEventHandler(AEEventClass                    theAEEventClass,
  293.                                           AEEventID                    theAEEventID,
  294.                                           XMPEventHandlerProcPtr    handler)
  295.         = 0;
  296.     
  297.     XMPVMethod void    GetEventHandler(AEEventClass                theAEEventClass,
  298.                                        AEEventID                theAEEventID,
  299.                                        XMPEventHandlerProcPtr*    handler,
  300.                                        XMPSLong*                handlerRefcon)
  301.         = 0;
  302.     
  303.     XMPVMethod void    InstallCoercionHandler(DescType                    fromType,
  304.                                               DescType                toType,
  305.                                               XMPCoercionHandler    handler,
  306.                                               XMPSLong                handlerRefcon,
  307.                                               XMPBoolean            fromTypeIsDesc)
  308.         = 0;
  309.     
  310.     XMPVMethod void    RemoveCoercionHandler(DescType                fromType,
  311.                                              DescType            toType,
  312.                                              XMPCoercionHandler    handler)
  313.         = 0;
  314.     
  315.     XMPVMethod void    GetCoercionHandler(DescType                    fromType,
  316.                                               DescType                toType,
  317.                                               XMPCoercionHandler*    handler,
  318.                                               XMPSLong*                handlerRefcon,
  319.                                               XMPBoolean*            fromTypeIsDesc)
  320.         = 0;
  321.     
  322.     XMPVMethod void    InstallSpecialHandler(AEKeyword                    functionClass,
  323.                                                 XMPSpecialHandlerPtr    handler,
  324.                                                 XMPSLong                refCon)
  325.         = 0;
  326.     
  327.     XMPVMethod void    RemoveSpecialHandler(AEKeyword                    functionClass,
  328.                                                 XMPSpecialHandlerPtr    handler)
  329.         = 0;
  330.     
  331.     XMPVMethod void    GetSpecialHandler(AEKeyword                    functionClass,
  332.                                             XMPSpecialHandlerPtr*    handler,
  333.                                             XMPSLong*                refCon)
  334.         = 0;
  335.  
  336.     XMPVMethod void        SetOSLSupportFlags(short flags)
  337.         = 0;
  338.  
  339.     XMPVMethod short    GetOSLSupportFlags()
  340.         = 0;
  341. };
  342.  
  343.  
  344. #ifdef PLATFORM_MACINTOSH
  345. #ifndef _SEMTINTM_
  346. #include "SemtIntM.h"
  347. #endif
  348. #endif
  349.  
  350. #endif // _SEMTINTF_
  351.