2 Copyright 2007 Robert Knight <robertknight@gmail.com>
3 Copyright 2008 Sebastian Sauer <mail@dipe.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef SIMPLEAPPLET_H
22 #define SIMPLEAPPLET_H
25 #include <Plasma/Applet>
30 * The MenuLauncherApplet class implements an applet that provides the traditional
31 * aka classic KDE3 like KMenu application launcher using the Kickoff functionality.
33 class MenuLauncherApplet
: public Plasma::Applet
41 * The menu we like to display.
44 Combined
= 0, ///< Standard Menu
45 Favorites
, ///< Favorites Menu
46 Applications
, ///< Applications Menu
47 Computer
, ///< Computer Menu
48 RecentlyUsed
, ///< Recently Used Menu
49 Bookmarks
, ///< Bookmarks Menu
54 * How the text of the menuitems got formatted.
57 Name
= 0, ///< Name only
58 Description
, ///< Description only
59 NameDescription
, ///< Name Description
60 DescriptionName
, ///< Description (Name)
61 NameDashDescription
///< Name - Description
67 * \param parent The parent QObject.
68 * \param args The optional list of arguments.
70 MenuLauncherApplet(QObject
*parent
, const QVariantList
&args
);
75 virtual ~MenuLauncherApplet();
78 * This method is called once the applet is loaded and added to a Corona.
83 * Called when any of the geometry constraints have been updated.
85 * @param constraints the type of constraints that were updated
87 void constraintsEvent(Plasma::Constraints constraints
);
90 * Returns a list of context-related QAction instances.
92 virtual QList
<QAction
*> contextualActions();
96 * Switch the menu style from the traditional aka classic KDE3 like
97 * KMenu to the new Kickoff menu.
99 void switchMenuStyle();
101 void startMenuEditor();
105 * Create a configuration dialog.
107 void createConfigurationInterface(KConfigDialog
*parent
);
110 void configAccepted();
111 void toggleMenu(bool pressed
);
113 void actionTriggered(QAction
*action
);
120 K_EXPORT_PLASMA_APPLET(menulauncher
, MenuLauncherApplet
)