Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / widget / cocoa / nsMenuGroupOwnerX.h
blob8408a582f92d7b7fd387e4f301fb04aa2f9d9e59
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 nsMenuGroupOwnerX_h_
7 #define nsMenuGroupOwnerX_h_
9 #import <Cocoa/Cocoa.h>
11 #include "nsMenuBaseX.h"
12 #include "nsIMutationObserver.h"
13 #include "nsHashKeys.h"
14 #include "nsDataHashtable.h"
15 #include "nsAutoPtr.h"
16 #include "nsString.h"
19 class nsMenuX;
20 class nsMenuItemX;
21 class nsChangeObserver;
22 class nsIWidget;
23 class nsIContent;
24 class nsIDocument;
26 class nsMenuGroupOwnerX : public nsMenuObjectX, public nsIMutationObserver
28 public:
29 nsMenuGroupOwnerX();
31 nsresult Create(nsIContent * aContent);
33 void RegisterForContentChanges(nsIContent* aContent,
34 nsChangeObserver* aMenuObject);
35 void UnregisterForContentChanges(nsIContent* aContent);
36 uint32_t RegisterForCommand(nsMenuItemX* aItem);
37 void UnregisterCommand(uint32_t aCommandID);
38 nsMenuItemX* GetMenuItemForCommandID(uint32_t inCommandID);
40 NS_DECL_ISUPPORTS
41 NS_DECL_NSIMUTATIONOBSERVER
43 protected:
44 virtual ~nsMenuGroupOwnerX();
46 nsChangeObserver* LookupContentChangeObserver(nsIContent* aContent);
48 uint32_t mCurrentCommandID; // unique command id (per menu-bar) to
49 // give to next item that asks
50 nsIDocument* mDocument; // pointer to document
52 // stores observers for content change notification
53 nsDataHashtable<nsPtrHashKey<nsIContent>, nsChangeObserver *> mContentToObserverTable;
55 // stores mapping of command IDs to menu objects
56 nsDataHashtable<nsUint32HashKey, nsMenuItemX *> mCommandToMenuObjectTable;
59 #endif // nsMenuGroupOwner_h_