libyui  3.12.1
YMenuItem.cc
1 /*
2  Copyright (c) [2020] SUSE LLC
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: YMenuItem.cc
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #include "YMenuItem.h"
27 
28 
29 YMenuItem * YMenuItem::addItem( const std::string & label,
30  const std::string & iconName )
31 {
32  return new YMenuItem( this, label, iconName );
33 }
34 
35 
36 YMenuItem * YMenuItem::addMenu( const std::string & label,
37  const std::string & iconName )
38 {
39  return new YMenuItem( this, label, iconName );
40 }
41 
42 
44 {
45  return new YMenuItem( this, "" );
46 }
YItem::label
std::string label() const
Return this item's label.
Definition: YItem.h:97
YMenuItem::YMenuItem
YMenuItem(const std::string &label, const std::string &iconName="")
Constructor for toplevel items.
Definition: YMenuItem.h:49
YMenuItem::addMenu
YMenuItem * addMenu(const std::string &label, const std::string &iconName="")
Create a new submenu as a child of the current instance and return it.
Definition: YMenuItem.cc:36
YMenuItem::addSeparator
YMenuItem * addSeparator()
Create a menu separator as a child of the current instance and return it.
Definition: YMenuItem.cc:43
YItem::iconName
std::string iconName() const
Return this item's icon name.
Definition: YItem.h:107
YMenuItem::addItem
YMenuItem * addItem(const std::string &label, const std::string &iconName="")
Create a new menu item as a child of the current instance and return it.
Definition: YMenuItem.cc:29
YMenuItem
Item class for menu items.
Definition: YMenuItem.h:44