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.h> 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( QPoint pos, Plasma::Location location ); 00065 QPoint launcherOrigin() const; 00066 00067 // reimplemented 00068 virtual bool eventFilter(QObject *object, QEvent *event); 00069 virtual QSize minimumSizeHint() const; 00070 virtual QSize sizeHint() const; 00071 00074 void reset(); 00075 00076 signals: 00077 void aboutToHide(); 00078 void configNeedsSaving(); 00079 00080 protected: 00081 virtual void keyPressEvent(QKeyEvent *event); 00082 virtual void showEvent(QShowEvent *event); 00083 virtual void hideEvent(QHideEvent *event); 00084 virtual void moveEvent(QMoveEvent *event); 00085 virtual void paintEvent(QPaintEvent *event); 00086 virtual void resizeEvent(QResizeEvent *e); 00087 virtual void mousePressEvent(QMouseEvent *e); 00088 virtual void mouseReleaseEvent(QMouseEvent *e); 00089 virtual void mouseMoveEvent(QMouseEvent *e); 00090 00091 private Q_SLOTS: 00092 void focusSearchView(const QString& query); 00093 void showViewContextMenu(const QPoint& pos); 00094 void focusFavoritesView(); 00095 void openHomepage(); 00096 void resultsAvailable(); 00097 00098 private: 00099 void init(); 00100 00101 class Private; 00102 Private * const d; 00103 }; 00104 00105 } 00106 00107 #endif // LAUNCHER_H