home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SemtIntf.h
-
- Contains: SemanticInterface class
-
- Written by: Nick Pilch
-
- Copyright: ⌐ 1993 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <32> 2/16/94 JA Minor tweak for CodeWarrior (look for
- __MWERKS__ below...)
- <31> 2/9/94 NP Tiger Team cleanup.
- <30> 2/8/94 JA Minor tweak for CodeWarrior.
- <29> 2/7/94 NP Tiger Team doings.
- <28> 1/28/94 NP Changed parameter in
- XMPAEDescCoercionHandler from AEDesc to
- AEDesc*.
- <27> 1/17/94 NP Removed consts from public API.
- <26> 1/17/94 NP Changes to callback typedefs.
- <25> 1/14/94 NP Init changes.
- <24> 12/20/93 NP Removed inadvertant character.
- <23> 12/20/93 NP Removed private parts from XMPOSLToken.
- <22> 12/17/93 eeh constants for part frame info properties
- <21> 12/9/93 eeh added enum cFrame
- <20> 11/30/93 NP Added token inquiry proc.
- <19> 11/5/93 NP Removed CallObjectAccessor to
- XMPNameResolver.
- <18> 10/22/93 NP Removed private method.
- <17> 10/18/93 NP InstallErrDescProc -> InstallGetErrDescProc
- and removed code name.
- <16> 10/11/93 NP Many tweaks to callback func type
- definitions. Changed SetObjectCallbacks to
- 7 new routines which each take a new refCon
- parameter.
- <15> 9/20/93 NP Fixed some types that were platform
- dependent. Changed XMPOSLToken temporarily.
- <14> 9/3/93 NP Added "Part" class.
- <13> 8/25/93 NP Moved some defs to here.
- <12> 8/18/93 NP Added OSLSupportFlags getters and setters.
- <11> 8/16/93 NP Adjusted for latest OSL proposal.
- <10> 7/28/93 NP Tweaks to interfaces.
- <9> 7/27/93 CG Added typedef for XMPErrDescProcPtr
- <8> 7/23/93 CG fixed coercionProcPtr
- <7> 7/2/93 CG Abstract/Concrete breakout.
- <6> 6/30/93 CG Added SICoercionValue field to
- XMPSemanticInterface class.
- <5> 6/10/93 NP Added some private members.
- <4> 4/28/93 NP File name changes.
- <3> 4/23/93 NP Added Initialize member function.
- <2> 4/16/93 NP XMPHashTable -> XMPAEHashTable.
- <1> 4/13/93 NP first checked in
-
- To Do:
- */
-
- #ifndef _SEMTINTF_
- #define _SEMTINTF_
-
-
- #ifndef _XMPTYPES_
- #include "XMPTypes.h"
- #endif
-
- #ifndef _EXTENSN_
- #include "Extensn.h"
- #endif
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- class XMPAbsSemanticInterface;
- class XMPAEHashTable;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- class XMPPart;
- class XMPExtension;
- class XMPMessageInterface;
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- enum
- {
- cPart = 0x70617274 // 'part'
-
- // for part info dialog properties
- ,kXMPPCategory = 0x63617465 // 'cate'
- ,kXMPPSize = 0x73697A65 // 'size'
- ,kXMPPCreationDate = 0x63726474 // 'crdt'
- ,kXMPPModDate = 0x6D6F6474 // 'modt'
- ,kXMPPAuthor = 0x61757468 // 'auth'
- ,kXMPPIcon = 0x69636F6E // 'icon'
- ,kXMPPName = 0x706E616D // 'pnam'
- ,kXMPPKind = 0x706B6E64 // 'pknd'
- ,kXMPPEditor = 0x65647472 // 'edtr'
- ,kXMPPComments = 0x636D6E74 // 'cmnt'
- ,kXMPPView = 0x76696577 // 'view'
- ,kXMPPIsFrozen = 0x66727A6E // 'frzn'
- ,kXMPPIsStationery = pIsStationeryPad
- };
-
- #ifdef __MWERKS__
- // $$$$$ CodeWarrior a1 generates global storage for the const declaration,
- // so #define it instead.
- #define kXMPAppShell ((XMPPart*)0)
- #else
- XMPPart* const kXMPAppShell = 0;
- #endif
-
- struct OSLContext;
- typedef OSLContext XMPOSLContext;
- const XMPSize kOSLContextSize = sizeof(XMPOSLContext*);
-
- //==============================================================================
- // Types
- //==============================================================================
-
- struct XMPOSLToken
- {
- public: // $$$$$ The 'public:' works around a CodeWarrior a1 bug
- DescType GetDescType() const {return descriptorType;}
- Handle GetDataHandle() const {return dataHandle;}
- void SetDescType(DescType type) {descriptorType = type;}
- void SetDataHandle(Handle hand) {dataHandle = hand;}
- DescType descriptorType;
- Handle dataHandle;
- };
-
- typedef XMPError (*XMPEventHandlerProcPtr)(XMPPart* thePart,
- AppleEvent* theAppleEvent,
- AppleEvent* reply,
- XMPSLong handlerRefcon);
-
- typedef XMPError (*XMPCoercionHandler)();
-
- typedef XMPError (*XMPDescCoercionHandler)(XMPPart* thePart,
- AEDesc* theAEDesc,
- DescType toType,
- XMPSLong handlerRefCon,
- AEDesc* result);
-
- typedef XMPError (*XMPPtrCoercionHandler)(XMPPart* thePart,
- DescType typeCode,
- XMPPtr dataPtr,
- XMPSize dataSize,
- DescType toType,
- XMPSLong handlerRefCon,
- AEDesc* result);
-
- typedef XMPError (*XMPAccessorProcPtr)(XMPPart* thePart,
- DescType desiredClass,
- XMPOSLToken* container,
- DescType containerClass,
- DescType form,
- AEDesc* selectionData,
- XMPOSLToken* value,
- XMPSLong handlerRefCon);
-
- typedef XMPError (*XMPCompareProcPtr)(XMPPart* thePart,
- DescType oper,
- XMPOSLToken* obj1,
- XMPOSLToken* obj2,
- XMPBoolean* result,
- XMPSLong refCon);
-
- typedef XMPError (*XMPCountProcPtr)(XMPPart* thePart,
- DescType desiredType,
- DescType containerClass,
- XMPOSLToken* container,
- XMPSLong* result,
- XMPSLong refCon);
-
- typedef XMPError (*XMPDisposeTokenProcPtr)(XMPPart* thePart,
- XMPOSLToken* unneededToken,
- XMPSLong refCon);
-
- typedef XMPError (*XMPGetErrDescProcPtr)(XMPPart* thePart,
- AEDesc** errDesc,
- XMPSLong refCon);
-
- typedef XMPError (*XMPGetMarkTokenProcPtr)(XMPPart* thePart,
- XMPOSLToken* dContainerToken,
- DescType containerClass,
- XMPOSLToken* result,
- XMPSLong refCon);
-
- typedef XMPError (*XMPMarkProcPtr)(XMPPart* thePart,
- XMPOSLToken* dToken,
- XMPOSLToken* markToken,
- XMPSLong index,
- XMPSLong refCon);
-
- typedef XMPError (*XMPAdjustMarksProcPtr)(XMPPart* thePart,
- XMPSLong newStart,
- XMPSLong newStop,
- XMPOSLToken* markToken,
- XMPSLong refCon);
-
- typedef XMPError (*XMPSpecialHandlerPtr)();
-
- typedef XMPPart* (*XMPTokenInquiryProcPtr)(XMPOSLToken* token,
- XMPSLong refCon);
-
- //==============================================================================
- // XMPSemanticInterface
- //==============================================================================
-
- class XMPAbsSemanticInterface : public XMPExtension
- {
- public:
-
- XMPAbsSemanticInterface() {}
- XMPVMethod ~XMPAbsSemanticInterface() {}
-
- //--------------------------------------------------------------------------
- // Extension Interface
- //--------------------------------------------------------------------------
-
- XMPVMethod void Release()
- =0;
-
- //--------------------------------------------------------------------------
- // Content Model
- //--------------------------------------------------------------------------
-
- XMPVMethod void InstallObjectAccessor(DescType desiredClass,
- DescType containerType,
- XMPAccessorProcPtr theAccessor,
- XMPSLong accessorRefcon)
- = 0;
-
- XMPVMethod void GetObjectAccessor(DescType desiredClass,
- DescType containerType,
- XMPAccessorProcPtr* theAccessor, // return parameter
- XMPSLong* accessorRefcon) // return parameter
- = 0;
-
- XMPVMethod void RemoveObjectAccessor(DescType desiredClass,
- DescType containerType,
- XMPAccessorProcPtr theAccessor)
- = 0;
-
- XMPVMethod void InstallCompareProc(XMPCompareProcPtr compareProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallCountProc(XMPCountProcPtr countProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallDisposeTokenProc(XMPDisposeTokenProcPtr disposeTokenProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallGetMarkTokenProc(XMPGetMarkTokenProcPtr getMarkTokenProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallMarkProc(XMPMarkProcPtr markProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallAdjustMarksProc(XMPAdjustMarksProcPtr adjustMarksProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallGetErrDescProc(XMPGetErrDescProcPtr errorDescProc,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void InstallTokenInquiryProc(XMPTokenInquiryProcPtr tokenInquiryProc,
- XMPSLong refCon)
- = 0;
-
- //--------------------------------------------------------------------------
- // Semantic Events
- //--------------------------------------------------------------------------
-
- XMPVMethod void InstallEventHandler(AEEventClass theAEEventClass,
- AEEventID theAEEventID,
- XMPEventHandlerProcPtr handler,
- XMPSLong handlerRefcon)
- = 0;
-
- XMPVMethod void RemoveEventHandler(AEEventClass theAEEventClass,
- AEEventID theAEEventID,
- XMPEventHandlerProcPtr handler)
- = 0;
-
- XMPVMethod void GetEventHandler(AEEventClass theAEEventClass,
- AEEventID theAEEventID,
- XMPEventHandlerProcPtr* handler,
- XMPSLong* handlerRefcon)
- = 0;
-
- XMPVMethod void InstallCoercionHandler(DescType fromType,
- DescType toType,
- XMPCoercionHandler handler,
- XMPSLong handlerRefcon,
- XMPBoolean fromTypeIsDesc)
- = 0;
-
- XMPVMethod void RemoveCoercionHandler(DescType fromType,
- DescType toType,
- XMPCoercionHandler handler)
- = 0;
-
- XMPVMethod void GetCoercionHandler(DescType fromType,
- DescType toType,
- XMPCoercionHandler* handler,
- XMPSLong* handlerRefcon,
- XMPBoolean* fromTypeIsDesc)
- = 0;
-
- XMPVMethod void InstallSpecialHandler(AEKeyword functionClass,
- XMPSpecialHandlerPtr handler,
- XMPSLong refCon)
- = 0;
-
- XMPVMethod void RemoveSpecialHandler(AEKeyword functionClass,
- XMPSpecialHandlerPtr handler)
- = 0;
-
- XMPVMethod void GetSpecialHandler(AEKeyword functionClass,
- XMPSpecialHandlerPtr* handler,
- XMPSLong* refCon)
- = 0;
-
- XMPVMethod void SetOSLSupportFlags(short flags)
- = 0;
-
- XMPVMethod short GetOSLSupportFlags()
- = 0;
- };
-
-
- #ifdef PLATFORM_MACINTOSH
- #ifndef _SEMTINTM_
- #include "SemtIntM.h"
- #endif
- #endif
-
- #endif // _SEMTINTF_
-