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

#include <IPMDataObject.h>

Inheritance diagram for IPMDataObject:
IPMUnknownCPMDataObject

Public Types

enum  { kDefaultIID = IID_IPMDATAOBJECT }
 
enum  { kUnspecifiedUsage = -1, kInternalizeUsage = 0, kExternalizeUsage = 1 }
 

Public Member Functions

virtual void PromiseFlavor (ExternalPMFlavor newFlavor, PMFlavorFlags flavorFlags=kNormalFlavorFlag)=0
 
virtual uint32 GetItemID () const =0
 
virtual void SetItemID (uint32 id)=0
 
virtual uint16 CountFlavors () const =0
 
virtual K2Vector
< ExternalPMFlavor > * 
GetPromisedFlavors () const =0
 
virtual bool16 FlavorExists (ExternalPMFlavor requestedFlavor) const =0
 
virtual DataExchangeResponse FlavorExistsWithPriority (ExternalPMFlavor flavor) const =0
 
virtual uint32 GetSizeOfFlavorData (ExternalPMFlavor flavor) const =0
 
virtual IPMStreamGetStreamForReading (ExternalPMFlavor flavor)=0
 
virtual IPMStreamGetStreamForWriting (ExternalPMFlavor flavor)=0
 
virtual void FinishedWithStream (IPMStream *)=0
 
virtual int16 GetUsage () const =0
 
virtual void SetUsage (int16)=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

Interface used to represent the data in a data exchange operation.

Subclassed to handle communication with platform data exchange frameworks.

Subclasses should derive from the shared implementation class CPMDataObject.

On Win WPMDataObject represents all OLE based data exchange,

while for the Mac there are separate MDragDropObject and MClipboardDataObject implementations.

Member Enumeration Documentation

anonymous enum

Intended use for this item.
Enumerator
kUnspecifiedUsage 

default

kInternalizeUsage 

use to Internalize external data

kExternalizeUsage 

use to Externalize internal data

Member Function Documentation

virtual uint16 IPMDataObject::CountFlavors () const
pure virtual

Get the count of promised flavors.

Returns
the count
virtual void IPMDataObject::FinishedWithStream (IPMStream)
pure virtual

Framework call signifying that the stream is no longer needed

Parameters
IPMStream*INOUT DESCRIPTION
Precondition
DESCRIPTION
Postcondition
DESCRIPTION

Implemented in CPMDataObject.

virtual bool16 IPMDataObject::FlavorExists (ExternalPMFlavor requestedFlavor) const
pure virtual

Does this item support the requested flavor

Parameters
requestedFlavorIN the flavor of interest
Returns
whether the specified flavor was promised
virtual DataExchangeResponse IPMDataObject::FlavorExistsWithPriority (ExternalPMFlavor flavor) const
pure virtual

Does this item support the requested flavor - if true, also returns the priority and flavor flags. Priority is determined by the order in which flavors are added to an item: highest are first, lowest are last.

Parameters
flavorIN the flavor of interest
Returns
data exchange response

Implemented in CPMDataObject.

virtual uint32 IPMDataObject::GetItemID () const
pure virtual

Get the unique item id (unique within a single data exchange operation).

Returns
the item id

Implemented in CPMDataObject.

virtual K2Vector<ExternalPMFlavor>* IPMDataObject::GetPromisedFlavors () const
pure virtual

Get the list of promised flavors

Returns
pointer to an internally cached list of promised flavors
virtual uint32 IPMDataObject::GetSizeOfFlavorData (ExternalPMFlavor flavor) const
pure virtual

Get the size, in bytes, of the data associated with a flavor NOTE: if called for a promised flavor, it will trigger the promise to be fulfilled. This can be time consuming.

Parameters
flavorIN the flavor of interest
Precondition
the presence of the flavor should be verified first
Returns
length in bytes of the flavor data
virtual IPMStream* IPMDataObject::GetStreamForReading (ExternalPMFlavor flavor)
pure virtual

Get a stream that can be used to read flavor data from the object. Called by the framework, clients are usually passed a stream when necessary.

Parameters
flavorIN the flavor of interest
Precondition
the presence of the flavor should be verified first
Returns
readable stream

Implemented in CPMDataObject.

virtual IPMStream* IPMDataObject::GetStreamForWriting (ExternalPMFlavor flavor)
pure virtual

Get a stream that can be used to write flavor data to the object Called by the framework, clients are usually passed a stream when necessary.

Parameters
flavorIN the flavor of interest
Precondition
the presence of the flavor should be verified first
Returns
DESCRIPTION

Implemented in CPMDataObject.

virtual int16 IPMDataObject::GetUsage () const
pure virtual

Framework call to get the intended use for this item

Returns
one of kUnspecifiedUsage, kInternalizeUsage, or kExternalizeUsage

Implemented in CPMDataObject.

virtual void IPMDataObject::PromiseFlavor (ExternalPMFlavor newFlavor,
PMFlavorFlags flavorFlags = kNormalFlavorFlag 
)
pure virtual

Add a flavor to the item as a promise.

Parameters
newFlavorIN flavor to add
flavorFlagsIN flavor flags, if any
Precondition
DESCRIPTION
Postcondition
DESCRIPTION
virtual void IPMDataObject::SetItemID (uint32 id)
pure virtual

Framework call to set the unique item id (unique within a single data exchange operation).

Parameters
idIN the id of the item

Implemented in CPMDataObject.

virtual void IPMDataObject::SetUsage (int16 )
pure virtual

Framework call to set the intended use for this item

Parameters
int16IN one of kUnspecifiedUsage, kInternalizeUsage, or kExternalizeUsage

Implemented in CPMDataObject.