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

https://github.com/aharish/totoro-gb-opensource-update2 · C Header · 75 lines · 35 code · 18 blank · 22 comment · 0 complexity · 8d834c87a62ba2c002b1601a1011010a MD5 · raw file

  1. /*
  2. * (C) 1999-2003 Lars Knoll (knoll@kde.org)
  3. * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
  4. * Copyright (C) 2002, 2006, 2008 Apple Inc. All rights reserved.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library 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. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public License
  17. * along with this library; see the file COPYING.LIB. If not, write to
  18. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. * Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef CSSStyleRule_h
  22. #define CSSStyleRule_h
  23. #include "CSSRule.h"
  24. #include "CSSSelectorList.h"
  25. #include <wtf/PassRefPtr.h>
  26. #include <wtf/RefPtr.h>
  27. namespace WebCore {
  28. class CSSMutableStyleDeclaration;
  29. class CSSSelector;
  30. class CSSStyleRule : public CSSRule {
  31. public:
  32. static PassRefPtr<CSSStyleRule> create(CSSStyleSheet* parent)
  33. {
  34. return adoptRef(new CSSStyleRule(parent));
  35. }
  36. virtual ~CSSStyleRule();
  37. String selectorText() const;
  38. void setSelectorText(const String&, ExceptionCode&);
  39. CSSMutableStyleDeclaration* style() const { return m_style.get(); }
  40. virtual String cssText() const;
  41. // Not part of the CSSOM
  42. virtual bool parseString(const String&, bool = false);
  43. void adoptSelectorVector(Vector<CSSSelector*>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
  44. void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration>);
  45. const CSSSelectorList& selectorList() const { return m_selectorList; }
  46. CSSMutableStyleDeclaration* declaration() { return m_style.get(); }
  47. virtual void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
  48. private:
  49. CSSStyleRule(CSSStyleSheet* parent);
  50. virtual bool isStyleRule() { return true; }
  51. // Inherited from CSSRule
  52. virtual unsigned short type() const { return STYLE_RULE; }
  53. RefPtr<CSSMutableStyleDeclaration> m_style;
  54. CSSSelectorList m_selectorList;
  55. };
  56. } // namespace WebCore
  57. #endif // CSSStyleRule_h