LayoutTests:
[WebKit-https.git] / WebCore / editing / Editor.h
index 469b66650b7ee1c4672393a92d4fb80811a51ec3..838091639e17339d40fb9694e8f2a868d210dc17 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef editor_h__
-#define editor_h__
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#include <wtf/Forward.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/RefPtr.h>
+
+#include "Frame.h"
 
 namespace WebCore {
 
+class DeleteButtonController;
+class EditorClient;
 class Frame;
+class HTMLElement;
 class Range;
-class EditorClient;
+class Selection;
 
 // make platform-specific and implement - this is temporary placeholder
 typedef int Pasteboard;
 
 class Editor {
 public:
-    Editor(Frame* frame, EditorClient* client);
+    Editor(Frame*, PassRefPtr<EditorClient>);
     ~Editor();
 
     void cut();
@@ -45,30 +54,42 @@ public:
     void paste();
     void performDelete();
 
+    bool shouldShowDeleteInterface(HTMLElement*);
+
+    void respondToChangedSelection(const Selection& oldSelection);
+    void respondToChangedContents();
+    
+    Frame::TriState selectionUnorderedListState() const;
+    Frame::TriState selectionOrderedListState() const;
+
+    Frame* frame() const { return m_frame; }
+    DeleteButtonController* deleteButtonController() const { return m_deleteButtonController.get(); }
+
 private:
     Frame* m_frame;
-    EditorClient* m_client;
-    
+    RefPtr<EditorClient> m_client;
+    OwnPtr<DeleteButtonController> m_deleteButtonController;
+
     bool canCopy();
     bool canCut();
     bool canDelete();
-    bool canDeleteRange(Range* range);
+    bool canDeleteRange(Range*);
     bool canPaste();
     bool canSmartCopyOrDelete();
     bool isSelectionRichlyEditable();
     Range* selectedRange();
-    bool shouldDeleteRange(Range* range);
+    bool shouldDeleteRange(Range*);
     bool tryDHTMLCopy();
     bool tryDHTMLCut();
     bool tryDHTMLPaste();
     void deleteSelection();
     void deleteSelectionWithSmartDelete(bool enabled);
-    void pasteAsPlainTextWithPasteboard(Pasteboard pasteboard);
-    void pasteWithPasteboard(Pasteboard pasteboard, bool allowPlainText);
-    void writeSelectionToPasteboard(Pasteboard pasteboard);
+    void pasteAsPlainTextWithPasteboard(Pasteboard);
+    void pasteWithPasteboard(Pasteboard, bool allowPlainText);
+    void writeSelectionToPasteboard(Pasteboard);
 
 };
 
 } // namespace WebCore
 
-#endif // editor_h__
+#endif // EDITOR_H