gecko/editor/composer/nsComposerCommandsUpdater.h
Birunthan Mohanathas 38684fe721 Bug 1028565 - Part 1: Flatten editor/composer/{public,src}/ directories. r=ehsan
--HG--
rename : editor/composer/src/crashtests/351236-1.html => editor/composer/crashtests/351236-1.html
rename : editor/composer/src/crashtests/407062-1.html => editor/composer/crashtests/407062-1.html
rename : editor/composer/src/crashtests/419563-1.xhtml => editor/composer/crashtests/419563-1.xhtml
rename : editor/composer/src/crashtests/428844-1-inner.xhtml => editor/composer/crashtests/428844-1-inner.xhtml
rename : editor/composer/src/crashtests/428844-1.html => editor/composer/crashtests/428844-1.html
rename : editor/composer/src/crashtests/461049-1.html => editor/composer/crashtests/461049-1.html
rename : editor/composer/src/crashtests/crashtests.list => editor/composer/crashtests/crashtests.list
rename : editor/composer/src/crashtests/removing-editable-xslt-inner.xhtml => editor/composer/crashtests/removing-editable-xslt-inner.xhtml
rename : editor/composer/src/crashtests/removing-editable-xslt.html => editor/composer/crashtests/removing-editable-xslt.html
rename : editor/composer/src/nsComposeTxtSrvFilter.cpp => editor/composer/nsComposeTxtSrvFilter.cpp
rename : editor/composer/src/nsComposeTxtSrvFilter.h => editor/composer/nsComposeTxtSrvFilter.h
rename : editor/composer/src/nsComposerCommands.cpp => editor/composer/nsComposerCommands.cpp
rename : editor/composer/src/nsComposerCommands.h => editor/composer/nsComposerCommands.h
rename : editor/composer/src/nsComposerCommandsUpdater.cpp => editor/composer/nsComposerCommandsUpdater.cpp
rename : editor/composer/src/nsComposerCommandsUpdater.h => editor/composer/nsComposerCommandsUpdater.h
rename : editor/composer/src/nsComposerController.cpp => editor/composer/nsComposerController.cpp
rename : editor/composer/src/nsComposerController.h => editor/composer/nsComposerController.h
rename : editor/composer/src/nsComposerDocumentCommands.cpp => editor/composer/nsComposerDocumentCommands.cpp
rename : editor/composer/src/nsComposerRegistration.cpp => editor/composer/nsComposerRegistration.cpp
rename : editor/composer/src/nsEditingSession.cpp => editor/composer/nsEditingSession.cpp
rename : editor/composer/src/nsEditingSession.h => editor/composer/nsEditingSession.h
rename : editor/composer/src/nsEditorSpellCheck.cpp => editor/composer/nsEditorSpellCheck.cpp
rename : editor/composer/src/nsEditorSpellCheck.h => editor/composer/nsEditorSpellCheck.h
rename : editor/composer/public/nsIEditingSession.idl => editor/composer/nsIEditingSession.idl
rename : editor/composer/src/res/EditorOverride.css => editor/composer/res/EditorOverride.css
rename : editor/composer/src/res/grabber.gif => editor/composer/res/grabber.gif
rename : editor/composer/src/res/table-add-column-after-active.gif => editor/composer/res/table-add-column-after-active.gif
rename : editor/composer/src/res/table-add-column-after-hover.gif => editor/composer/res/table-add-column-after-hover.gif
rename : editor/composer/src/res/table-add-column-after.gif => editor/composer/res/table-add-column-after.gif
rename : editor/composer/src/res/table-add-column-before-active.gif => editor/composer/res/table-add-column-before-active.gif
rename : editor/composer/src/res/table-add-column-before-hover.gif => editor/composer/res/table-add-column-before-hover.gif
rename : editor/composer/src/res/table-add-column-before.gif => editor/composer/res/table-add-column-before.gif
rename : editor/composer/src/res/table-add-row-after-active.gif => editor/composer/res/table-add-row-after-active.gif
rename : editor/composer/src/res/table-add-row-after-hover.gif => editor/composer/res/table-add-row-after-hover.gif
rename : editor/composer/src/res/table-add-row-after.gif => editor/composer/res/table-add-row-after.gif
rename : editor/composer/src/res/table-add-row-before-active.gif => editor/composer/res/table-add-row-before-active.gif
rename : editor/composer/src/res/table-add-row-before-hover.gif => editor/composer/res/table-add-row-before-hover.gif
rename : editor/composer/src/res/table-add-row-before.gif => editor/composer/res/table-add-row-before.gif
rename : editor/composer/src/res/table-remove-column-active.gif => editor/composer/res/table-remove-column-active.gif
rename : editor/composer/src/res/table-remove-column-hover.gif => editor/composer/res/table-remove-column-hover.gif
rename : editor/composer/src/res/table-remove-column.gif => editor/composer/res/table-remove-column.gif
rename : editor/composer/src/res/table-remove-row-active.gif => editor/composer/res/table-remove-row-active.gif
rename : editor/composer/src/res/table-remove-row-hover.gif => editor/composer/res/table-remove-row-hover.gif
rename : editor/composer/src/res/table-remove-row.gif => editor/composer/res/table-remove-row.gif
rename : editor/composer/src/res/text_caret.png => editor/composer/res/text_caret.png
rename : editor/composer/src/res/text_caret@1.5x.png => editor/composer/res/text_caret@1.5x.png
rename : editor/composer/src/res/text_caret@2.25x.png => editor/composer/res/text_caret@2.25x.png
rename : editor/composer/src/res/text_caret@2x.png => editor/composer/res/text_caret@2x.png
rename : editor/composer/src/res/text_caret_tilt_left.png => editor/composer/res/text_caret_tilt_left.png
rename : editor/composer/src/res/text_caret_tilt_left@1.5x.png => editor/composer/res/text_caret_tilt_left@1.5x.png
rename : editor/composer/src/res/text_caret_tilt_left@2.25x.png => editor/composer/res/text_caret_tilt_left@2.25x.png
rename : editor/composer/src/res/text_caret_tilt_left@2x.png => editor/composer/res/text_caret_tilt_left@2x.png
rename : editor/composer/src/res/text_caret_tilt_right.png => editor/composer/res/text_caret_tilt_right.png
rename : editor/composer/src/res/text_caret_tilt_right@1.5x.png => editor/composer/res/text_caret_tilt_right@1.5x.png
rename : editor/composer/src/res/text_caret_tilt_right@2.25x.png => editor/composer/res/text_caret_tilt_right@2.25x.png
rename : editor/composer/src/res/text_caret_tilt_right@2x.png => editor/composer/res/text_caret_tilt_right@2x.png
rename : editor/composer/src/res/text_selection_handle.png => editor/composer/res/text_selection_handle.png
rename : editor/composer/src/res/text_selection_handle@1.5.png => editor/composer/res/text_selection_handle@1.5.png
rename : editor/composer/src/res/text_selection_handle@2.png => editor/composer/res/text_selection_handle@2.png
2014-06-25 15:08:20 -07:00

