openshot-audio  0.1.4
juce_MenuBarModel.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_MENUBARMODEL_H_INCLUDED
26 #define JUCE_MENUBARMODEL_H_INCLUDED
27 
28 
29 //==============================================================================
40 {
41 public:
42  //==============================================================================
44 
46  virtual ~MenuBarModel();
47 
48  //==============================================================================
61  void menuItemsChanged();
62 
69  void setApplicationCommandManagerToWatch (ApplicationCommandManager* manager) noexcept;
70 
71  //==============================================================================
77  {
78  public:
80  virtual ~Listener() {}
81 
82  //==============================================================================
84  virtual void menuBarItemsChanged (MenuBarModel* menuBarModel) = 0;
85 
89  virtual void menuCommandInvoked (MenuBarModel* menuBarModel,
91  };
92 
100  void addListener (Listener* listenerToAdd) noexcept;
101 
105  void removeListener (Listener* listenerToRemove) noexcept;
106 
107  //==============================================================================
109  virtual StringArray getMenuBarNames() = 0;
110 
116  virtual PopupMenu getMenuForIndex (int topLevelMenuIndex,
117  const String& menuName) = 0;
118 
126  virtual void menuItemSelected (int menuItemID,
127  int topLevelMenuIndex) = 0;
128 
129  //==============================================================================
130  #if JUCE_MAC || DOXYGEN
131 
148  static void setMacMainMenu (MenuBarModel* newMenuBarModel,
149  const PopupMenu* extraAppleMenuItems = nullptr,
150  const String& recentItemsMenuName = String::empty);
151 
155  static MenuBarModel* getMacMainMenu();
156 
160  static const PopupMenu* getMacExtraAppleItemsMenu();
161  #endif
162 
163  //==============================================================================
165  void applicationCommandInvoked (const ApplicationCommandTarget::InvocationInfo&) override;
167  void applicationCommandListChanged() override;
169  void handleAsyncUpdate() override;
170 
171 private:
172  ApplicationCommandManager* manager;
173  ListenerList<Listener> listeners;
174 
176 };
177 
180 
181 
182 #endif // JUCE_MENUBARMODEL_H_INCLUDED
Definition: juce_ApplicationCommandManager.h:84
Definition: juce_PopupMenu.h:77
static const String empty
Definition: juce_String.h:152
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_MenuBarModel.h:38
virtual ~Listener()
Definition: juce_MenuBarModel.h:80
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_AsyncUpdater.h:39
Definition: juce_ApplicationCommandTarget.h:58
Definition: juce_ListenerList.h:69
Definition: juce_MenuBarModel.h:76
Definition: juce_StringArray.h:39
MenuBarModel::Listener MenuBarModelListener
Definition: juce_MenuBarModel.h:179
Definition: juce_ApplicationCommandManager.h:331
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198