blob: 86d342b3a33bd0d550085d82799a4683d7bba7a0 [file] [log] [blame]
eseidel13a64222006-05-16 05:33:34 +00001/*
eseidel13a64222006-05-16 05:33:34 +00002 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
akling@apple.comc713db32012-11-22 03:45:40 +00004 * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved.
eseidel13a64222006-05-16 05:33:34 +00005 *
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
ddkilzerc8eccec2007-09-26 02:29:57 +000018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
eseidel13a64222006-05-16 05:33:34 +000020 */
21
weinig5b398c42006-12-29 19:28:15 +000022#ifndef CSSCharsetRule_h
23#define CSSCharsetRule_h
eseidel13a64222006-05-16 05:33:34 +000024
25#include "CSSRule.h"
eseidel13a64222006-05-16 05:33:34 +000026
27namespace WebCore {
28
weinig5b398c42006-12-29 19:28:15 +000029class CSSCharsetRule : public CSSRule {
eseidel13a64222006-05-16 05:33:34 +000030public:
darin@apple.com894e8132008-06-17 19:16:22 +000031 static PassRefPtr<CSSCharsetRule> create(CSSStyleSheet* parent, const String& encoding)
32 {
33 return adoptRef(new CSSCharsetRule(parent, encoding));
34 }
35
akling@apple.comc713db32012-11-22 03:45:40 +000036 virtual ~CSSCharsetRule() { }
37
38 virtual CSSRule::Type type() const OVERRIDE { return CHARSET_RULE; }
39 virtual String cssText() const OVERRIDE;
40 virtual void reattach(StyleRuleBase* rule) OVERRIDE { ASSERT_UNUSED(rule, !rule); }
akling@apple.comc713db32012-11-22 03:45:40 +000041
darin@apple.com894e8132008-06-17 19:16:22 +000042 const String& encoding() const { return m_encoding; }
weinig638c3d52007-05-30 17:43:55 +000043 void setEncoding(const String& encoding, ExceptionCode&) { m_encoding = encoding; }
weinig5b398c42006-12-29 19:28:15 +000044
darin@apple.com894e8132008-06-17 19:16:22 +000045private:
46 CSSCharsetRule(CSSStyleSheet* parent, const String& encoding);
47
eseidel13a64222006-05-16 05:33:34 +000048 String m_encoding;
49};
50
weinig5b398c42006-12-29 19:28:15 +000051} // namespace WebCore
eseidel13a64222006-05-16 05:33:34 +000052
weinig5b398c42006-12-29 19:28:15 +000053#endif // CSSCharsetRule_h