DOMRange.hpp

Go to the documentation of this file.
00001 #ifndef DOMRange_HEADER_GUARD_
00002 #define DOMRange_HEADER_GUARD_
00003 
00004 /*
00005  * Licensed to the Apache Software Foundation (ASF) under one or more
00006  * contributor license agreements.  See the NOTICE file distributed with
00007  * this work for additional information regarding copyright ownership.
00008  * The ASF licenses this file to You under the Apache License, Version 2.0
00009  * (the "License"); you may not use this file except in compliance with
00010  * the License.  You may obtain a copy of the License at
00011  * 
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  * 
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  */
00020 
00021 /*
00022  * $Id: DOMRange.hpp 568078 2007-08-21 11:43:25Z amassari $
00023  */
00024 
00025 #include <xercesc/util/XercesDefs.hpp>
00026 
00027 XERCES_CPP_NAMESPACE_BEGIN
00028 
00029 class DOMNode;
00030 class DOMDocumentFragment;
00031 
00036 class CDOM_EXPORT DOMRange {
00037 protected:
00038     // -----------------------------------------------------------------------
00039     //  Hidden constructors
00040     // -----------------------------------------------------------------------
00043     DOMRange() {}
00044     DOMRange(const DOMRange &) {}
00046 
00047 private:
00048     // -----------------------------------------------------------------------
00049     // Unimplemented constructors and operators
00050     // -----------------------------------------------------------------------
00053     DOMRange & operator = (const DOMRange &);
00055 
00056 public:
00057     // -----------------------------------------------------------------------
00058     //  All constructors are hidden, just the destructor is available
00059     // -----------------------------------------------------------------------
00066     virtual ~DOMRange() {};
00068 
00069     // -----------------------------------------------------------------------
00070     //  Class Types
00071     // -----------------------------------------------------------------------
00099     enum CompareHow {
00100         START_TO_START  = 0,
00101         START_TO_END    = 1,
00102         END_TO_END      = 2,
00103         END_TO_START    = 3
00104     };
00105 
00107 
00108     // -----------------------------------------------------------------------
00109     //  Virtual DOMRange interface
00110     // -----------------------------------------------------------------------
00113     // -----------------------------------------------------------------------
00114     //  Getter methods
00115     // -----------------------------------------------------------------------
00124     virtual DOMNode* getStartContainer() const = 0;
00125 
00134     virtual XMLSize_t getStartOffset() const = 0;
00135 
00144     virtual DOMNode* getEndContainer() const = 0;
00145 
00154     virtual XMLSize_t getEndOffset() const = 0;
00155 
00164     virtual bool getCollapsed() const = 0;
00165 
00175     virtual const DOMNode* getCommonAncestorContainer() const = 0;
00176 
00177     // -----------------------------------------------------------------------
00178     //  Setter methods
00179     // -----------------------------------------------------------------------
00202     virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0;
00203 
00226     virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0;
00227 
00244     virtual void setStartBefore(const DOMNode *refNode) = 0;
00245 
00262     virtual void setStartAfter(const DOMNode *refNode) = 0;
00263 
00280     virtual void setEndBefore(const DOMNode *refNode) = 0;
00281 
00298     virtual void setEndAfter(const DOMNode *refNode) = 0;
00299 
00300     // -----------------------------------------------------------------------
00301     //  Misc methods
00302     // -----------------------------------------------------------------------
00313     virtual void collapse(bool toStart) = 0;
00314 
00331     virtual void selectNode(const DOMNode *refNode) = 0;
00332 
00347     virtual void selectNodeContents(const DOMNode *refNode) = 0;
00348 
00366     virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0;
00367 
00381     virtual void deleteContents() = 0;
00382 
00398     virtual DOMDocumentFragment* extractContents() = 0;
00399 
00412     virtual DOMDocumentFragment* cloneContents() const = 0;
00413 
00442     virtual void insertNode(DOMNode *newNode) = 0;
00443 
00469     virtual void surroundContents(DOMNode *newParent) = 0;
00470 
00481     virtual DOMRange* cloneRange() const = 0;
00482 
00493     virtual const XMLCh* toString() const = 0;
00494 
00507     virtual void detach() = 0;
00508 
00510 
00511     // -----------------------------------------------------------------------
00512     //  Non-standard Extension
00513     // -----------------------------------------------------------------------
00523     virtual void release() = 0;
00525 };
00526 
00527 
00528 XERCES_CPP_NAMESPACE_END
00529 
00530 #endif

Generated on Thu Feb 19 11:35:43 2009 for Xerces-C++ by  doxygen 1.5.4