libyui
 
Loading...
Searching...
No Matches
YContextMenu.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: YContextMenu.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25#ifndef YContextMenu_h
26#define YContextMenu_h
27
28#include "YSelectionWidget.h"
29#include "YMenuItem.h"
30
31class YMenuItem;
33
34
52{
53protected:
61
62public:
66 virtual ~YContextMenu();
67
72 virtual const char * widgetClass() const { return "YContextMenu"; }
73
82 virtual void rebuildMenuTree() = 0;
83
94 virtual void addItems( const YItemCollection & itemCollection );
95
106 virtual void addItem( YItem * item_disown );
107
113 virtual void deleteAllItems();
114
123
134 virtual bool setProperty( const std::string & propertyName,
135 const YPropertyValue & val );
136
143 virtual YPropertyValue getProperty( const std::string & propertyName );
144
151 virtual const YPropertySet & propertySet();
152
153protected:
154
159 YMenuItem * findMenuItem( int index );
160
168
173 YMenuItem * itemAt( int index )
174 { return findMenuItem( index ); }
175
176private:
177
181 void assignUniqueIndex( YItemIterator begin, YItemIterator end );
182
183
185};
186
187
188#endif // YContextMenu_h
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
Definition YItem.h:45
YItemCollection::iterator YItemIterator
Mutable iterator over YItemCollection.
Definition YItem.h:42
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
Definition YItem.h:39
Definition ImplPtr.h:43
virtual const char * widgetClass() const
Definition YContextMenu.h:72
virtual const YPropertySet & propertySet()
Definition YContextMenu.cc:155
void resolveShortcutConflicts()
Definition YContextMenu.cc:140
virtual void rebuildMenuTree()=0
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YContextMenu.cc:194
YMenuItem * itemAt(int index)
Definition YContextMenu.h:173
virtual void addItems(const YItemCollection &itemCollection)
Definition YContextMenu.cc:64
YContextMenu()
Definition YContextMenu.cc:48
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YContextMenu.cc:177
virtual ~YContextMenu()
Definition YContextMenu.cc:57
virtual void deleteAllItems()
Definition YContextMenu.cc:99
YMenuItem * findMenuItem(int index)
Definition YContextMenu.cc:107
virtual void addItem(YItem *item_disown)
Definition YContextMenu.cc:73
Definition YItem.h:56
Definition YMenuItem.h:44
Definition YProperty.h:198
Definition YProperty.h:105
YSelectionWidget(YWidget *parent, const std::string &label, bool enforceSingleSelection, bool recursiveSelection=false)
Definition YSelectionWidget.cc:59
YWidgetListIterator end()
Definition YWidget.h:245
YWidgetListIterator begin()
Definition YWidget.h:238
Definition YContextMenu.cc:37