widget/cocoa/nsMenuGroupOwnerX.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
    27 {
    28 public:
    29   nsMenuGroupOwnerX();
    30   virtual ~nsMenuGroupOwnerX();
    32   nsresult Create(nsIContent * aContent);
    34   void RegisterForContentChanges(nsIContent* aContent,
    35                                  nsChangeObserver* aMenuObject);
    36   void UnregisterForContentChanges(nsIContent* aContent);
    37   uint32_t RegisterForCommand(nsMenuItemX* aItem);
    38   void UnregisterCommand(uint32_t aCommandID);
    39   nsMenuItemX* GetMenuItemForCommandID(uint32_t inCommandID);
    41   NS_DECL_ISUPPORTS
    42   NS_DECL_NSIMUTATIONOBSERVER
    44 protected:
    45   nsChangeObserver* LookupContentChangeObserver(nsIContent* aContent);
    47   uint32_t  mCurrentCommandID;  // unique command id (per menu-bar) to
    48                                 // give to next item that asks
    49   nsIDocument* mDocument;       // pointer to document
    51   // stores observers for content change notification
    52   nsDataHashtable<nsPtrHashKey<nsIContent>, nsChangeObserver *> mContentToObserverTable;
    54   // stores mapping of command IDs to menu objects
    55   nsDataHashtable<nsUint32HashKey, nsMenuItemX *> mCommandToMenuObjectTable;
    56 };
    58 #endif // nsMenuGroupOwner_h_

mercurial