domparser.h

00001 // -*- c-basic-offset: 2 -*-
00002 /*
00003  *  This file is part of the KDE libraries
00004  *  Copyright (C) 2005 Anders Carlsson (andersca@mac.com)
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser 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  *  Lesser General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #ifndef DOMPARSER_H
00022 #define DOMPARSER_H
00023 
00024 #include <qguardedptr.h>
00025 #include <kjs/object.h>
00026 #include <kjs/interpreter.h>
00027 #include <misc/shared.h>
00028 
00029 #include "kjs_dom.h"
00030 
00031 namespace KJS {
00032 
00033   class DOMParserConstructorImp : public ObjectImp {
00034   public:
00035     DOMParserConstructorImp(ExecState *, DOM::DocumentImpl *d);
00036     virtual bool implementsConstruct() const;
00037     virtual Object construct(ExecState *exec, const List &args);
00038 private:
00039     khtml::SharedPtr<DOM::DocumentImpl> doc;
00040   };
00041 
00042   class DOMParser : public DOMObject {
00043   public:
00044     DOMParser(ExecState *, DOM::DocumentImpl *d);
00045     virtual bool toBoolean(ExecState *) const { return true; }
00046     virtual const ClassInfo* classInfo() const { return &info; }
00047     static const ClassInfo info;
00048     enum { ParseFromString };
00049 
00050   private:
00051     QGuardedPtr<DOM::DocumentImpl> doc;
00052 
00053     friend class DOMParserProtoFunc;
00054   };
00055 
00056 } // namespace
00057 
00058 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys