libyui-mga-gtk  1.1.0
YMGAGMenuBar.h
1 /*
2  Copyright 2020 by Angelo Naselli <anaselli at linux dot it>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as
6  published by the Free Software Foundation; either version 2.1 of the
7  License, or (at your option) version 3.0 of the License. This library
8  is distributed in the hope that it will be useful, but WITHOUT ANY
9  WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11  License for more details. You should have received a copy of the GNU
12  Lesser General Public License along with this library; if not, write
13  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
14  Floor, Boston, MA 02110-1301 USA
15 */
16 
17 /*-/
18 
19  File: YMGAGMenuBar.h
20 
21  Author: Angelo Naselli <anaselli@linux.it>
22 
23 /-*/
24 
25 #ifndef YMGAGMenuBar_h
26 #define YMGAGMenuBar_h
27 
28 
29 #include <yui/mga/YMGAMenuBar.h>
30 #include <yui/gtk/ygtktreeview.h>
31 
32 #include <yui/gtk/YGSelectionStore.h>
33 #include <yui/gtk/YGWidget.h>
34 
35 #include <gtk/gtk.h>
36 
37 
38 
39 class YMGAGMenuBar : public YMGAMenuBar, public YGWidget
40 {
41 public:
42 
43  YMGAGMenuBar ( YWidget *parent );
44 
45  virtual ~YMGAGMenuBar ( );
46 
47  /**
48  * Add an YMenuItem first item represents the menu name, other sub items menu entries
49  *
50  * Reimplemented from YSelectionWidget.
51  **/
52  virtual void addItem( YItem * item );
53 
54  /**
55  * Enable YMGAMenuItem (menu name or menu entry) to enable/disable it into menubar or menu
56  *
57  * Reimplemented from YMGAMenuBar.
58  **/
59  virtual void enableItem(YItem * menu_item, bool enable=true);
60 
61  /**
62  * Hide YMGAMenuItem (menu name or menu entry) to hide/show it into menubar or menu
63  *
64  * Reimplemented from YMGAMenuBar.
65  **/
66  virtual void hideItem(YItem * menu_item, bool invisible=true);
67 
68  /**
69  * Delete all items.
70  *
71  * Reimplemented from YSelectionWidget
72  **/
73  virtual void deleteAllItems();
74 
75  YGWIDGET_IMPL_COMMON (YMGAMenuBar)
76 
77 
78 private:
79  struct Private;
80  Private *d;
81 
82  void doCreateMenu (GtkWidget *menu, YItemIterator begin, YItemIterator end);
83 };
84 
85 #endif // YMGAGMenuBar_h
YMGAGMenuBar
Definition: YMGAGMenuBar.h:40
YMGAGMenuBar::deleteAllItems
virtual void deleteAllItems()
Delete all items.
Definition: YMGAGMenuBar.cc:248
YMGAGMenuBar::enableItem
virtual void enableItem(YItem *menu_item, bool enable=true)
Enable YMGAMenuItem (menu name or menu entry) to enable/disable it into menubar or menu.
Definition: YMGAGMenuBar.cc:207
YMGAGMenuBar::hideItem
virtual void hideItem(YItem *menu_item, bool invisible=true)
Hide YMGAMenuItem (menu name or menu entry) to hide/show it into menubar or menu.
Definition: YMGAGMenuBar.cc:223
YMGAGMenuBar::addItem
virtual void addItem(YItem *item)
Add an YMenuItem first item represents the menu name, other sub items menu entries.
Definition: YMGAGMenuBar.cc:170
YMGAGMenuBar::Private
Definition: YMGAGMenuBar.cc:60