InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CPMDataObject.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 // Common implementation interface for data exchange objects
24 //
25 //========================================================================================
26 
27 #ifndef __CPMDataObject__
28 #define __CPMDataObject__
29 
30 #include "IPMDataObject.h"
31 #include "IFlavorData.h"
32 #include "ISession.h"
33 #include "HelperInterface.h"
34 
35 
36 //========================================================================================
37 // CLASS CPMDataObject
38 //========================================================================================
39 
47 enum eFlavorStreamState
48 {
49  kUnknownState = 0x0000,
50  kOpenAndInitialize = 0x0001,
51  kOpenedState = 0x0002,
52  kCloseAndFinalize = 0x0003
53 };
54 
62 {
63  public:
65  virtual ~CPMDataObject();
66 
67  virtual uint32 GetItemID() const;
68  virtual void SetItemID(uint32 id);
69 #ifdef MACINTOSH
70  virtual PasteboardRef GetPasteboardRef() const;
71  virtual void SetPasteboardRef(PasteboardRef);
72 #endif
73 #ifdef WINDOWS
74  virtual IDataObject* GetOLEItem() const;
75  virtual void SetOLEItem(IDataObject* obj);
76 #endif
77 
79  virtual DataExchangeResponse FlavorExistsWithPriority(ExternalPMFlavor flavor) const;
80 
82  virtual IPMStream* GetStreamForReading(ExternalPMFlavor flavor);
84  virtual IPMStream* GetStreamForWriting(ExternalPMFlavor flavor);
86  virtual void FinishedWithStream(IPMStream*);
87 
88  // Intended use for this item
89  virtual int16 GetUsage() const;
90  virtual void SetUsage(int16);
91 
92  protected:
102  virtual IPMStream* QueryForWritingStream();
103 
107  virtual bool16 CanReadPromisedFlavor(ExternalPMFlavor flavor);
108 
109  protected:
110  uint32 fItemReference;
111  IPMStream* fReadStream;
112  ExternalPMFlavor fReadStreamFlavor;
113  IPMStream* fWriteStream;
114  ExternalPMFlavor fWriteStreamFlavor;
115  int16 fUsage;
116 
117 #ifdef MACINTOSH
118  PasteboardRef fPasteboardRef;
119 #endif
120 #ifdef WINDOWS
121  IDataObject* fCOMDataObject;
122 #endif
123 
124 
125 };
126 
127 
128 #endif