InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IIDXMLElement.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: robin briggs
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 __IIDXMLElement__
25 #define __IIDXMLElement__
26 
27 #include "K2Iterator.h"
28 #include "TextRange.h"
29 #include "XMLContentReference.h"
30 #include "XMLID.h"
31 #include "XMLReference.h" // for LSID
32 
33 #include "IPMUnknown.h"
34 
35 
36 typedef int32 LayoutSelector;
37 const LayoutSelector kStandardLayout = 1;
38 
39 
40 class ITextStoryThread;
41 class XMLContentIterator;
42 class XMLDTDInsertElementList;
43 class XMLDTDReplaceElementList;
44 
57 class IIDXMLElement : public IPMUnknown {
58 public:
59  enum { kDefaultIID = IID_IIDXMLELEMENT };
60 
62  enum _Placement { kEndIndex = -2 };
63 
64  // Typedefs for content iteration
74  typedef const value_type* pointer;
76  typedef const value_type* const_pointer;
78  typedef const value_type& reference;
80  typedef const value_type& const_reference;
85 
90  virtual const XMLReference& GetXMLReference() const = 0;
91 
95  virtual void SetXMLReference(const XMLReference& newXMLRef) = 0;
96 
101  virtual int32 GetChildCount() const = 0;
102 
107  virtual XMLReference GetNthChild(int32) const = 0;
108 
113  virtual const XMLReference& GetParent() const = 0;
114 
115 
121  virtual void SetParent(const XMLReference& newParent) = 0;
122 
128  virtual XMLReference FindChild(const WideString& tag, int32 index) const = 0;
129 
135  virtual int32 FindChild(const XMLReference& childToFind) const = 0;
136 
137 
143  virtual void AddChildAt(const XMLReference& newChild, int32 indexAt, bool16 setChildsParent = kTrue) = 0;
144 
145 
150  virtual void RemoveChild(const XMLReference& childToRemove, bool16 resetChild = kTrue) = 0;
151 
158  virtual void RemoveChild(int32 indexAt, bool16 resetChild = kTrue) = 0;
159 
164  virtual void SetChildAt(const XMLReference& newChildXMLRef, int32 indexAt) = 0;
165 
166 
172  virtual UID GetTagUID() const = 0;
173 
178  virtual WideString GetTagString() const = 0;
179 
185  virtual void SetTag(UID newTag) = 0;
186 
191  virtual void SetTag(const WideString& newTag) = 0;
192 
197  virtual UID GetContentItem(LayoutSelector selector = kStandardLayout) const = 0;
198 
203  virtual void SetContentItem(UID contentItem, LayoutSelector selector = kStandardLayout) = 0;
204 
208  virtual const XMLContentReference& GetContentReference(void) const = 0;
209 
213  virtual void SetContentReference(const XMLContentReference& contentReference) = 0;
214 
218  virtual ITextStoryThread *QueryContentTextStoryThread(void) const = 0;
219 
225  virtual void AddAttribute(const WideString& name, const WideString& value, bool16 removable = kTrue) = 0;
226 
230  virtual void RemoveAttribute(const WideString& name) = 0;
231 
237  virtual void SetAttributeName(const WideString& name, const WideString& newName) = 0;
238 
245  virtual void SetAttributeValue(const WideString& name, const WideString& newValue) = 0;
246 
247 
252  virtual int32 GetAttributeCount() const = 0;
253 
258  virtual bool16 HasAttribute(const WideString& name) const = 0;
259 
264  virtual WideString GetAttributeNameAt(int32 pos) const = 0;
265 
276  virtual WideString GetAttributeValue(const WideString& name) const = 0;
277 
282  virtual WideString GetAttributeValueAt(int32 pos) const = 0;
283 
288  virtual bool16 IsAttributeRemovable(const WideString& name) const = 0;
289 
290 
294  virtual const_iterator begin() const = 0;
295 
299  virtual const_iterator end() const = 0;
300 
307  virtual const_iterator make_iterator(int32 position) const = 0;
308 
309 
313  virtual const_reverse_iterator rbegin() const = 0;
314 
318  virtual const_reverse_iterator rend() const = 0;
319 
324  virtual const_reverse_iterator rmake_iterator(int32 position) const = 0;
325 
330  virtual void GetInsertChildElementList(XMLDTDInsertElementList& childElementList) const = 0;
331 
336  virtual void GetInsertSiblingAfterList(XMLDTDInsertElementList& siblingAfterList) const = 0;
337 
341  virtual void GetReplaceElementList(XMLDTDReplaceElementList& replaceElementList) const = 0;
342 };
343 
344 
345 #endif // __IIDXMLElement__
346