2
* Copyright (C) 2009 Ivan Cukic <ivan.cukic(at)kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2,
6
* or (at your option) any later version, as published by the Free
9
* This program 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
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef LANCELOT_PARTS_H
21
#define LANCELOT_PARTS_H
23
#include <KConfigDialog>
24
#include <QBasicTimer>
25
#include <QGraphicsLinearLayout>
27
#include <plasma/applet.h>
28
#include <plasma/popupapplet.h>
29
#include <plasma/widgets/lineedit.h>
31
#include <lancelot/Global.h>
32
#include <lancelot/widgets/Widget.h>
33
#include <lancelot/widgets/ActionListView.h>
34
#include <lancelot/layouts/FullBorderLayout.h>
36
#include "PartsMergedModel.h"
37
#include "models/Runner.h"
38
#include "LancelotPartConfig.h"
40
class LancelotPart : public Plasma::PopupApplet
44
LancelotPart(QObject * parent, const QVariantList &args);
48
L_Override void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
49
L_Override void dropEvent(QGraphicsSceneDragDropEvent * event);
52
void configAccepted();
53
void search(const QString & query);
56
L_Override void createConfigurationInterface(KConfigDialog *parent);
57
L_Override void resizeEvent(QGraphicsSceneResizeEvent * event);
58
L_Override QGraphicsWidget * graphicsWidget();
59
L_Override void timerEvent(QTimerEvent * event);
60
L_Override bool eventFilter(QObject * object, QEvent * event);
63
void removeModel(int index);
64
void immutabilityChanged(Plasma::ImmutabilityType value);
67
bool loadFromList(const QStringList & list);
68
void showSearchBox(bool value);
74
QGraphicsWidget * m_root;
75
// Lancelot::FullBorderLayout * m_layout;
76
QGraphicsLinearLayout * m_layout;
77
Lancelot::ActionListView * m_list;
78
Plasma::LineEdit * m_searchText;
80
Models::PartsMergedModel * m_model;
81
Models::Runner * m_runnnerModel;
84
Plasma::IconWidget * m_icon;
85
bool m_iconClickActivation;
88
LancelotPartConfig m_config;
91
K_EXPORT_PLASMA_APPLET(lancelot-part, LancelotPart)
93
#endif // LANCELOT_PARTS_H