Bumping manifests a=b2g-bump
[gecko.git] / embedding / components / commandhandler / nsCommandManager.h
blob693c1af17aad6c90e842bbeff3704f4d25702404
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__
10 #include "nsString.h"
11 #include "nsClassHashtable.h"
12 #include "nsWeakReference.h"
14 #include "nsICommandManager.h"
15 #include "nsPICommandUpdater.h"
16 #include "nsCycleCollectionParticipant.h"
18 class nsIController;
19 template<class E> class nsCOMArray;
22 class nsCommandManager : public nsICommandManager,
23 public nsPICommandUpdater,
24 public nsSupportsWeakReference
27 public:
28 typedef nsTArray<nsCOMPtr<nsIObserver> > ObserverList;
30 nsCommandManager();
32 // nsISupports
33 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
34 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsCommandManager, nsICommandManager)
36 // nsICommandManager
37 NS_DECL_NSICOMMANDMANAGER
39 // nsPICommandUpdater
40 NS_DECL_NSPICOMMANDUPDATER
43 protected:
44 virtual ~nsCommandManager();
46 nsresult GetControllerForCommand(const char * aCommand,
47 nsIDOMWindow *aDirectedToThisWindow,
48 nsIController** outController);
51 protected:
52 nsClassHashtable<nsCharPtrHashKey, ObserverList> mObserversTable;
54 nsIDOMWindow* mWindow; // weak ptr. The window should always outlive us
58 #endif // nsCommandManager_h__