File indexing completed on 2024-04-28 11:37:42

0001 /*
0002  * This file is part of the DOM implementation for KDE.
0003  *
0004  * Copyright 2001 Peter Kelly (pmk@post.com)
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 
0023 #ifndef _DOM_Views_h_
0024 #define _DOM_Views_h_
0025 
0026 #include <khtml_export.h>
0027 namespace DOM
0028 {
0029 
0030 class Document;
0031 class AbstractViewImpl;
0032 class CSSStyleDeclaration;
0033 class Element;
0034 class DOMString;
0035 
0036 /**
0037  * Introduced in DOM Level 2
0038  *
0039  * A base interface that all views shall derive from.
0040  *
0041  */
0042 class KHTML_EXPORT AbstractView
0043 {
0044     friend class Event;
0045     friend class UIEvent;
0046     friend class MouseEvent;
0047     friend class MutationEvent;
0048     friend class Document;
0049 public:
0050     AbstractView();
0051     AbstractView(const AbstractView &other);
0052     virtual ~AbstractView();
0053 
0054     AbstractView &operator = (const AbstractView &other);
0055 
0056     /**
0057      * The source DocumentView of which this is an AbstractView.
0058      */
0059     Document document() const;
0060 
0061     /**
0062      * Introduced in DOM Level 2
0063      * This method is from the ViewCSS interface
0064      *
0065      * This method is used to get the computed style as it is defined in
0066      * [CSS2].
0067      *
0068      * @param elt The element whose style is to be computed. This parameter
0069      * cannot be null.
0070      *
0071      * @param pseudoElt The pseudo-element or null if none.
0072      *
0073      * @return The computed style. The CSSStyleDeclaration is read-only and
0074      * contains only absolute values.
0075      */
0076     CSSStyleDeclaration getComputedStyle(const Element &elt, const DOMString &pseudoElt);
0077 
0078     /**
0079      * @internal
0080      * not part of the DOM
0081      */
0082     AbstractViewImpl *handle() const;
0083     bool isNull() const;
0084 
0085 protected:
0086     AbstractView(AbstractViewImpl *i);
0087     AbstractViewImpl *impl;
0088 };
0089 
0090 } //namespace
0091 #endif