InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IClipboardController Class Referenceabstract

#include <IClipboardController.h>

Inheritance diagram for IClipboardController:
CDataExchangeControllerIDataExchangeControllerIPMUnknown

Public Types

enum  { kDefaultIID = IID_ICLIPBOARDCONTROLLER }
 

Public Member Functions

 IClipboardController (IPMUnknown *boss)
 
virtual IDataExchangeHandlerQueryActiveScrapHandler () 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 IDataExchangeHandlerQueryHandlerForInternalize (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 IDataExchangeHandlerNewDataHandler (ClassID dataClass) const
 
virtual IDataExchangeHandlerQueryHandler (const PMFlavor &scrapFlavor) const
 
virtual IDataExchangeHandlerQueryHandler (const ExternalPMFlavor &fromFlavor, const PMFlavor &toFlavor) const
 
virtual void GetInternalizeableFlavors (OrderedFlavorList &flavorList) const
 
virtual IDataExchangeHandlerQueryActiveHandler () const
 
virtual void SetActiveHandler (IDataExchangeHandler *activeHandler)
 
virtual IDataBaseGetScrapDataBase () 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 IDataExchangeHandlerQueryHandlerToInternalizeData (IPMDataObject *whichItem, DataExchangeResponse &response, const PMFlavor &toFlavor) const
 
virtual IDataExchangeHandlerQueryHandlerToInternalizeData (DataObjectIterator &dataIter, DataExchangeResponse &response, const PMFlavor &toFlavor) const
 
virtual ClassID GetScrapDocBossID () const
 
virtual PMString GetScrapDBFileName () const =0
 
virtual IDataBaseCreateDataBase () const =0
 
virtual void ResetMagicBytes () const =0
 
virtual ErrorCode InitializeScrap ()
 
virtual ErrorCode RevertScrap ()
 
virtual void RunNewScrapResponders ()
 
IDataExchangeHandlerGetActiveHandler () const
 
virtual IDataExchangeHandlerQueryCachedHandler () const
 
virtual void SetCachedHandler (IDataExchangeHandler *handlerToCache)
 
- Protected Attributes inherited from CDataExchangeController
bool16 fInitialized
 
ErrorCode fInitializationErrorCode
 
IDataBasefScrapDB
 
UID fScrapDocID
 
bool16 fScrapDBFailed
 
IPMUnknownfRoot
 
int32 fAllowPurge
 
bool16 fDataHandlersRegistered
 
K2Vector
< DataExchangeHandlerEntry
fDataHandlers
 
IDataExchangeHandlerfActiveHandler
 
IDataExchangeHandlerfCachedHandler
 

Detailed Description

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.

See Also
IDataExchangeController, CDataExchangeController

Member Function Documentation

virtual ErrorCode IClipboardController::CopyHasCompleted ()
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.

virtual ErrorCode IClipboardController::Externalize () const
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.

virtual ErrorCode IClipboardController::FulfillPromise (IPMDataObjectwhichItem,
const ExternalPMFlavor & whichFlavor 
) const
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.

Parameters
whichItemIN the IPMDataObject representing the clipboard data.
whichFlavorIN which flavor to provide data for
Returns
kSuccess or an error code

Implements IDataExchangeController.

virtual PMString IClipboardController::GetClipboardsContentSourceApp () const
pure virtual

Returns the name of source app for current clipboard content Implementation is done on Win only.

virtual bool16 IClipboardController::GetPreferredClipboardFlavor (ExternalPMFlavor & preferredFlavor)
pure virtual

Return the preferred flavor of the contents of the external clipboard. Based on the convention of promising the preferred flavor first.

Parameters
preferredFlavorOUT the first (preferred) flavor in the platform clipboard
Returns
kTrue if a flavor was returned, kFalse otherwise (empty clipboard, etc.)
virtual ErrorCode IClipboardController::Internalize ()
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.

virtual bool16 IClipboardController::IsClipboardExternal () const
pure virtual

Get is the data on clipboard from external source or and internal copy from InDesign

Returns
kTrue if external content

Reimplemented from CDataExchangeController.

virtual bool16 IClipboardController::IsCutOperation () const
pure virtual

Returns whether a Cut operation is underway or not. Helps distinguish between a Cut and a Copy for some clients.

virtual bool16 IClipboardController::IsExternalizeInProgress () const
pure virtual

Return whether externalization to the external clipboard is already in progress.

virtual bool16 IClipboardController::NeedsToInternalize () const
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.

virtual ErrorCode IClipboardController::PrepareForCopy ()
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().

virtual IDataExchangeHandler* IClipboardController::QueryActiveScrapHandler () const
pure virtual

Use QueryActiveHandler instead (should be deprecated).

virtual IDataExchangeHandler* IClipboardController::QueryHandlerForInternalize (DataExchangeResponseresponse,
const PMFlavor & internalizedFlavor = kNoFlavor 
) const
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.

Parameters
responseOUT response from the data exchange handler
internalizedFlavorIN the preferred internal flavor (native format) if data needs to be converted.
Returns
the handler (if any) that can provide the requested conversion.

Implements CDataExchangeController.

virtual void IClipboardController::SetActiveScrapHandler (IDataExchangeHandleractiveHandler)
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.

virtual void IClipboardController::SetCutOperation (bool16 isCut)
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.

virtual void IClipboardController::SetIsClipboardExternal (bool16 isClipboardExternal = kTrue)
pure virtual

Set isClipboardExternal flag to false whenever copy is initiated from InDesign FOR INTERNAL USE ONLY **

virtual void IClipboardController::SetShouldExternalize (bool16 should = kTrue)
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.

virtual void IClipboardController::SetShouldInternalize (bool16 should = kTrue)
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