From 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Wed, 17 Dec 2008 18:05:15 -0800 Subject: Code drop from //branches/cupcake/...@124589 --- WebCore/editing/ApplyStyleCommand.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'WebCore/editing/ApplyStyleCommand.h') diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h index eafec59..8df76a0 100644 --- a/WebCore/editing/ApplyStyleCommand.h +++ b/WebCore/editing/ApplyStyleCommand.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,16 +37,29 @@ class ApplyStyleCommand : public CompositeEditCommand { public: enum EPropertyLevel { PropertyDefault, ForceBlockProperties }; - ApplyStyleCommand(Document*, CSSStyleDeclaration*, EditAction = EditActionChangeAttributes, EPropertyLevel = PropertyDefault); - ApplyStyleCommand(Document*, CSSStyleDeclaration*, const Position& start, const Position& end, EditAction = EditActionChangeAttributes, EPropertyLevel = PropertyDefault); - ApplyStyleCommand(Element*, bool = false, EditAction = EditActionChangeAttributes); + static PassRefPtr create(Document* document, CSSStyleDeclaration* style, EditAction action = EditActionChangeAttributes, EPropertyLevel level = PropertyDefault) + { + return adoptRef(new ApplyStyleCommand(document, style, action, level)); + } + static PassRefPtr create(Document* document, CSSStyleDeclaration* style, const Position& start, const Position& end, EditAction action = EditActionChangeAttributes, EPropertyLevel level = PropertyDefault) + { + return adoptRef(new ApplyStyleCommand(document, style, start, end, action, level)); + } + static PassRefPtr create(Element* element, bool removeOnly = false, EditAction action = EditActionChangeAttributes) + { + return adoptRef(new ApplyStyleCommand(element, removeOnly, action)); + } + +private: + ApplyStyleCommand(Document*, CSSStyleDeclaration*, EditAction, EPropertyLevel); + ApplyStyleCommand(Document*, CSSStyleDeclaration*, const Position& start, const Position& end, EditAction, EPropertyLevel); + ApplyStyleCommand(Element*, bool removeOnly, EditAction); virtual void doApply(); virtual EditAction editingAction() const; CSSMutableStyleDeclaration* style() const { return m_style.get(); } -private: // style-removal helpers bool isHTMLStyleNode(CSSMutableStyleDeclaration*, HTMLElement*); void removeHTMLStyleNode(HTMLElement*); -- cgit v1.1