103 lines
3.7 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsComposerCommandsUpdater_h__
#define nsComposerCommandsUpdater_h__
#include "nsCOMPtr.h" // for already_AddRefed, nsCOMPtr
#include "nsIDocumentStateListener.h"
#include "nsISelectionListener.h"
#include "nsISupportsImpl.h" // for NS_DECL_ISUPPORTS
#include "nsITimer.h" // for NS_DECL_NSITIMERCALLBACK, etc
#include "nsITransactionListener.h" // for nsITransactionListener
#include "nsIWeakReferenceUtils.h" // for nsWeakPtr
#include "nscore.h" // for NS_IMETHOD, nsresult, etc
class nsIDOMWindow;
class nsITransaction;
class nsITransactionManager;
class nsPICommandUpdater;
class nsComposerCommandsUpdater : public nsISelectionListener,
public nsIDocumentStateListener,
public nsITransactionListener,
public nsITimerCallback
{
public:
nsComposerCommandsUpdater();
// nsISupports
NS_DECL_ISUPPORTS
// nsISelectionListener
NS_DECL_NSISELECTIONLISTENER
// nsIDocumentStateListener
NS_DECL_NSIDOCUMENTSTATELISTENER
// nsITimerCallback interfaces
NS_DECL_NSITIMERCALLBACK
/** nsITransactionListener interfaces
*/
NS_IMETHOD WillDo(nsITransactionManager *aManager, nsITransaction *aTransaction, bool *aInterrupt);
NS_IMETHOD DidDo(nsITransactionManager *aManager, nsITransaction *aTransaction, nsresult aDoResult);
NS_IMETHOD WillUndo(nsITransactionManager *aManager, nsITransaction *aTransaction, bool *aInterrupt);
NS_IMETHOD DidUndo(nsITransactionManager *aManager, nsITransaction *aTransaction, nsresult aUndoResult);
NS_IMETHOD WillRedo(nsITransactionManager *aManager, nsITransaction *aTransaction, bool *aInterrupt);
NS_IMETHOD DidRedo(nsITransactionManager *aManager, nsITransaction *aTransaction, nsresult aRedoResult);
NS_IMETHOD WillBeginBatch(nsITransactionManager *aManager, bool *aInterrupt);
NS_IMETHOD DidBeginBatch(nsITransactionManager *aManager, nsresult aResult);
NS_IMETHOD WillEndBatch(nsITransactionManager *aManager, bool *aInterrupt);
NS_IMETHOD DidEndBatch(nsITransactionManager *aManager, nsresult aResult);
NS_IMETHOD WillMerge(nsITransactionManager *aManager, nsITransaction *aTopTransaction,
nsITransaction *aTransactionToMerge, bool *aInterrupt);
NS_IMETHOD DidMerge(nsITransactionManager *aManager, nsITransaction *aTopTransaction,
nsITransaction *aTransactionToMerge,
bool aDidMerge, nsresult aMergeResult);
nsresult Init(nsIDOMWindow* aDOMWindow);
protected:
virtual ~nsComposerCommandsUpdater();
enum {
eStateUninitialized = -1,
eStateOff = false,
eStateOn = true
};
bool SelectionIsCollapsed();
nsresult UpdateDirtyState(bool aNowDirty);
nsresult UpdateOneCommand(const char* aCommand);
nsresult UpdateCommandGroup(const nsAString& aCommandGroup);
already_AddRefed<nsPICommandUpdater> GetCommandUpdater();
nsresult PrimeUpdateTimer();
void TimerCallback();
nsCOMPtr<nsITimer> mUpdateTimer;
nsWeakPtr mDOMWindow;
nsWeakPtr mDocShell;
int8_t mDirtyState;
int8_t mSelectionCollapsed;
bool mFirstDoOfFirstUndo;
};
extern "C" nsresult NS_NewComposerCommandsUpdater(nsISelectionListener** aInstancePtrResult);
#endif // nsComposerCommandsUpdater_h__