/platform/external/webkit/WebCore/css/CSSComputedStyleDeclaration.h

https://github.com/aharish/totoro-gb-opensource-update2 · C Header · 82 lines · 43 code · 20 blank · 19 comment · 0 complexity · dc959846f2880367a92dce1baffaa11d MD5 · raw file

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