Applets
launcher.h
Go to the documentation of this file.00001 /* 00002 Copyright 2007 Robert Knight <robertknight@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef LAUNCHER_H 00021 #define LAUNCHER_H 00022 00023 // Qt 00024 #include <QWidget> 00025 00026 // Plasma 00027 #include <Plasma/Applet> 00028 00029 namespace Kickoff 00030 { 00031 00037 class Launcher : public QWidget 00038 { 00039 Q_OBJECT 00040 00041 public: 00043 explicit Launcher(QWidget *parent = 0); 00045 explicit Launcher(Plasma::Applet *applet = 0); 00046 ~Launcher(); 00047 00049 void setAutoHide(bool autoHide); 00050 bool autoHide() const; 00051 00053 void setSwitchTabsOnHover(bool switchOnHover); 00054 bool switchTabsOnHover() const; 00055 00057 void setVisibleItemCount(int count); 00058 int visibleItemCount() const; 00059 00061 void setApplet(Plasma::Applet *applet); 00062 00064 void setLauncherOrigin(const Plasma::PopupPlacement placement, Plasma::Location location); 00065 00066 // reimplemented 00067 virtual bool eventFilter(QObject *object, QEvent *event); 00068 virtual QSize minimumSizeHint() const; 00069 virtual QSize sizeHint() const; 00070 00073 void reset(); 00074 00075 signals: 00076 void aboutToHide(); 00077 void configNeedsSaving(); 00078 00079 protected: 00080 virtual void keyPressEvent(QKeyEvent *event); 00081 virtual void showEvent(QShowEvent *event); 00082 virtual void hideEvent(QHideEvent *event); 00083 00084 private Q_SLOTS: 00085 void focusSearchView(const QString& query); 00086 void showViewContextMenu(const QPoint& pos); 00087 void focusFavoritesView(); 00088 void resultsAvailable(); 00089 void updateThemedPalette(); 00090 00091 private: 00092 void init(); 00093 00094 class Private; 00095 Private * const d; 00096 }; 00097 00098 } 00099 00100 #endif // LAUNCHER_H