]> git.mxchange.org Git - flightgear.git/blob - src/GUI/FGCocoaMenuBar.hxx
Support for multiple data dirs.
[flightgear.git] / src / GUI / FGCocoaMenuBar.hxx
1 // menubar.hxx - XML-configured menu bar.
2
3 #ifndef FG_COCOA_MENUBAR_HXX
4 #define FG_COCOA_MENUBAR_HXX 1
5
6 #include <GUI/menubar.hxx>
7
8 #include <memory>
9
10 /**
11  * XML-configured Cocoa menu bar.
12  *
13  * This class creates a menu bar from a tree of XML properties.  These
14  * properties are not part of the main FlightGear property tree, but
15  * are read from a separate file ($FG_ROOT/gui/menubar.xml).
16  *
17  * WARNING: because PUI provides no easy way to attach user data to a
18  * menu item, all menu item strings must be unique; otherwise, this
19  * class will always use the first binding with any given name.
20  */
21 class FGCocoaMenuBar : public FGMenuBar
22 {
23 public:
24   
25   /**
26    * Constructor.
27    */
28   FGCocoaMenuBar ();
29   
30   
31   /**
32    * Destructor.
33    */
34   virtual ~FGCocoaMenuBar ();
35   
36   
37   /**
38    * Initialize the menu bar from $FG_ROOT/gui/menubar.xml
39    */
40   virtual void init ();
41   
42   /**
43    * Make the menu bar visible.
44    */
45   virtual void show ();
46   
47   
48   /**
49    * Make the menu bar invisible.
50    */
51   virtual void hide ();
52   
53   
54   /**
55    * Test whether the menu bar is visible.
56    */
57   virtual bool isVisible () const;
58   
59   class CocoaMenuBarPrivate;
60 private:
61   std::auto_ptr<CocoaMenuBarPrivate> p;
62   
63 };
64
65 /**
66  * open a URL using the system's web-browser
67  */
68 void cocoaOpenUrl(const std::string& url);
69
70 #endif // __MENUBAR_HXX