khtml Library API Documentation

kjs_range.h

00001 // -*- c-basic-offset: 2 -*-
00002 /*
00003  *  This file is part of the KDE libraries
00004  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Library General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 #ifndef _KJS_RANGE_H_
00022 #define _KJS_RANGE_H_
00023 
00024 #include "ecma/kjs_dom.h"
00025 #include "dom/dom2_range.h"
00026 
00027 namespace KJS {
00028 
00029   class DOMRange : public DOMObject {
00030   public:
00031     DOMRange(ExecState *exec, DOM::Range r);
00032     ~DOMRange();
00033     virtual Value tryGet(ExecState *exec,const UString &p) const;
00034     Value getValueProperty(ExecState *exec, int token) const;
00035     // no put - all read-only
00036     virtual const ClassInfo* classInfo() const { return &info; }
00037     static const ClassInfo info;
00038     enum { StartContainer, StartOffset, EndContainer, EndOffset, Collapsed,
00039            CommonAncestorContainer,
00040            SetStart, SetEnd, SetStartBefore, SetStartAfter, SetEndBefore,
00041            SetEndAfter, Collapse, SelectNode, SelectNodeContents,
00042            CompareBoundaryPoints, DeleteContents, ExtractContents,
00043            CloneContents, InsertNode, SurroundContents, CloneRange, ToString,
00044            Detach };
00045     DOM::Range toRange() const { return range; }
00046   protected:
00047     DOM::Range range;
00048   };
00049 
00050   // Constructor object Range
00051   class RangeConstructor : public DOMObject {
00052   public:
00053     RangeConstructor(ExecState *);
00054     virtual Value tryGet(ExecState *exec,const UString &p) const;
00055     Value getValueProperty(ExecState *, int token) const;
00056     // no put - all read-only
00057     virtual const ClassInfo* classInfo() const { return &info; }
00058     static const ClassInfo info;
00059   };
00060 
00061   Value getDOMRange(ExecState *exec, DOM::Range r);
00062   Value getRangeConstructor(ExecState *exec);
00063 
00067   DOM::Range toRange(const Value&);
00068 
00069 } // namespace
00070 
00071 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:16:38 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001