File indexing completed on 2024-04-28 15:22:40
0001 /* 0002 * css_renderstyleimpl.h 0003 * 0004 * Copyright 2004 Zack Rusin <zack@kde.org> 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Lesser 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 * Lesser General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Lesser General Public 0017 * License along with this library; if not, write to the Free Software 0018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0019 * 02110-1301 USA 0020 */ 0021 #ifndef CSS_RENDERSTYLEIMPL_H 0022 #define CSS_RENDERSTYLEIMPL_H 0023 0024 #include "css/css_valueimpl.h" 0025 #include "dom/dom_string.h" 0026 #include "rendering/render_style.h" 0027 0028 namespace DOM 0029 { 0030 class NodeImpl; 0031 } 0032 0033 namespace khtml 0034 { 0035 0036 // Used by DOM::Counter::listStyle() 0037 DOM::DOMString stringForListStyleType(khtml::EListStyleType type); 0038 0039 class RenderStyleDeclarationImpl : public DOM::CSSStyleDeclarationImpl 0040 { 0041 public: 0042 RenderStyleDeclarationImpl(DOM::NodeImpl *node); 0043 virtual ~RenderStyleDeclarationImpl(); 0044 0045 DOM::DOMString cssText() const; 0046 void setCssText(DOM::DOMString str); 0047 0048 DOM::CSSValueImpl *getPropertyCSSValue(int propertyID) const override; 0049 DOM::DOMString getPropertyValue(int propertyID) const override; 0050 bool getPropertyPriority(int propertyID) const override; 0051 unsigned long length() const override; 0052 0053 void removeProperty(int propertyID, DOM::DOMString *old = nullptr) override; 0054 bool removePropertiesInSet(const int *set, unsigned length) override; 0055 bool isPropertyImplicit(int /*propertyID*/) const override 0056 { 0057 return false; 0058 } 0059 bool setProperty(int propertyId, const DOM::DOMString &value, bool important, int &ec) override; 0060 bool setProperty(int propertyId, const DOM::DOMString &value, bool important = false) override; 0061 void setProperty(int propertyId, int value, bool important = false) override; 0062 void setLengthProperty(int id, const DOM::DOMString &value, bool important, bool multiLength = false) override; 0063 0064 void setProperty(const DOM::DOMString &propertyString) override; 0065 DOM::DOMString item(unsigned long index) const override; 0066 0067 protected: 0068 DOM::CSSProperty property(int id) const; 0069 0070 protected: 0071 SharedPtr<DOM::NodeImpl> m_node; 0072 }; 0073 0074 } 0075 0076 #endif