webengine/osswebengine/WebCore/css/CSSComputedStyleDeclaration.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /**
       
     2  *
       
     3  * Copyright (C)  2004  Zack Rusin <zack@kde.org>
       
     4  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
       
     5  *
       
     6  * This library is free software; you can redistribute it and/or
       
     7  * modify it under the terms of the GNU Lesser General Public
       
     8  * License as published by the Free Software Foundation; either
       
     9  * version 2 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This library is distributed in the hope that it will be useful,
       
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    14  * Lesser General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU Lesser General Public
       
    17  * License along with this library; if not, write to the Free Software
       
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
       
    19  * 02110-1301  USA
       
    20  */
       
    21 
       
    22 #ifndef CSSComputedStyleDeclaration_h
       
    23 #define CSSComputedStyleDeclaration_h
       
    24 
       
    25 #include "CSSStyleDeclaration.h"
       
    26 #include "Node.h"
       
    27 
       
    28 namespace WebCore {
       
    29 
       
    30 class CSSMutableStyleDeclaration;
       
    31 class CSSProperty;
       
    32 class RenderObject;
       
    33 class RenderStyle;
       
    34 
       
    35 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
       
    36 
       
    37 class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
       
    38 public:
       
    39     CSSComputedStyleDeclaration(PassRefPtr<Node>);
       
    40     virtual ~CSSComputedStyleDeclaration();
       
    41 
       
    42     virtual String cssText() const;
       
    43 
       
    44     virtual unsigned length() const;
       
    45     virtual String item(unsigned index) const;
       
    46 
       
    47     virtual PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID) const;
       
    48     virtual String getPropertyValue(int propertyID) const;
       
    49     virtual bool getPropertyPriority(int propertyID) const;
       
    50     virtual int getPropertyShorthand(int propertyID) const { return -1; }
       
    51     virtual bool isPropertyImplicit(int propertyID) const { return true; }
       
    52 
       
    53     virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const;
       
    54     virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable();
       
    55 
       
    56     PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID, EUpdateLayout) const;
       
    57 
       
    58     PassRefPtr<CSSMutableStyleDeclaration> copyInheritableProperties() const;
       
    59 
       
    60     static void removeComputedInheritablePropertiesFrom(CSSMutableStyleDeclaration*);
       
    61 
       
    62 private:
       
    63     virtual void setCssText(const String&, ExceptionCode&);
       
    64 
       
    65     virtual String removeProperty(int propertyID, ExceptionCode&);
       
    66     virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
       
    67 
       
    68     RefPtr<Node> m_node;
       
    69 };
       
    70 
       
    71 PassRefPtr<CSSComputedStyleDeclaration> computedStyle(Node*);
       
    72 
       
    73 } // namespace WebCore
       
    74 
       
    75 #endif // CSSComputedStyleDeclaration_h