Backed out changeset b4a0f8afc02e (bug 1857946) for causing bc failures at browser...
[gecko.git] / widget / cocoa / nsMenuParentX.h
bloba1f705631ab517436bc8a43d94943ef79c2c6e2a
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 nsMenuParentX_h_
7 #define nsMenuParentX_h_
9 #include "mozilla/RefPtr.h"
10 #include "mozilla/Variant.h"
12 class nsMenuX;
13 class nsMenuBarX;
14 class nsMenuItemX;
16 // A base class for objects that can be the parent of an nsMenuX or nsMenuItemX.
17 class nsMenuParentX {
18 public:
19 using MenuChild = mozilla::Variant<RefPtr<nsMenuX>, RefPtr<nsMenuItemX>>;
21 // XXXmstange double-check that this is still needed
22 virtual nsMenuBarX* AsMenuBar() { return nullptr; }
24 // Called when aChild becomes visible or hidden, so that the parent can insert
25 // or remove the child's native menu item from its NSMenu and update its state
26 // of visible items.
27 virtual void MenuChildChangedVisibility(const MenuChild& aChild,
28 bool aIsVisible) = 0;
31 #endif // nsMenuParentX_h_