![]() | InDesign SDK 20.5 |
#include <IClipboardController.h>

Public Types | |
| enum | { kDefaultIID = IID_ICLIPBOARDCONTROLLER } |
Public Member Functions | |
| IClipboardController (IPMUnknown *boss) | |
| virtual IDataExchangeHandler * | QueryActiveScrapHandler () const =0 |
| virtual void | SetActiveScrapHandler (IDataExchangeHandler *activeHandler)=0 |
| virtual bool16 | IsClipboardExternal () const =0 |
| virtual void | SetIsClipboardExternal (bool16 isClipboardExternal=kTrue)=0 |
| virtual ErrorCode | FulfillPromise (IPMDataObject *whichItem, const ExternalPMFlavor &whichFlavor) const =0 |
| virtual void | SetShouldExternalize (bool16 should=kTrue)=0 |
| virtual ErrorCode | Externalize () const =0 |
| virtual void | SetShouldInternalize (bool16 should=kTrue)=0 |
| virtual bool16 | NeedsToInternalize () const =0 |
| virtual ErrorCode | Internalize ()=0 |
| virtual bool16 | GetPreferredClipboardFlavor (ExternalPMFlavor &preferredFlavor)=0 |
| virtual IDataExchangeHandler * | QueryHandlerForInternalize (DataExchangeResponse &response, const PMFlavor &internalizedFlavor=kNoFlavor) const =0 |
| virtual ErrorCode | PrepareForCopy ()=0 |
| virtual ErrorCode | CopyHasCompleted ()=0 |
| virtual bool16 | IsExternalizeInProgress () const =0 |
| virtual bool16 | IsCutOperation () const =0 |
| virtual void | SetCutOperation (bool16 isCut)=0 |
| virtual PMString | GetClipboardsContentSourceApp () const =0 |
Public Member Functions inherited from CDataExchangeController | |
| CDataExchangeController (IPMUnknown *boss) | |
| virtual void | ReadWrite (IPMStream *s, ImplementationID prop) |
| virtual void | RegisterAllHandlers () |
| virtual bool16 | RegisterDataHandler (ClassID dataClass) |
| virtual IDataExchangeHandler * | NewDataHandler (ClassID dataClass) const |
| virtual IDataExchangeHandler * | QueryHandler (const PMFlavor &scrapFlavor) const |
| virtual IDataExchangeHandler * | QueryHandler (const ExternalPMFlavor &fromFlavor, const PMFlavor &toFlavor) const |
| virtual void | GetInternalizeableFlavors (OrderedFlavorList &flavorList) const |
| virtual IDataExchangeHandler * | QueryActiveHandler () const |
| virtual void | SetActiveHandler (IDataExchangeHandler *activeHandler) |
| virtual IDataBase * | GetScrapDataBase () const |
| virtual ErrorCode | Initialize () |
| virtual bool16 | IsValid () const |
| virtual void | Cleanup () |
| virtual void | Purge (int32 level) |
| void | AllowPurge () |
| void | DisallowPurge () |
| bool | PurgeIsAllowed () const |
Additional Inherited Members | |
Static Public Member Functions inherited from CDataExchangeController | |
| static void | Purge (int32 level, void *refPtr) |
Protected Member Functions inherited from CDataExchangeController | |
| virtual IDataExchangeHandler * | QueryHandlerToInternalizeData (IPMDataObject *whichItem, DataExchangeResponse &response, const PMFlavor &toFlavor) const |
| virtual IDataExchangeHandler * | QueryHandlerToInternalizeData (DataObjectIterator &dataIter, DataExchangeResponse &response, const PMFlavor &toFlavor) const |
| virtual ClassID | GetScrapDocBossID () const |
| virtual PMString | GetScrapDBFileName () const =0 |
| virtual IDataBase * | CreateDataBase () const =0 |
| virtual void | ResetMagicBytes () const =0 |
| virtual ErrorCode | InitializeScrap () |
| virtual ErrorCode | RevertScrap () |
| virtual void | RunNewScrapResponders () |
| IDataExchangeHandler * | GetActiveHandler () const |
| virtual IDataExchangeHandler * | QueryCachedHandler () const |
| virtual void | SetCachedHandler (IDataExchangeHandler *handlerToCache) |
Protected Attributes inherited from CDataExchangeController | |
| bool16 | fInitialized |
| ErrorCode | fInitializationErrorCode |
| IDataBase * | fScrapDB |
| UID | fScrapDocID |
| bool16 | fScrapDBFailed |
| IPMUnknown * | fRoot |
| int32 | fAllowPurge |
| bool16 | fDataHandlersRegistered |
| K2Vector < DataExchangeHandlerEntry > | fDataHandlers |
| IDataExchangeHandler * | fActiveHandler |
| IDataExchangeHandler * | fCachedHandler |
IClipboardController interface, represents the controlling entity in a drag drop operation.
IClipboardController is derived from IDataExchangeController by way of the partial implementation class CDataExchangeController. Implementations of IClipboardController provide the glue between the platform dependent clipboard (OLE and Mac OS X) and the platform independent framework presented by InDesign.
| pure virtual |
Should be called at the conclusion of Copy or Cut operations. This is used to make data promises to the external clipboard under Carbon/OS X. On Win this is done at kSuspend time, but Carbon/OS X disallows this.
| pure virtual |
Make all necessary flavor promises available to the external clipboard. This makes the promises visible to other applications, and should be done on application context switch.
| pure virtual |
Render the contents of the internal clipboard out to the platform clipboard. FulfillPromise is called by the data exchange framework in response a flavor data request from an external application. Internally it sets up a PMFlavorStream and calls the active handler to externalize the flavor to the stream.
| whichItem | IN the IPMDataObject representing the clipboard data. |
| whichFlavor | IN which flavor to provide data for |
Implements IDataExchangeController.
| pure virtual |
Returns the name of source app for current clipboard content Implementation is done on Win only.
| pure virtual |
Return the preferred flavor of the contents of the external clipboard. Based on the convention of promising the preferred flavor first.
| preferredFlavor | OUT the first (preferred) flavor in the platform clipboard |
| pure virtual |
Render the contents of the external clipboard into the scrap database. This makes it possible to paste something into our app that was copied from another application. This should only be called when paste is actually called.
| pure virtual |
Get is the data on clipboard from external source or and internal copy from InDesign
Reimplemented from CDataExchangeController.
| pure virtual |
Returns whether a Cut operation is underway or not. Helps distinguish between a Cut and a Copy for some clients.
| pure virtual |
Return whether externalization to the external clipboard is already in progress.
| pure virtual |
Do we need to internalize pending external (platform) clipboard data? This method is useful for IScrapSuite::CanPaste and similar methods that would like to peek at the actual data to be pasted if it has already been internalized, or is internal data. Internalizing can be expensive and should not be called during menu enabling methods.
Implements CDataExchangeController.
| pure virtual |
Should be called in the preamble to Copy or Cut operations. This is used to empty out the internal clipboard (and the external clipboard under Carbon) Since this also has the effect of calling SetShouldInternalize(kFalse), it should not be called prior to calling Internalize().
| pure virtual |
Use QueryActiveHandler instead (should be deprecated).
| pure virtual |
Determine which data exchange handler could best handle the data on the clipboard. By passing a specific internal flavor, you are asking if the data on the clipboard can be converted into that flavor. By passing kNoFlavor, the controller will instead find the first handler which recognizes the data on the clipboard, regardless of the flavor of object it creates.
| response | OUT response from the data exchange handler |
| internalizedFlavor | IN the preferred internal flavor (native format) if data needs to be converted. |
Implements CDataExchangeController.
| pure virtual |
Use SetActiveHandler instead (should be deprecated). Note: SetActiveHandler/SetActiveScrapHandler can be called from IScrapSuite::CanCopy/Copy but is not appropriate during IScrapSuite::CanPaste/Paste - since Internalize may have already occurred. Calling SetActiveHandler would then effectively lose the already internalized data.
| pure virtual |
Sets whether a Cut operation is underway or not. Helps distinguish between a Cut and a Copy for some clients. Most clients will not need to call this.
| pure virtual |
Set isClipboardExternal flag to false whenever copy is initiated from InDesign FOR INTERNAL USE ONLY **
| pure virtual |
Advise framework as to whether the internal clipboard needs to be externalized. This is called when a copy or cut operation changes the internal clipboard, and also when an internalize call makes externalization unnecessary.
| pure virtual |
Advise framework as to whether the platform clipboard needs to be internalized. This is called when the platform clipboard has changed from when we last internalized it, and also when an internalize call makes externalization unnecessary. This is called when switching into our app from another application, and when a local copy or cut operation overrides the need to internalize