michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsCommandManager_h__ michael@0: #define nsCommandManager_h__ michael@0: michael@0: michael@0: #include "nsString.h" michael@0: #include "nsClassHashtable.h" michael@0: #include "nsWeakReference.h" michael@0: michael@0: #include "nsICommandManager.h" michael@0: #include "nsPICommandUpdater.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: michael@0: class nsIController; michael@0: template class nsCOMArray; michael@0: michael@0: michael@0: class nsCommandManager : public nsICommandManager, michael@0: public nsPICommandUpdater, michael@0: public nsSupportsWeakReference michael@0: michael@0: { michael@0: public: michael@0: typedef nsTArray > ObserverList; michael@0: michael@0: nsCommandManager(); michael@0: virtual ~nsCommandManager(); michael@0: michael@0: // nsISupports michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsCommandManager, nsICommandManager) michael@0: michael@0: // nsICommandManager michael@0: NS_DECL_NSICOMMANDMANAGER michael@0: michael@0: // nsPICommandUpdater michael@0: NS_DECL_NSPICOMMANDUPDATER michael@0: michael@0: michael@0: protected: michael@0: michael@0: michael@0: nsresult IsCallerChrome(bool *aIsCallerChrome); michael@0: nsresult GetControllerForCommand(const char * aCommand, michael@0: nsIDOMWindow *aDirectedToThisWindow, michael@0: nsIController** outController); michael@0: michael@0: michael@0: protected: michael@0: nsClassHashtable mObserversTable; michael@0: michael@0: nsIDOMWindow* mWindow; // weak ptr. The window should always outlive us michael@0: }; michael@0: michael@0: michael@0: #endif // nsCommandManager_h__