2 Copyright 2007 Robert Knight <robertknight@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
27 #include <Plasma/Applet>
33 * The main window class for the Kickoff launcher. This class is responsible
34 * for creating the various tabs, views and models which make up the launcher's
37 class Launcher
: public QWidget
42 /** Construct a new Launcher with the specified parent. */
43 explicit Launcher(QWidget
*parent
= 0);
44 /** Construct a new Launcher associated with the specified Plasma::Applet. */
45 explicit Launcher(Plasma::Applet
*applet
= 0);
48 /** Specifies whether the launcher should hide itself when an item is activated. */
49 void setAutoHide(bool autoHide
);
50 bool autoHide() const;
52 /** Specifies whether hovering switches between tabs or if a click is required to switch the tabs. */
53 void setSwitchTabsOnHover(bool switchOnHover
);
54 bool switchTabsOnHover() const;
56 /** Specifies the number of visible items used to determinate the visible height. */
57 void setVisibleItemCount(int count
);
58 int visibleItemCount() const;
60 /** Specifies the plasma applet the launcher is working on. */
61 void setApplet(Plasma::Applet
*applet
);
63 /** Specifies the direction the launcher is popping up in relative to its icon */
64 void setLauncherOrigin(const Plasma::PopupPlacement placement
, Plasma::Location location
);
67 virtual bool eventFilter(QObject
*object
, QEvent
*event
);
68 virtual QSize
minimumSizeHint() const;
69 virtual QSize
sizeHint() const;
71 /** Reset the launcher. This is called e.g. by the Kickoff-applet before shown to be sure
72 we don't display old searches and switch back to the favorite-view. */
77 void configNeedsSaving();
80 virtual void keyPressEvent(QKeyEvent
*event
);
81 virtual void showEvent(QShowEvent
*event
);
82 virtual void hideEvent(QHideEvent
*event
);
85 void focusSearchView(const QString
& query
);
86 void showViewContextMenu(const QPoint
& pos
);
87 void focusFavoritesView();
88 void resultsAvailable();
89 void updateThemedPalette();