InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DataExchangeHandlerEntry.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 // Handler entry used by clipboard and drag drop
24 //
25 //========================================================================================
26 
27 #ifndef __DataExchangeHandlerEntry__
28 #define __DataExchangeHandlerEntry__
29 
30 #include "PMFlavorTypes.h"
31 
32 #include "HelperInterface.h"
33 
34 //========================================================================================
35 // Class DataExchangeHandlerEntry
36 //========================================================================================
43 {
44  // ----- Constructors/desctructors
45  public:
46  typedef base_type data_type;
49  DataExchangeHandlerEntry(PMFlavor type, ClassID handlerClassId, UID handlerId);
50 
51  // ----- Operators
52  public:
53  DataExchangeHandlerEntry& operator=(const DataExchangeHandlerEntry& other);
54  bool16 operator==(const DataExchangeHandlerEntry& other) const;
55 
56  // ----- Accessors
57  public:
58  void SetHandlerId(UID uid);
59  void SetFlavor(PMFlavor f);
60 
61  PMFlavor GetFlavor() const;
62  ClassID GetHandlerClassId() const;
63  UID GetHandlerId() const;
64 
65  // ----- Object state
66  private:
67  PMFlavor fFlavor;
68  ClassID fHandlerClassId;
69  UID fHandlerId;
70 };
71 
72 
73 //----------------------------------------------------------------------------------------
74 // DataExchangeHandlerEntry constructor
75 //----------------------------------------------------------------------------------------
76 inline DataExchangeHandlerEntry::DataExchangeHandlerEntry() :
77  fFlavor(0),
78  fHandlerClassId(kInvalidClass),
79  fHandlerId(kInvalidUID)
80 {
81 }
82 
83 inline DataExchangeHandlerEntry::DataExchangeHandlerEntry(const DataExchangeHandlerEntry& other) :
84  fFlavor(other.fFlavor),
85  fHandlerClassId(other.fHandlerClassId),
86  fHandlerId(other.fHandlerId)
87 {
88 }
89 
90 inline DataExchangeHandlerEntry::DataExchangeHandlerEntry(PMFlavor type, ClassID handlerClassId, UID handlerId = kInvalidUID) :
91  fFlavor(type),
92  fHandlerClassId(handlerClassId),
93  fHandlerId(handlerId)
94 {
95 }
96 
97 //----------------------------------------------------------------------------------------
98 // operator=
99 //----------------------------------------------------------------------------------------
100 inline DataExchangeHandlerEntry& DataExchangeHandlerEntry::operator=(const DataExchangeHandlerEntry& other)
101 {
102  if (this != &other)
103  {
104  fFlavor = other.fFlavor;
105  fHandlerClassId = other.fHandlerClassId;
106  fHandlerId = other.fHandlerId;
107  }
108 
109  return *this;
110 }
111 
112 //----------------------------------------------------------------------------------------
113 // operator==
114 //----------------------------------------------------------------------------------------
115 inline bool16 DataExchangeHandlerEntry::operator==(const DataExchangeHandlerEntry& other) const
116 {
117  return fFlavor == other.fFlavor && fHandlerClassId == other.fHandlerClassId && fHandlerId == other.fHandlerId;
118 }
119 
120 //----------------------------------------------------------------------------------------
121 // SetHandlerId
122 //----------------------------------------------------------------------------------------
123 inline void DataExchangeHandlerEntry::SetHandlerId(UID uid)
124 {
125  fHandlerId = uid;
126 }
127 
128 //----------------------------------------------------------------------------------------
129 // GetFlavor
130 //----------------------------------------------------------------------------------------
131 inline PMFlavor DataExchangeHandlerEntry::GetFlavor() const
132 {
133  return fFlavor;
134 }
135 
136 //----------------------------------------------------------------------------------------
137 // SetFlavor
138 //----------------------------------------------------------------------------------------
139 inline void DataExchangeHandlerEntry::SetFlavor(PMFlavor f)
140 {
141  fFlavor = f;
142 }
143 
144 //----------------------------------------------------------------------------------------
145 // GetHandlerId
146 //----------------------------------------------------------------------------------------
147 inline ClassID DataExchangeHandlerEntry::GetHandlerClassId() const
148 {
149  return fHandlerClassId;
150 }
151 
152 //----------------------------------------------------------------------------------------
153 // GetHandlerId
154 //----------------------------------------------------------------------------------------
155 inline UID DataExchangeHandlerEntry::GetHandlerId() const
156 {
157  return fHandlerId;
158 }
159 
160 #endif