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

#include <IDataExchangeController.h>

Inheritance diagram for IDataExchangeController:
IPMUnknownCDataExchangeControllerIClipboardControllerIDragDropControllerILibraryScrapController

Public Types

enum  { kDefaultIID = IID_IDATAEXCHANGECONTROLLER }
 

Public Member Functions

virtual void RegisterAllHandlers ()=0
 
virtual IDataExchangeHandlerQueryHandler (const PMFlavor &flavor) const =0
 
virtual IDataExchangeHandlerQueryHandler (const ExternalPMFlavor &fromFlavor, const PMFlavor &toFlavor) const =0
 
virtual IDataExchangeHandlerQueryHandlerForInternalize (DataExchangeResponse &response, const PMFlavor &internalizeToThisFlavor=kNoFlavor) const =0
 
virtual IDataExchangeHandlerQueryActiveHandler () const =0
 
virtual void SetActiveHandler (IDataExchangeHandler *activeHandler)=0
 
virtual ErrorCode FulfillPromise (IPMDataObject *whichItem, const ExternalPMFlavor &whichFlavor) const =0
 
virtual bool16 NeedsToInternalize () const =0
 
virtual IDataBaseGetScrapDataBase () const =0
 
virtual ErrorCode Initialize ()=0
 
virtual bool16 IsValid () const =0
 
virtual void Cleanup ()=0
 
virtual void GetInternalizeableFlavors (OrderedFlavorList &flavorList) const =0
 
virtual bool16 IsClipboardExternal () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IDataExchangeController interface, represents the controlling entity in a data exchange operation, and the common behavior shared by all such controllers

The partial implementation class CDataExchangeController should be used when deriving a new controller type. class CDataExchangeController. Implementations of IDataExchangeController provide the glue between various external data exchange mechanisms (Clipboard, drag drop, OSX services, external databases, etc) and the platform independent data exchange framework within InDesign.

See Also
CDataExchangeController, IDragDropController, IClipboardController, IMacOSXServicesController

Member Function Documentation

virtual void IDataExchangeController::Cleanup ()
pure virtual

Cleanup the controller. Usually called at shutdown Release any referenced handlers and delete the scrap database (or revert it to a pristene state if it persists).

Implemented in ILibraryScrapController, and CDataExchangeController.

virtual ErrorCode IDataExchangeController::FulfillPromise (IPMDataObjectwhichItem,
const ExternalPMFlavor & whichFlavor 
) const
pure virtual

Render the contents of a data item to the given external data format. FulfillPromise is called by the framework in response to an external request for a specific flavor.

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

Implemented in IDragDropController, IClipboardController, and ILibraryScrapController.

virtual void IDataExchangeController::GetInternalizeableFlavors (OrderedFlavorListflavorList) const
pure virtual

Get a list of all internalizeable flavors (compute by iterating over the registered handlers)

FOR INTERNAL USE ONLY **

Implemented in CDataExchangeController.

virtual IDataBase* IDataExchangeController::GetScrapDataBase () const
pure virtual

Return the database . This is the database where the data exchange handlers and thus where the scrap data (used to store the internalized contents of the clipboard, drag/drop, etc.) resides. Note that this is NOT the same as calling GetDataBase on the IDataExchangeController, which will likely return the application database.

Returns
the database used to maintain the "scrap" for this controller

Implemented in CDataExchangeController.

virtual ErrorCode IDataExchangeController::Initialize ()
pure virtual

Initialize the controller and the scrap database

Returns
kSuccess or an error code

Implemented in CDataExchangeController.

virtual bool16 IDataExchangeController::IsClipboardExternal () const
pure virtual

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

Returns
kTrue if external content

Implemented in CDataExchangeController, and IClipboardController.

virtual bool16 IDataExchangeController::IsValid () const
pure virtual

Is the controller in a valid state. Typically IsValid makes sure the controller has been initialized and that the scrap database is OK.

Returns
kTrue if in a valid state

Implemented in CDataExchangeController.

virtual bool16 IDataExchangeController::NeedsToInternalize () const
pure virtual

Is external data waiting to be internalized? This method is useful for clients that would like to peek at the actual data to be pasted/dropped/whatever if it has already been internalized, or is internal data. Internalizing can be expensive and should not be called to give user feedback (i.e. menu enabling, drag feedbacck)

Returns
kTrue if external data is awaiting internalization

Implemented in IDragDropController, IClipboardController, CDataExchangeController, and ILibraryScrapController.

virtual IDataExchangeHandler* IDataExchangeController::QueryActiveHandler () const
pure virtual

Query for the active handler.

Returns
the active handler or nil if one has not been set.

Implemented in CDataExchangeController.

virtual IDataExchangeHandler* IDataExchangeController::QueryHandler (const PMFlavor & flavor) const
pure virtual

Query for the handler for a particular internal flavor (there can only be one handler per flavor)

Parameters
flavorIN which flavor
Returns
the unique handler for this flavor (if present)

Implemented in CDataExchangeController.

virtual IDataExchangeHandler* IDataExchangeController::QueryHandler (const ExternalPMFlavor & fromFlavor,
const PMFlavor & toFlavor 
) const
pure virtual

Query for a handler that can convert a specific external flavor into an internal one

Parameters
fromFlavorIN the source external flavor
toFlavorIN the desired flavor
Returns
the unique handler for toFlavor (if it can perform the desired conversion, nil otherwise)

Implemented in CDataExchangeController.

virtual IDataExchangeHandler* IDataExchangeController::QueryHandlerForInternalize (DataExchangeResponseresponse,
const PMFlavor & internalizeToThisFlavor = kNoFlavor 
) const
pure virtual

Query for the handler best suited to internalize data. Since no context is specified to identify the data to be internalized - this method is overridden in the controller subclasses to apply to the data in the current drag, or clipboard operation.

Parameters
responseOUT the response from the handler best suited to internalize the data
internalizeToThisFlavorIN the desired destination flavor for the data, or kNoFlavor to let the framework choose the best one.
Returns
a handler (if any) capable of performing the internalization.

Implemented in IDragDropController, IClipboardController, CDataExchangeController, and ILibraryScrapController.

virtual void IDataExchangeController::RegisterAllHandlers ()
pure virtual

Register all data exchange handlers, IDataExchangeHandler, for this controller

Implemented in CDataExchangeController.

virtual void IDataExchangeController::SetActiveHandler (IDataExchangeHandleractiveHandler)
pure virtual

Set the active handler. The active handler is usually set for the duration of a data exchange operation

Parameters
activeHandlerIN the handler to become active, or nil to clear the active handler.

Implemented in CDataExchangeController.