DOMRange.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMRANGE_HPP)
#define XERCESC_INCLUDE_GUARD_DOMRANGE_HPP
#include <xercesc/util/XercesDefs.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMDocumentFragment;
class CDOM_EXPORT DOMRange {
protected:
// -----------------------------------------------------------------------
// Hidden constructors
// -----------------------------------------------------------------------
DOMRange() {}
DOMRange(const DOMRange &) {}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMRange & operator = (const DOMRange &);
public:
// -----------------------------------------------------------------------
// All constructors are hidden, just the destructor is available
// -----------------------------------------------------------------------
virtual ~DOMRange() {};
// -----------------------------------------------------------------------
// Class Types
// -----------------------------------------------------------------------
enum CompareHow {
START_TO_START = 0,
START_TO_END = 1,
END_TO_END = 2,
END_TO_START = 3
};
// -----------------------------------------------------------------------
// Virtual DOMRange interface
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
virtual DOMNode* getStartContainer() const = 0;
virtual XMLSize_t getStartOffset() const = 0;
virtual DOMNode* getEndContainer() const = 0;
virtual XMLSize_t getEndOffset() const = 0;
virtual bool getCollapsed() const = 0;
virtual const DOMNode* getCommonAncestorContainer() const = 0;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0;
virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0;
virtual void setStartBefore(const DOMNode *refNode) = 0;
virtual void setStartAfter(const DOMNode *refNode) = 0;
virtual void setEndBefore(const DOMNode *refNode) = 0;
virtual void setEndAfter(const DOMNode *refNode) = 0;
// -----------------------------------------------------------------------
// Misc methods
// -----------------------------------------------------------------------
virtual void collapse(bool toStart) = 0;
virtual void selectNode(const DOMNode *refNode) = 0;
virtual void selectNodeContents(const DOMNode *refNode) = 0;
virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0;
virtual void deleteContents() = 0;
virtual DOMDocumentFragment* extractContents() = 0;
virtual DOMDocumentFragment* cloneContents() const = 0;
virtual void insertNode(DOMNode *newNode) = 0;
virtual void surroundContents(DOMNode *newParent) = 0;
virtual DOMRange* cloneRange() const = 0;
virtual const XMLCh* toString() const = 0;
virtual void detach() = 0;
// -----------------------------------------------------------------------
// Non-standard Extension
// -----------------------------------------------------------------------
virtual void release() = 0;
};
XERCES_CPP_NAMESPACE_END
#endif
XercesDefs.hpp
CDOM_EXPORT
#define CDOM_EXPORT
Definition XercesDefs.hpp:166
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLSize_t
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
DOMDocumentFragment
DOMDocumentFragment is a "lightweight" or "minimal" DOMDocument object.
Definition DOMDocumentFragment.hpp:71
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
DOMRange
Definition DOMRange.hpp:36
DOMRange::setEndBefore
virtual void setEndBefore(const DOMNode *refNode)=0
Sets the end position to be before a node.
DOMRange::CompareHow
CompareHow
Constants CompareHow.
Definition DOMRange.hpp:99
DOMRange::toString
virtual const XMLCh * toString() const =0
Returns the contents of a Range as a string.
DOMRange::getStartOffset
virtual XMLSize_t getStartOffset() const =0
Offset within the starting node of the Range.
DOMRange::getCommonAncestorContainer
virtual const DOMNode * getCommonAncestorContainer() const =0
The deepest common ancestor container of the Range's two boundary-points.
DOMRange::cloneContents
virtual DOMDocumentFragment * cloneContents() const =0
Duplicates the contents of a Range.
DOMRange::setStartAfter
virtual void setStartAfter(const DOMNode *refNode)=0
Sets the start position to be after a node.
DOMRange::collapse
virtual void collapse(bool toStart)=0
Collapse a Range onto one of its boundary-points.
DOMRange::getCollapsed
virtual bool getCollapsed() const =0
TRUE if the Range is collapsed.
DOMRange::selectNode
virtual void selectNode(const DOMNode *refNode)=0
Select a node and its contents.
DOMRange::DOMRange
DOMRange()
Definition DOMRange.hpp:43
DOMRange::compareBoundaryPoints
virtual short compareBoundaryPoints(CompareHow how, const DOMRange *sourceRange) const =0
Compare the boundary-points of two Ranges in a document.
DOMRange::surroundContents
virtual void surroundContents(DOMNode *newParent)=0
Reparents the contents of the Range to the given node and inserts the node at the position of the sta...
DOMRange::release
virtual void release()=0
Called to indicate that this Range is no longer in use and that the implementation may relinquish any...
DOMRange::extractContents
virtual DOMDocumentFragment * extractContents()=0
Moves the contents of a Range from the containing document or document fragment to a new DOMDocumentF...
DOMRange::selectNodeContents
virtual void selectNodeContents(const DOMNode *refNode)=0
Select the contents within a node.
DOMRange::setStartBefore
virtual void setStartBefore(const DOMNode *refNode)=0
Sets the start position to be before a node.
DOMRange::insertNode
virtual void insertNode(DOMNode *newNode)=0
Inserts a node into the DOMDocument or DOMDocumentFragment at the start of the Range.
DOMRange::getStartContainer
virtual DOMNode * getStartContainer() const =0
DOMNode within which the Range begins.
DOMRange::detach
virtual void detach()=0
Called to indicate that the Range is no longer in use and that the implementation may relinquish any ...
DOMRange::getEndContainer
virtual DOMNode * getEndContainer() const =0
DOMNode within which the Range ends.
DOMRange::getEndOffset
virtual XMLSize_t getEndOffset() const =0
Offset within the ending node of the Range.
DOMRange::cloneRange
virtual DOMRange * cloneRange() const =0
Produces a new Range whose boundary-points are equal to the boundary-points of the Range.
DOMRange::setEndAfter
virtual void setEndAfter(const DOMNode *refNode)=0
Sets the end of a Range to be after a node.
DOMRange::setStart
virtual void setStart(const DOMNode *refNode, XMLSize_t offset)=0
Sets the attributes describing the start of the Range.
DOMRange::deleteContents
virtual void deleteContents()=0
Removes the contents of a Range from the containing document or document fragment without returning a...
DOMRange::DOMRange
DOMRange(const DOMRange &)
Definition DOMRange.hpp:44
DOMRange::~DOMRange
virtual ~DOMRange()
Destructor.
Definition DOMRange.hpp:66
DOMRange::setEnd
virtual void setEnd(const DOMNode *refNode, XMLSize_t offset)=0
Sets the attributes describing the end of a Range.