CSSMutableStyleDeclaration.h [plain text]
#ifndef CSSMutableStyleDeclaration_h
#define CSSMutableStyleDeclaration_h
#include "CSSStyleDeclaration.h"
#include "CSSPrimitiveValue.h"
#include "DeprecatedValueList.h"
#include "Node.h"
#include "PlatformString.h"
namespace WebCore {
class CSSProperty;
class Node;
class CSSMutableStyleDeclaration : public CSSStyleDeclaration {
public:
CSSMutableStyleDeclaration();
CSSMutableStyleDeclaration(CSSRule* parentRule);
CSSMutableStyleDeclaration(CSSRule* parentRule, const DeprecatedValueList<CSSProperty>&);
CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
CSSMutableStyleDeclaration& operator=(const CSSMutableStyleDeclaration&);
void setNode(Node* node) { m_node = node; }
virtual String cssText() const;
virtual void setCssText(const String&, ExceptionCode&);
virtual unsigned length() const;
virtual String item(unsigned index) const;
virtual PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID) const;
virtual String getPropertyValue(int propertyID) const;
virtual bool getPropertyPriority(int propertyID) const;
virtual int getPropertyShorthand(int propertyID) const;
virtual bool isPropertyImplicit(int propertyID) const;
virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
virtual String removeProperty(int propertyID, ExceptionCode&);
virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const;
virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable();
DeprecatedValueListConstIterator<CSSProperty> valuesIterator() const { return m_values.begin(); }
bool setProperty(int propertyID, int value, bool important = false, bool notifyChanged = true);
bool setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode&);
bool setProperty(int propertyId, const String& value, bool important = false, bool notifyChanged = true)
{
ExceptionCode ec;
return setProperty(propertyId, value, important, notifyChanged, ec);
}
String removeProperty(int propertyID, bool notifyChanged, bool returnText, ExceptionCode&);
void removeProperty(int propertyID, bool notifyChanged = true)
{
ExceptionCode ec;
removeProperty(propertyID, notifyChanged, false, ec);
}
void clear();
void setChanged(StyleChangeType changeType = FullStyleChange);
void setLengthProperty(int propertyId, const String& value, bool important, bool multiLength = false);
void setStringProperty(int propertyId, const String& value, CSSPrimitiveValue::UnitTypes, bool important = false); void setImageProperty(int propertyId, const String& url, bool important = false);
void parseDeclaration(const String& styleDeclaration);
void addParsedProperties(const CSSProperty* const *, int numProperties);
PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const;
void removeBlockProperties();
void removePropertiesInSet(const int* set, unsigned length, bool notifyChanged = true);
void merge(CSSMutableStyleDeclaration*, bool argOverridesOnConflict = true);
private:
String getShorthandValue(const int* properties, int number) const;
String getLayeredShorthandValue(const int* properties, unsigned number) const;
String get4Values(const int* properties) const;
DeprecatedValueList<CSSProperty> m_values;
Node* m_node;
};
}
#endif // CSSMutableStyleDeclaration_h