Xerces-C++  3.1.2
DOMRange.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /*
19  * $Id: DOMRange.hpp 932887 2010-04-11 13:04:59Z borisk $
20  */
21 
22 #if !defined(XERCESC_INCLUDE_GUARD_DOMRANGE_HPP)
23 #define XERCESC_INCLUDE_GUARD_DOMRANGE_HPP
24 
26 
28 
29 class DOMNode;
31 
37 protected:
38  // -----------------------------------------------------------------------
39  // Hidden constructors
40  // -----------------------------------------------------------------------
43  DOMRange() {}
44  DOMRange(const DOMRange &) {}
46 
47 private:
48  // -----------------------------------------------------------------------
49  // Unimplemented constructors and operators
50  // -----------------------------------------------------------------------
53  DOMRange & operator = (const DOMRange &);
55 
56 public:
57  // -----------------------------------------------------------------------
58  // All constructors are hidden, just the destructor is available
59  // -----------------------------------------------------------------------
66  virtual ~DOMRange() {};
68 
69  // -----------------------------------------------------------------------
70  // Class Types
71  // -----------------------------------------------------------------------
99  enum CompareHow {
100  START_TO_START = 0,
101  START_TO_END = 1,
102  END_TO_END = 2,
103  END_TO_START = 3
104  };
105 
107 
108  // -----------------------------------------------------------------------
109  // Virtual DOMRange interface
110  // -----------------------------------------------------------------------
113  // -----------------------------------------------------------------------
114  // Getter methods
115  // -----------------------------------------------------------------------
124  virtual DOMNode* getStartContainer() const = 0;
125 
134  virtual XMLSize_t getStartOffset() const = 0;
135 
144  virtual DOMNode* getEndContainer() const = 0;
145 
154  virtual XMLSize_t getEndOffset() const = 0;
155 
164  virtual bool getCollapsed() const = 0;
165 
175  virtual const DOMNode* getCommonAncestorContainer() const = 0;
176 
177  // -----------------------------------------------------------------------
178  // Setter methods
179  // -----------------------------------------------------------------------
202  virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0;
203 
226  virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0;
227 
244  virtual void setStartBefore(const DOMNode *refNode) = 0;
245 
262  virtual void setStartAfter(const DOMNode *refNode) = 0;
263 
280  virtual void setEndBefore(const DOMNode *refNode) = 0;
281 
298  virtual void setEndAfter(const DOMNode *refNode) = 0;
299 
300  // -----------------------------------------------------------------------
301  // Misc methods
302  // -----------------------------------------------------------------------
313  virtual void collapse(bool toStart) = 0;
314 
331  virtual void selectNode(const DOMNode *refNode) = 0;
332 
347  virtual void selectNodeContents(const DOMNode *refNode) = 0;
348 
366  virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0;
367 
381  virtual void deleteContents() = 0;
382 
398  virtual DOMDocumentFragment* extractContents() = 0;
399 
412  virtual DOMDocumentFragment* cloneContents() const = 0;
413 
442  virtual void insertNode(DOMNode *newNode) = 0;
443 
469  virtual void surroundContents(DOMNode *newParent) = 0;
470 
481  virtual DOMRange* cloneRange() const = 0;
482 
493  virtual const XMLCh* toString() const = 0;
494 
507  virtual void detach() = 0;
508 
510 
511  // -----------------------------------------------------------------------
512  // Non-standard Extension
513  // -----------------------------------------------------------------------
523  virtual void release() = 0;
525 };
526 
527 
529 
530 #endif
DOMDocumentFragment is a "lightweight" or "minimal" DOMDocument object.
Definition: DOMDocumentFragment.hpp:71
DOMRange(const DOMRange &)
Definition: DOMRange.hpp:44
DOMRange()
Definition: DOMRange.hpp:43
#define CDOM_EXPORT
Definition: XercesDefs.hpp:166
SIZE_T XMLSize_t
Definition: Xerces_autoconf_config.borland.hpp:86
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition: DOMNode.hpp:139
CompareHow
Constants CompareHow.
Definition: DOMRange.hpp:99
virtual ~DOMRange()
Destructor.
Definition: DOMRange.hpp:66
Definition: DOMRange.hpp:36