InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BPIDataPersist Class Reference
Inheritance diagram for BPIDataPersist:
CPMUnknown< IBPIData >IBPIDataIPMUnknown

Public Member Functions

 BPIDataPersist (IPMUnknown *boss)
 
virtual const WideStringGet ()
 
virtual void Set (const WideString &value)
 
void ReadWrite (IPMStream *stream, ImplementationID implementation)
 
- Public Member Functions inherited from CPMUnknown< IBPIData >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Public Types inherited from IBPIData
enum  { kDefaultIID = IID_IBPIDATA }
 
- Protected Member Functions inherited from CPMUnknown< IBPIData >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IBPIData >
HelperInterface fHelperInterface
 

Detailed Description

Persistent implementation of IBPIData used by clients who need to store the value in documents and other kinds of databases.

Constructor & Destructor Documentation

BPIDataPersist::BPIDataPersist (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.

Member Function Documentation

const WideString & BPIDataPersist::Get ()
virtual

See IBPIData.

Implements IBPIData.

void BPIDataPersist::ReadWrite (IPMStreamstream,
ImplementationID implementation 
)

Because this is a persistent interface, it must support the ReadWrite method. This method is used for both writing information out to the database and reading information in from the database.

Note: the first thing we read/write here is a version number. It is used to identify which plug-in is used to write out this BPI data. Since this is the first version of the BPI plug-in, thus the version number is 1, and then followed by the BPI data. Later if there is a newer version of this plug-in which will write out an extra field of data, then we can just come to this routine, and check the version number of the doc, and then read in the data accordingly. this will make sure the newer plug-in is backward compatible with an older version of document. Lastly, since the version number should be the first thing to read in for this interface, all the new data should be append at the bottom.

Parameters
streamcontains the stream to be written or read.
implementationthe implementation ID.
void BPIDataPersist::Set (const WideStringvalue)
virtual

See IBPIData.

Implements IBPIData.