#ifndef CSSStyleSheet_h
#define CSSStyleSheet_h
#include "StyleSheet.h"
namespace WebCore {
class CSSNamespace;
class CSSParser;
class CSSRule;
class CSSRuleList;
class DocLoader;
class Document;
typedef int ExceptionCode;
class CSSStyleSheet : public StyleSheet {
public:
CSSStyleSheet(Node* parentNode, const String& href = String(), const String& charset = String());
CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href = String(), const String& charset = String());
CSSStyleSheet(CSSRule* ownerRule, const String& href = String(), const String& charset = String());
~CSSStyleSheet();
virtual bool isCSSStyleSheet() const { return true; }
virtual String type() const { return "text/css"; }
CSSRule* ownerRule() const;
CSSRuleList* cssRules(bool omitCharsetRules = false);
unsigned insertRule(const String& rule, unsigned index, ExceptionCode&);
void deleteRule(unsigned index, ExceptionCode&);
CSSRuleList* rules() { return cssRules(true); }
int addRule(const String& selector, const String& style, int index, ExceptionCode&);
int addRule(const String& selector, const String& style, ExceptionCode&);
void removeRule(unsigned index, ExceptionCode& ec) { deleteRule(index, ec); }
void removeRule(ExceptionCode& ec) { deleteRule(0, ec); }
void addNamespace(CSSParser*, const AtomicString& prefix, const AtomicString& uri);
const AtomicString& determineNamespace(const AtomicString& prefix);
virtual void styleSheetChanged();
virtual bool parseString(const String&, bool strict = true);
virtual bool isLoading();
virtual void checkLoaded();
DocLoader* docLoader();
Document* doc() { return m_doc; }
const String& charset() const { return m_charset; }
bool loadCompleted() const { return m_loadCompleted; }
protected:
Document* m_doc;
CSSNamespace* m_namespaces;
String m_charset;
bool m_loadCompleted;
};
}
#endif