http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DOMRange.hpp

Go to the documentation of this file.
00001 #ifndef DOMRange_HEADER_GUARD_
00002 #define DOMRange_HEADER_GUARD_
00003 
00004 /*
00005  * Copyright 2001-2002,2004 The Apache Software Foundation.
00006  * 
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  * 
00011  *      http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  */
00019 
00020 /*
00021  * $Id: DOMRange.hpp,v 1.9 2004/09/08 13:55:39 peiyongz Exp $
00022  */
00023 
00024 #include <xercesc/util/XercesDefs.hpp>
00025 
00026 XERCES_CPP_NAMESPACE_BEGIN
00027 
00028 class DOMNode;
00029 class DOMDocumentFragment;
00030 
00035 class  DOMRange {
00036 protected:
00037     // -----------------------------------------------------------------------
00038     //  Hidden constructors
00039     // -----------------------------------------------------------------------
00042     DOMRange() {};
00044 
00045 private:
00046     // -----------------------------------------------------------------------
00047     // Unimplemented constructors and operators
00048     // -----------------------------------------------------------------------
00051     DOMRange(const DOMRange &);
00052     DOMRange & operator = (const DOMRange &);
00054 
00055 public:
00056     // -----------------------------------------------------------------------
00057     //  All constructors are hidden, just the destructor is available
00058     // -----------------------------------------------------------------------
00065     virtual ~DOMRange() {};
00067 
00068     // -----------------------------------------------------------------------
00069     //  Class Types
00070     // -----------------------------------------------------------------------
00098     enum CompareHow {
00099         START_TO_START  = 0,
00100         START_TO_END    = 1,
00101         END_TO_END      = 2,
00102         END_TO_START    = 3
00103     };
00104 
00106 
00107     // -----------------------------------------------------------------------
00108     //  Virtual DOMRange interface
00109     // -----------------------------------------------------------------------
00112     // -----------------------------------------------------------------------
00113     //  Getter methods
00114     // -----------------------------------------------------------------------
00123     virtual DOMNode* getStartContainer() const = 0;
00124 
00133     virtual XMLSize_t getStartOffset() const = 0;
00134 
00143     virtual DOMNode* getEndContainer() const = 0;
00144 
00153     virtual XMLSize_t getEndOffset() const = 0;
00154 
00163     virtual bool getCollapsed() const = 0;
00164 
00174     virtual const DOMNode* getCommonAncestorContainer() const = 0;
00175 
00176     // -----------------------------------------------------------------------
00177     //  Setter methods
00178     // -----------------------------------------------------------------------
00201     virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0;
00202 
00225     virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0;
00226 
00243     virtual void setStartBefore(const DOMNode *refNode) = 0;
00244 
00261     virtual void setStartAfter(const DOMNode *refNode) = 0;
00262 
00279     virtual void setEndBefore(const DOMNode *refNode) = 0;
00280 
00297     virtual void setEndAfter(const DOMNode *refNode) = 0;
00298 
00299     // -----------------------------------------------------------------------
00300     //  Misc methods
00301     // -----------------------------------------------------------------------
00312     virtual void collapse(bool toStart) = 0;
00313 
00330     virtual void selectNode(const DOMNode *refNode) = 0;
00331 
00346     virtual void selectNodeContents(const DOMNode *refNode) = 0;
00347 
00365     virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0;
00366 
00380     virtual void deleteContents() = 0;
00381 
00397     virtual DOMDocumentFragment* extractContents() = 0;
00398 
00411     virtual DOMDocumentFragment* cloneContents() const = 0;
00412 
00441     virtual void insertNode(DOMNode *newNode) = 0;
00442 
00468     virtual void surroundContents(DOMNode *newParent) = 0;
00469 
00480     virtual DOMRange* cloneRange() const = 0;
00481 
00492     virtual const XMLCh* toString() const = 0;
00493 
00506     virtual void detach() = 0;
00507 
00509 
00510     // -----------------------------------------------------------------------
00511     //  Non-standard Extension
00512     // -----------------------------------------------------------------------
00522     virtual void release() = 0;
00524 };
00525 
00526 
00527 XERCES_CPP_NAMESPACE_END
00528 
00529 #endif


Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.