Plasma
sal.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2007 by Alex Merry <alex.merry@kdemail.net> 00003 * Copyright 2008 by Alexis Ménard <darktears31@gmail.com> 00004 * Copyright 2009 by Marco Martin <notmart@gmail.com> 00005 * Copyright 2009 by Artur Duque de Souza <morpheuz@gmail.com> 00006 * 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Library General Public License version 2, 00010 * or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details 00016 * 00017 * You should have received a copy of the GNU Library General Public 00018 * License along with this program; if not, write to the 00019 * Free Software Foundation, Inc., 00020 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef SEARCHLAUNCH_CONTAINMENT_H 00024 #define SEARCHLAUNCH_CONTAINMENT_H 00025 00026 #include "models/krunnermodel.h" 00027 00028 #include <Plasma/Containment> 00029 #include <Plasma/DataEngine> 00030 00031 #include <QGraphicsLinearLayout> 00032 00033 class QTimer; 00034 class StripWidget; 00035 class ItemView; 00036 class LinearAppletOverlay; 00037 class NetToolBox; 00038 class IconActionCollection; 00039 class KRunnerModel; 00040 class KServiceModel; 00041 00042 namespace Plasma 00043 { 00044 class IconWidget; 00045 class LineEdit; 00046 class RunnerManager; 00047 class QueryMatch; 00048 class ScrollWidget; 00049 class Frame; 00050 class FrameSvg; 00051 class ToolButton; 00052 } 00053 00054 class SearchLaunch : public Plasma::Containment 00055 { 00056 Q_OBJECT 00057 public: 00058 SearchLaunch(QObject *parent, const QVariantList &args); 00059 ~SearchLaunch(); 00060 void init(); 00061 00062 void setOrientation(Qt::Orientation orientation); 00063 00064 void constraintsEvent(Plasma::Constraints constraints); 00065 00066 void createConfigurationInterface(KConfigDialog *parent); 00067 00068 protected: 00069 void focusInEvent(QFocusEvent *event); 00070 void paintInterface(QPainter *, const QStyleOptionGraphicsItem *, const QRect &); 00071 void changeEvent(QEvent *event); 00072 void doSearch(const QString &query, const QString &runner = QString()); 00073 00074 public Q_SLOTS: 00075 void configChanged(); 00076 void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data); 00077 00078 private Q_SLOTS: 00079 void toggleImmutability(); 00080 void updateSize(); 00081 void layoutApplet(Plasma::Applet* applet, const QPointF &pos); 00082 void appletRemoved(Plasma::Applet* applet); 00083 void restoreStrip(); 00084 void updateConfigurationMode(bool config); 00085 void overlayRequestedDrop(QGraphicsSceneDragDropEvent *event); 00086 void resultsViewRequestedDrag(QModelIndex index); 00087 void availableScreenRegionChanged(); 00088 00089 void delayedQuery(); 00090 void query(); 00091 void searchReturnPressed(); 00092 void launch(QModelIndex index); 00093 void addFavourite(const QModelIndex &index); 00094 void reset(); 00095 00096 void goRight(); 00097 void goLeft(); 00098 00099 private: 00103 void setFormFactorFromLocation(Plasma::Location loc); 00104 00105 Plasma::FrameSvg *m_background; 00106 KRunnerModel *m_runnerModel; 00107 KServiceModel *m_serviceModel; 00108 Plasma::IconWidget *m_backButton; 00109 00110 int m_queryCounter; 00111 int m_maxColumnWidth; 00112 00113 QTimer *m_searchTimer; 00114 QHash<Plasma::IconWidget*, Plasma::QueryMatch> m_matches; 00115 00116 Plasma::LineEdit *m_searchField; 00117 00118 ItemView *m_resultsView; 00119 StripWidget *m_stripWidget; 00120 00121 Qt::Orientation m_orientation; 00122 Plasma::ToolButton *m_leftArrow; 00123 Plasma::ToolButton *m_rightArrow; 00124 QString m_lastQuery; 00125 Plasma::IconWidget *m_firstItem; 00126 00127 QList<Plasma::QueryMatch> m_defaultMatches; 00128 00129 QGraphicsLinearLayout *m_mainLayout; 00130 QGraphicsLinearLayout *m_resultsLayout; 00131 QGraphicsLinearLayout *m_appletsLayout; 00132 QPointF m_buttonDownMousePos; 00133 LinearAppletOverlay *m_appletOverlay; 00134 00135 NetToolBox *m_toolBox; 00136 IconActionCollection *m_iconActionCollection; 00137 00138 bool m_stripUninitialized; 00139 }; 00140 00141 00142 #endif // PLASMA_SEARCHLAUNCH_H
KDE 4.5 API Reference