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 nsMenuUtilsX_h_ michael@0: #define nsMenuUtilsX_h_ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsMenuBaseX.h" michael@0: michael@0: #import michael@0: michael@0: class nsIContent; michael@0: class nsString; michael@0: class nsMenuBarX; michael@0: michael@0: // Namespace containing utility functions used in our native menu implementation. michael@0: namespace nsMenuUtilsX michael@0: { michael@0: void DispatchCommandTo(nsIContent* aTargetContent); michael@0: NSString* GetTruncatedCocoaLabel(const nsString& itemLabel); michael@0: uint8_t GeckoModifiersForNodeAttribute(const nsString& modifiersAttribute); michael@0: unsigned int MacModifiersForGeckoModifiers(uint8_t geckoModifiers); michael@0: nsMenuBarX* GetHiddenWindowMenuBar(); // returned object is not retained michael@0: NSMenuItem* GetStandardEditMenuItem(); // returned object is not retained michael@0: bool NodeIsHiddenOrCollapsed(nsIContent* inContent); michael@0: int CalculateNativeInsertionPoint(nsMenuObjectX* aParent, nsMenuObjectX* aChild); michael@0: } michael@0: michael@0: #endif // nsMenuUtilsX_h_