Class: TImportForeignDataQuery

Declaration: ForeignData.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TImportForeignDataQuery provides a simple interface for importing foreign data. It iterates over all of the translators on the system, finds the ones which can handle specified foreign data types, and performs the translation when requested.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TImportForeignDataQuery is intended to be used directly. Clients can also create derived classes which handle imports of higher-level foreign data. For example, when importing a foreign clipboard a client may wish to create a class TImportClipboardQuery which can iterate through the available clipboard types and pass them to AdoptInputData.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

Since TImportForeignDataQuery is intended for use as a transient helper object in functions which need to import foreign data, it is not copyable, assignable, or streamable.

Member Function: TImportForeignDataQuery::TImportForeignDataQuery

  1. TImportForeignDataQuery (TForeignData * adoptInputData)
  2. TImportForeignDataQuery ()

Interface Category:

API.

Purpose:

  1. Creates a TImportForeignDataQuery object for importing the single TForeignData object specified as a parameter.
  2. Default constructor. Creates a TImportForeignDataQuery object with no input specified. This is only useful in when followed by calls to the AdoptInputData member function.

Calling Context:

  1. Called
  2. Called to create a TImportForeignDataQuery with no foreign data source specified. Can also be called by derived class constructors.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImportForeignDataQuery::~TImportForeignDataQuery

virtual ~ TImportForeignDataQuery ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImportForeignDataQuery::AdoptInputData

void AdoptInputData (TForeignData * adoptInputData)

Interface Category:

API.

Purpose:

Adds an additional foreign data source to the inputs available for this query.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImportForeignDataQuery::CopyAvailableTypes

void CopyAvailableTypes (TCollectionOf < TTypeDescription > & types, TMemoryHeap * =0) const

Interface Category:

API.

Purpose:

Returns the types of the scrap items that can be created from the foreign data sources available to this query. If no scrap items can be created, an exception is thrown.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TForeignDataException(kNoTranslator) if there is no translator which can produce a scrap item type from the specified input data. Passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImportForeignDataQuery::CreateScrapItem

TScrapItem * CreateScrapItem (const TTypeDescription & desired, TMemoryHeap * =0) const

Interface Category:

API.

Purpose:

Performs a translation and returns the requested type of scrap item. The desiredType argument must be one of the types returned by CopyAvailableTypes; if not then TForeignDataException::kNoTranslator will be thrown

Calling Context:

You can call this function directly.

Parameters:

Return Value:

A newly-created TScrapItem of the requested type that contains the imported data. The caller is responsible for deleting the scrap item.

Exceptions:

Throws TForeignDataException(kNoTranslator) if there is no translator which can produce the requested scrap item type from the specified input data. Passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.