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

#include <IDataExchHandlerFlavorHelper.h>

Inheritance diagram for IDataExchangeHandlerFlavorHelper:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDATAEXCHANGEHANDLERFLAVORHELPER }
 

Public Member Functions

virtual DataExchange::eHelperType GetHelperType () const =0
 
virtual DataExchangeResponse CanConvertExternalFlavor (const IDataExchangeHandler *, ExternalPMFlavor fromWhichFlavor) const =0
 
virtual DataExchangeResponse CanProduceExternalFlavor (const IDataExchangeHandler *, ExternalPMFlavor toWhichFlavor) const =0
 
virtual void AddPromisesForExternalize (IDataExchangeHandler *, const IPMDataObject *whichItem, OrderedPromiseList &orderedPromiseList)=0
 
virtual void AddInternalizeableFlavorsToList (const IDataExchangeHandler *, OrderedFlavorList &flavorList) const =0
 
virtual void AddExternalizeableFlavorsToList (const IDataExchangeHandler *, OrderedFlavorList &flavorList) const =0
 
virtual ErrorCode Externalize (IDataExchangeHandler *, IPMDataObject *whichItem, ExternalPMFlavor toWhichFlavor, IPMStream *s)=0
 
virtual ErrorCode Internalize (IDataExchangeHandler *, IPMDataObject *whichItem, ExternalPMFlavor fromWhichFlavor, IPMStream *s)=0
 
virtual void ReorderFlavors (const IDataExchangeHandler *, OrderedFlavorList &)
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

The IDataExchangeHandlerFlavorHelper interface provides extensibility for data exchange handlers.

Data exchange handler extensibility requires the handler be derived from CDataExchangeHandler_Extensible.  

Create a new boss with an IDataExchangeHandlerFlavorHelper implementation combined with a IK2ServiceProvider 

implementation that corresponds to the service ID defined by the extensible handler.



When the framework asks an extensible data exchange handler if it can internalize (or externalize) data, 

the extensible handler then asks each of it's flavor helpers if they could perform the conversion. 

One helper is chosen based on it's willingness to perform the conversion, and in the case of multiple helpers, 

prioritized by helper type and the priority of the flavor they propose to conversion. The extensible handler then 

forwards the subsequent method calls that occur during the conversion to the chosen helper.

See Also
CDataExchangeHandlerFor, CDataExchangeHandler_Extensible, IDataExchangeHandlerFlavorHelper, IK2ServiceProvider

Member Function Documentation

virtual void IDataExchangeHandlerFlavorHelper::AddExternalizeableFlavorsToList (const IDataExchangeHandler,
OrderedFlavorListflavorList 
) const
pure virtual

Get the external flavors that can be produced in Externalize Flavors should be added to the end of the list, in order by quality of the conversion (highest quality first). The helper function AppendFlavorIfUnique should be used.

Parameters
handlerIN handler this helper is associated with
flavorListIN/OUT add flavors to the end of list
virtual void IDataExchangeHandlerFlavorHelper::AddInternalizeableFlavorsToList (const IDataExchangeHandler,
OrderedFlavorListflavorList 
) const
pure virtual

Get the external flavors that can be converted during Internalize Flavors should be added to the end of the list, in order by quality of the conversion (highest quality first). The helper function AppendFlavorIfUnique should be used.

Parameters
handlerIN handler this helper is associated with
flavorListIN/OUT add flavors to the end of list
virtual void IDataExchangeHandlerFlavorHelper::AddPromisesForExternalize (IDataExchangeHandler,
const IPMDataObjectwhichItem,
OrderedPromiseListorderedPromiseList 
)
pure virtual

Add promises for flavors that can be produced externalization promises (for clipboard , drag/drop, services, etc). Promised should be added to the end of the list, in order by quality of the conversion. Override handlers may also reorder exiting items and/or remove previously added promises at this time. The helper function AppendPromiseIfUnique should be used.

Parameters
handlerIN handler this helper is associated with
whichItemIN item the flavors will be added to (not not here)
orderedPromiseListIN/OUT add promises to the end of list
virtual DataExchangeResponse IDataExchangeHandlerFlavorHelper::CanConvertExternalFlavor (const IDataExchangeHandler,
ExternalPMFlavor fromWhichFlavor 
) const
pure virtual

Can this helper convert the given external flavor to the handlers native type?

Parameters
handlerIN handler this helper is associated with
fromWhichFlavorIN the external flavor to be converted
Returns
response containing kTrue/False, plus and additional conversion information (flags, priority)
virtual DataExchangeResponse IDataExchangeHandlerFlavorHelper::CanProduceExternalFlavor (const IDataExchangeHandler,
ExternalPMFlavor toWhichFlavor 
) const
pure virtual

Can this helper produce the given external flavor from the handlers native type?

Parameters
handlerIN handler this helper is associated with
toWhichFlavorIN the external flavor to be produced
Returns
response containing kTrue/False, plus and additional conversion information (flags, priority)
virtual ErrorCode IDataExchangeHandlerFlavorHelper::Externalize (IDataExchangeHandler,
IPMDataObjectwhichItem,
ExternalPMFlavor toWhichFlavor,
IPMStreams 
)
pure virtual

Externalize the contents into the given flavor on a stream (for clipboard and drag/drop).

Parameters
handlerIN handler this helper is associated with
whichItemIN item the data is associated with
toWhichFlavorIN the type of flavor data to write on the stream
sIN stream on which to write the data
Returns
kSuccess or error code in case of failure
virtual DataExchange::eHelperType IDataExchangeHandlerFlavorHelper::GetHelperType () const
pure virtual

Return the type or priority of the helper. This is used to resolve conflicts that can arise when more than one handler flavor helper is capable of responding to a request. The presence of multiple helpers is not a conflict, a conflict would arise when one helper wants to replace or augment what another helper already does.

Returns
helper type appropriate for this helper. Use DataExchange::kDefaultHelper by default.
virtual ErrorCode IDataExchangeHandlerFlavorHelper::Internalize (IDataExchangeHandler,
IPMDataObjectwhichItem,
ExternalPMFlavor fromWhichFlavor,
IPMStreams 
)
pure virtual

Internalize the contents of a stream as the given flavor (for clipboard or drag/drop).

Parameters
handlerIN handler this helper is associated with
whichItemIN item the data is associated with
fromWhichFlavorIN the type of flavor data in on the stream
sIN stream from which to read the data
Returns
kSuccess or error code in case of failure
virtual void IDataExchangeHandlerFlavorHelper::ReorderFlavors (const IDataExchangeHandler,
OrderedFlavorList 
)
inlinevirtual

kOverrideFlavorPriorityHelpers Only: Prior to Internalizing, these helpers are given an opportunity to reorder the available flavors advertised by the data exchange handler this helper is associated with. Reordering should be limited to reordering similar flavors (ie. to put PDF before PICT, or RFT before TEXT).

Parameters
handlerIN handler this helper is associated with
flavorListIN/OUT flavorlist to manipulate