InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CDataExchHandler_Extensible.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //
23 // base class implementation for extensible DataExchangeHandlers
24 //
25 //========================================================================================
26 
27 #ifndef __CDataExchangeHandler_Extensible__
28 #define __CDataExchangeHandler_Extensible__
29 
30 #include "IDataExchangeHandler.h"
31 #include "PMFlavorTypes.h"
32 #include "HelperInterface.h"
33 
34 #include "IDataExchHandlerFlavorHelper.h"
35 
36 
44 {
45  public:
48 
49  public:
50  // ----- Initialization
51  virtual void CreateScrapStorage() = 0;
52  // Call this to create storage for the scrap in a new database.
53 
54  // ----- Extensibility
55  virtual ServiceID GetDEHandlerHelperServiceID() const = 0;
56 
57  // ----- Abilities
61  enum eActionType {kInternalizeFlavorAction, kExternalizeFlavorAction};
62 
63  public:
64  virtual void Clear() = 0;
65  virtual bool16 IsEmpty() const = 0;
66 
67  // Return the Internal flavor (data type) this handler deals with.
68  virtual PMFlavor GetFlavor() const = 0;
69 
76  virtual DataExchangeResponse CanInternalizeData(IPMDataObject* whichItem) const;
78  virtual bool16 CanConvertExternalFlavor(ExternalPMFlavor fromWhichFlavor) const;
80  virtual void AddInternalizeableFlavorsToList(OrderedFlavorList& flavorList) const;
82  virtual void AddExternalizeableFlavorsToList(OrderedFlavorList& flavorList) const;
83 
84  // ----- Conversion to platform data exchange
85  public:
87  virtual ErrorCode ExternalizePromises(IPMDataObject* whichItem);
89  virtual ErrorCode Externalize(IPMDataObject* whichItem, ExternalPMFlavor toWhichFlavor, IPMStream* s);
91  virtual ErrorCode Internalize(IPMDataObject* whichItem);
93  virtual ErrorCode Internalize(IPMDataObject* whichItem, ExternalPMFlavor fromWhichFlavor, IPMStream* s);
95 
96  protected:
98  ErrorCode Delegate_ExternalizePromises(IPMDataObject* whichItem, OrderedPromiseList& orderedPromiseList);
99 
103  IDataExchangeHandlerFlavorHelper* QueryHelper_ForAction(eActionType action, ExternalPMFlavor whichFlavor, DataExchangeResponse& bestHelperResponse) const;
104 
105  private:
106 
107 };
108 
109 
110 #endif