InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DOMAttributeValue.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Steve Pellegrin
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 
24 #ifndef __DOMAttributeValue_h__
25 #define __DOMAttributeValue_h__
26 
27 // Adobe Patent or Adobe Patent Pending Invention Included Within this File
28 // Adobe patent application tracking B234, entitled Method and apparatus for formatting portion of content, inventors: Craig Rainwater, Steve Pellegrin, Robin Briggs
29 
30 #include "ScriptData.h"
31 
32 class IPMStream;
33 
34 
41 {
42 public:
43  typedef object_type data_type;
44 
45 public:
46  typedef ScriptData::ScriptDataType AttributeType;
47 
48 public:
52 
56  DOMAttributeValue(const WideString &value);
57 
61  DOMAttributeValue(int32 value);
62 
67 
72 
79  DOMAttributeValue(bool16 readOnly, ScriptData sd)
80  : ScriptData(adobe::move(sd)), fReadOnly(readOnly)
81  {
82  }
83 
86  DOMAttributeValue(adobe::move_from<DOMAttributeValue> other)
87  : ScriptData(adobe::move_from<ScriptData>(other.source)),
88  fReadOnly(adobe::move(other.source.fReadOnly))
89  { }
90 
93  virtual ~DOMAttributeValue() {}
94 
98  bool16 IsReadOnly() const { return fReadOnly ; }
99 
103  void SetReadOnly(bool16 readOnly) { fReadOnly = readOnly ; }
104 
108  bool16 IsEmpty() const;
109 
112  friend inline void swap(DOMAttributeValue &lhs, DOMAttributeValue &rhs)
113  {
114  swap(static_cast<ScriptData&>(lhs), static_cast<ScriptData&>(rhs));
115  std::swap(lhs.fReadOnly, rhs.fReadOnly);
116  }
117 
121  inline bool16 operator==(const DOMAttributeValue &other) const
122  {
123  return (*(ScriptData *)this == (ScriptData &)other);
124  }
125 
129  inline bool16 operator!=(const DOMAttributeValue &other) const
130  {return !(*this == other);}
131 
136  { swap(*this, other); return *this; }
137 
142  { swap(static_cast<ScriptData&>(*this), other); return *this; }
143 
144 private:
145  bool16 fReadOnly;
146 };
147 
148 #endif // __DOMAttributeValue_h__