1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsCommandManager_h__
7 #define nsCommandManager_h__
11 #include "nsClassHashtable.h"
12 #include "nsWeakReference.h"
14 #include "nsICommandManager.h"
15 #include "nsPICommandUpdater.h"
16 #include "nsCycleCollectionParticipant.h"
19 template<class E
> class nsCOMArray
;
22 class nsCommandManager
: public nsICommandManager
,
23 public nsPICommandUpdater
,
24 public nsSupportsWeakReference
28 typedef nsTArray
<nsCOMPtr
<nsIObserver
> > ObserverList
;
33 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
34 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsCommandManager
, nsICommandManager
)
37 NS_DECL_NSICOMMANDMANAGER
40 NS_DECL_NSPICOMMANDUPDATER
44 virtual ~nsCommandManager();
46 nsresult
GetControllerForCommand(const char * aCommand
,
47 nsIDOMWindow
*aDirectedToThisWindow
,
48 nsIController
** outController
);
52 nsClassHashtable
<nsCharPtrHashKey
, ObserverList
> mObserversTable
;
54 nsIDOMWindow
* mWindow
; // weak ptr. The window should always outlive us
58 #endif // nsCommandManager_h__