home *** CD-ROM | disk | FTP | other *** search
- /***[f*****************************************************************
- * CIObjAcc.h -- PageMaker Object Access Interface.
- *
- * Copyright 1996 (c) Adobe Systems, Inc. All Rights Reserved
- *
- * PageMaker internal version
- *
- * $Revision: 1.16 $
- *
- *
- *
- ***f]*****************************************************************/
-
- #ifndef __CIOBJACC_H
- #define __CIOBJACC_H
-
- #include "pmtypes.h"
-
- #define INVAL_OBJID ((unsigned long)0xFFFFFFFF) /* Invalid ObjID */
-
- typedef struct _PMOBJ_REC {
- unsigned short :16;
- unsigned long :32;
- unsigned short :16;
- unsigned long :32;
- } PMOBJ_REC, *PPMOBJ_REC;
-
-
- // Attributes of a PageMaker object
- // These attributes are common for
- // all types of objects.
- //
- typedef struct _PMObjAttr {
- unsigned short type :8;
- unsigned short visible :1;
- unsigned short selected :1;
- unsigned short locked :1;
- unsigned short isInline :1;
- unsigned short nonPrinting :1;
- unsigned short isTransformed :1;
- unsigned short isLinked :1;
- unsigned short isBeingDeleted :1;
- unsigned short :8;
- long xLeftOrStart;
- long yTopOrStart;
- long xRightOrEnd;
- long yBottomOrEnd;
- long xRightOrStart;
- long yTopOrStart2;
- long xLeftOrEnd;
- long yBotOrEnd2;
- char layerName[32];
- unsigned long groupID;
- unsigned long maskID;
- short pageNum;
- char masterPageName[32];
- } PMObjAttr;
-
- // Fill and line information about an object
- typedef struct _fillAndLineInfo {
- int cFillStyle;
- char sFillColor[32];
- int bFillOverprint;
- int cLineStyle;
- int bReverse;
- short dLineWeight;
- int bOpaque;
- char sLineColor[32];
- int bLineOverprint;
- short nFillTint;
- short nLineTint;
- } PMFillAndLineInfo;
-
- // Fill and line information about an object
- typedef struct _transformInfo {
- int dRotateAngle;
- int dSkewAngle;
- int bXReflect;
- long width;
- long height;
- long xLeftTop;
- long yLeftTop;
- long xRightTop;
- long yRightTop;
- long xRightBottom;
- long yRightBottom;
- long xLeftBottom;
- long yLeftBottom;
- } PMTransformInfo;
-
- // Link information about an object
- typedef struct _linkInfo {
- char fFilename[256];
- int cLinkTech;
- char sKind[64];
- int nSize;
- char sPlaceTime[256]; /* sys date/time when file last placed */
- char sPlaceModTime[256]; /* file's mod date/time when last placed */
- char sPMModTime[256]; /* sys date/time when data last modified in PM (useful for text) */
- char sCurModTime[256]; /* file's current mod date/time */
- } PMLinkInfo;
-
- // Link information about an object that
- // includes a non-string represenation
- // of time.
- /*****************************************************************************
- * Date/time structure.
- *
- * Times are stored in a packed 32-bit structure.
- * The meanings of the individual bit-fields have been
- * chosen so as to make comparison of dates easy.
- * Times with a higher numerical value are more recent: times with a
- * lower numerical value are older. However, because different user
- * machines may have different times set on their clocks, or because users
- * may be collaborating with someone in a different time zone, it is
- * safest to do a comparison of whether or not two given times are equal,
- * rather than older or newer.
- *
- * The high order WORD contains the date. The low order WORD contains the
- * time. Bit-field meanings are as follows (0 being the least-significant
- * bit):
- * bit meaning range
- * ----- --------- -----------------
- * 25-31 year 0-127 [1980-2107]
- * 21-24 month 1-12
- * 16-20 day 1-31
- * 11-15 hour 0-23
- * 5-10 minutes 0-60
- * 0- 4 seconds/2 0-29 [0-58]
- *
- */
- typedef struct _linkTimeInfo {
- char fFilename[256];
- int cLinkTech;
- char sKind[64];
- int nSize;
- unsigned long nPlaceTime; /* sys date/time when file last placed */
- unsigned long nPlaceModTime; /* file's mod date/time when last placed */
- unsigned long nPMModTime; /* sys date/time when data last modified in PM (useful for text) */
- unsigned long nCurModTime; /* file's current mod date/time */
- } PMLinkTimeInfo;
-
- // Information about an inline graphic
- //
- // One can get information about both "valid" and "invalid" inline graphics.
- // "Invalid" inlines are those that have not been drawn since they were
- // moved or possibly moved or will have been moved by composition.
- // Note that GetFirstObject/GetNextObject will only return "valid"
- // inlines. CIText::GetStoryFirstILG/CIText::GetStoryFirstILG will
- // return all inline, both valid and invalid, found in a story.
- typedef struct _PMILGInfo {
- unsigned long storyID;
- unsigned long charPosition;
- int bIsValid;
- } PMILGInfo;
-
- // The structure that GetObjLinkTimeInfo returns.
- #ifdef MACINTOSH
- typedef struct
- {
- unsigned short year :7; /* year 1980 - 2107 */
- unsigned short month :4; /* month 1 - 12 */
- unsigned short day :5; /* day 1 - 31 */
- unsigned short hour :5; /* hour 1 - 23 */
- unsigned short minute :6; /* minute 0 - 59 */
- unsigned short second :5; /* seconds/2 0-29 */
- } PMTime, *pPMTime;
- #endif
-
- #ifdef WINDOWS
- typedef struct
- {
- unsigned short second :5; /* seconds/2 0-29 */
- unsigned short minute :6; /* minute 0 - 59 */
- unsigned short hour :5; /* hour 1 - 23 */
- unsigned short day :5; /* day 1 - 31 */
- unsigned short month :4; /* month 1-12 */
- unsigned short year :7; /* year 1980 - 2107 */
-
- } PMTime, *pPMTime;
- #endif
-
- /**[g******************************************************************
- * PMOBJACCFLAGTYPE
- *
- * DESCRIPTION:
- * The possible flags that can be used when beginning initializing
- * a loop through a subset of objects, starting with GetFirstObject().
- * These flags may be OR'ed to get, for example, all the selected
- * objects on the current spread (kGetSpreadObjects | kGetSelectedObjects).
- *
- **e]******************************************************************/
-
- typedef DWORD PMOBJACCFLAGTYPE;
- #define kIncludePasteboard (PMOBJACCFLAGTYPE) (1<<0)
- #define kIncludeMasterPages (PMOBJACCFLAGTYPE) (1<<1)
- #define kIncludeInlines (PMOBJACCFLAGTYPE) (1<<2)
- #define kIncludeGroupObjects (PMOBJACCFLAGTYPE) (1<<3)
- #define kGetTopLevelObjectsOnly (PMOBJACCFLAGTYPE) (1<<4)
- #define kGetSelectedObjectsOnly (PMOBJACCFLAGTYPE) (1<<5)
- #define kGetTargetLayerObjectsOnly (PMOBJACCFLAGTYPE) (1<<6)
-
- #ifdef __cplusplus
-
- class CIObjectAccess : public CIInterface
- {
- public:
- virtual ~CIObjectAccess() {};
-
- // Is this a valid object?
- // Use this to validate that a returned PMOBJ_REC really refers to
- // a valid PM object before calling other CIObjectAccess routines.
- virtual BOOL IsObject(PMOBJ_REC* pObjRec) = 0;
-
- // Methods for getting the objects on a given page
- //
- // Get the first object on the specified page.
- // The method returns the object record for the first object on
- // the given page that matches the specified PMOBJACCFLAGTYPE
- // flags (kIncludeMasterPages, kGetTopObjectsOnly, etc.).
- // If there are no objects of the given PMOBJACCFLAGTYPE,
- // a CQ_OBJACC_OBJ_NOT_FOUND will be returned as a return code
- // and the fields of the PMOBJ_REC will be zero'ed out.
- //
- // Regular page numbers may be specified. Alternatively, a master
- // page may be specified by using -3 or -4 for left master page
- // and right master page, respectively, in the pageNum parameter,
- // and the name of the master page in the masterPageName parameter.
- // In either case, if the pub has two page facing spreads, objects
- // will be returned for each page. For example, if the pub has
- // a two-page spread and pages 2 and 3 are facing pages, asking
- // for the objects on page 2 will return all the objects on
- // pages 2 and 3. And then, asking for the objects on page 3 will
- // return all those same objects again.
- // To get the objects on the current page, specify pageNum as -1
- // (or leave the argument off, since that is the default).
- //
- // When specifying kIncludeInlines, GetFirstObject()/GetNextObject()
- // will only return "valid" inlines--those that have not been moved
- // or will not be affected by pending text composition.
- //
- // When specifying kGetSelectedObjectsOnly, here is how we determine which
- // objects to return:
- //
- // kGetSelectedObjectsOnly | kGetTopLevelObjectsOnly (implies kIncludeGroupObjects):
- // selected objects: Yes
- // selected group object: Yes
- // objects in selected group: No
- // sub selected objects in group: No
- //
- // kGetSelectedObjectsOnly | kIncludeGroupObjects:
- // selected objects: Yes
- // selected group object: Yes
- // objects in selected group: No
- // sub selected objects in group: Yes
- //
- // kGetSelectedObjectsOnly:
- // selected objects: Yes
- // selected group object: No
- // objects in selected group: Yes
- // sub selected objects in group: Yes
- //
- //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // WARNING: Calling GetFirstObject and GetNextObject will cause PageMaker
- // to turn the page (either to a master page or to the specified regular
- // page) in order to look at the objects on the page.
- //
- // It is very important that the caller DOES NOT turn the page until
- // they have finished calling GetNextObject for a given page.
- // Once finished, the current page can be restored to its previous
- // setting by calling RestorePage(), below.
- //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- //
- virtual PMErr GetFirstObject(PMOBJACCFLAGTYPE wantFlags, PMOBJ_REC* pObjRec, SHORT pageNum = -1, char *masterPageName = NULL) = 0;
- // Get the next object on the page.
- // The method returns the object record for the next object on
- // page specified in the call to GetFirstObject(), using the
- // PMOBJACCFLAGTYPE flags also specified in GetFirstObject().
- // If there are no more objects of the given PMOBJACCFLAGTYPE,
- // a CQ_OBJACC_OBJ_NOT_FOUND will be returned as a return code
- // and the fields of the PMOBJ_REC will be zero'ed out.
- //
- virtual PMErr GetNextObject(PMOBJ_REC* pObjRec) = 0;
- // Restore the page setting that the pub to what it was when
- // GetFirstObject was called.
- //
- virtual PMErr RestorePage() = 0;
-
- // Methods for getting and setting info for a given object.
- // Note: The following methods may be called at any time and
- // WILL NOT AFFECT the current state information used for
- // the GetFirstObject/GetNextObject loop!
- //
-
- // Given an object ID, return its object record
- virtual PMErr GetPMObjRecFromObjID(unsigned long objID, PMOBJ_REC* pObjRec) = 0;
- // Return the object ID for the given object
- virtual PMErr GetObjID(PMOBJ_REC* pObjRec, unsigned long *objID) = 0;
- // Return attribute information for given object
- virtual PMErr GetObjAttr(PMOBJ_REC* pObjRec, PMObjAttr* pAttr) = 0;
- // Return fill and line information for given object
- virtual PMErr GetObjFillAndLineInfo(PMOBJ_REC* pObjRec, PMFillAndLineInfo* pFillAndLineInfo) = 0;
- // Return transformation information for given object
- virtual PMErr GetObjTransformInfo(PMOBJ_REC* pObjRec, PMTransformInfo* pTransformInfo) = 0;
- // Return link information for given object
- virtual PMErr GetObjLinkInfo(PMOBJ_REC* pObjRec, PMLinkInfo* pLinkInfo) = 0;
- // Return information about a given inline graphic object
- virtual PMErr GetObjILGInfo(PMOBJ_REC* pILGObjRec, PMILGInfo* pILGInfo) = 0;
-
- // Return the preference memory used by the filter that imported this object.
- // WARNING: PLUGINS MUST CALL FreeObjFilterPrefMem() WHEN FINISHED WITH IT.
- virtual PMErr GetObjFilterPrefMem(PMOBJ_REC* pObjRec, void **ppPrefMem, unsigned long *pdwPrefMemSize) = 0;
- virtual PMErr FreeObjFilterPrefMem() = 0;
-
- // Return an IAdobeVector OLE Interface for the given object
- virtual PMErr OleQueryInterface(PMOBJ_REC* pObjRec, void *riid, void** ppInterface) = 0;
-
- // Return link information for given object
- virtual PMErr GetObjLinkTimeInfo(PMOBJ_REC* pObjRec, PMLinkTimeInfo* pLinkTimeInfo) = 0;
-
- // Given an object record, return the objID of the frame containing
- // this object, if any (if not in frame, *pFrameID == INVAL_OBJID)
- virtual PMErr GetFrameContainingObj(PMOBJ_REC* pObjRec, unsigned long *pFrameID) = 0;
- } ;
-
- #endif // __cplusplus
-
- #endif
-