#ifndef RENDER_THEME_H
#define RENDER_THEME_H
#include "RenderObject.h"
namespace WebCore {
class Element;
class PopupMenu;
class RenderMenuList;
class RenderPopupMenu;
enum ControlState { HoverState, PressedState, FocusState, EnabledState, CheckedState, ReadOnlyState };
class RenderTheme {
public:
RenderTheme() {}
virtual ~RenderTheme() {}
void adjustStyle(CSSStyleSelector*, RenderStyle*, Element*,
bool UAHasAppearance, const BorderData&, const BackgroundLayer&, const Color& backgroundColor);
bool paint(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
bool paintBorderOnly(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
bool paintDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
virtual short baselinePosition(const RenderObject* o) const;
virtual bool isControlContainer(EAppearance appearance) const;
virtual bool controlSupportsTints(const RenderObject* o) const { return false; }
virtual bool isControlStyled(const RenderStyle* style, const BorderData& border,
const BackgroundLayer& background, const Color& backgroundColor) const;
virtual bool supportsControlTints() const { return false; }
virtual void adjustRepaintRect(const RenderObject* o, IntRect& r) { }
virtual bool stateChanged(RenderObject* o, ControlState state) const;
virtual void themeChanged() {};
virtual bool supportsFocusRing(const RenderStyle* style) const;
virtual bool supportsHover(const RenderStyle* style) const { return false; }
Color activeSelectionBackgroundColor() const;
Color inactiveSelectionBackgroundColor() const;
virtual Color platformActiveSelectionBackgroundColor() const;
virtual Color platformInactiveSelectionBackgroundColor() const;
virtual Color platformActiveSelectionForegroundColor() const;
virtual Color platformInactiveSelectionForegroundColor() const;
virtual Color activeListBoxSelectionBackgroundColor() const;
virtual Color activeListBoxSelectionForegroundColor() const;
virtual Color inactiveListBoxSelectionBackgroundColor() const;
virtual Color inactiveListBoxSelectionForegroundColor() const;
virtual int minimumMenuListSize(RenderStyle*) const { return 0; }
virtual RenderPopupMenu* createPopupMenu(RenderArena*, Document*, RenderMenuList*) = 0;
bool isChecked(const RenderObject* o) const;
bool isIndeterminate(const RenderObject* o) const;
bool isEnabled(const RenderObject* o) const;
bool isFocused(const RenderObject* o) const;
bool isPressed(const RenderObject* o) const;
bool isHovered(const RenderObject* o) const;
bool isReadOnlyControl(const RenderObject* o) const;
virtual int popupInternalPaddingLeft(RenderStyle*) const { return 0; }
virtual int popupInternalPaddingRight(RenderStyle*) const { return 0; }
virtual int popupInternalPaddingTop(RenderStyle*) const { return 0; }
virtual int popupInternalPaddingBottom(RenderStyle*) const { return 0; }
protected:
virtual void adjustCheckboxStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintCheckboxDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void setCheckboxSize(RenderStyle* style) const {};
virtual void adjustRadioStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintRadioDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void setRadioSize(RenderStyle* style) const {};
virtual void adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintButtonDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintPushButtonDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintSquareButtonDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void setButtonSize(RenderStyle* style) const {};
virtual void adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintTextFieldDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintTextAreaDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintMenuListDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual void adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
virtual bool paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
virtual bool paintMenuListButtonDecorations(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return true; }
};
RenderTheme* theme();
}
#endif