~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to applets/lancelot/app/src/parts/LancelotPart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-05-25 09:50:14 UTC
  • mfrom: (1.1.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100525095014-6mlrm9z9bkws0zkt
Tags: 4:4.4.80-0ubuntu1
* New upstream beta release:
  - Bump kde-sc-dev-latest build-dep version to 4.4.80
  - Refresh kubuntu_04_kimpanel_disable_scim.diff
  - Update various .install files
  - Drop liblancelot0a and liblancelot-dev packages; Upstream has broken ABI
    without an .so version bump, and after discussion with Debian it was
    decided it was not worth it to ship an unstable library.
  - Add liblancelot files to plasma-widget-lancelot, adding appropriate
    Replaces: entries
* Switch to source format 3.0 (quilt):
  - Bump debhelper build-depend version to 7.3.16 or greater

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *   Copyright (C) 2009 Ivan Cukic <ivan.cukic(at)kde.org>
3
 
 *
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
7
 
 *   Software Foundation
8
 
 *
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
13
 
 *
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.
18
 
 */
19
 
 
20
 
#ifndef LANCELOT_PARTS_H
21
 
#define LANCELOT_PARTS_H
22
 
 
23
 
#include <KConfigDialog>
24
 
#include <QBasicTimer>
25
 
#include <QGraphicsLinearLayout>
26
 
 
27
 
#include <plasma/applet.h>
28
 
#include <plasma/popupapplet.h>
29
 
#include <plasma/widgets/lineedit.h>
30
 
 
31
 
#include <lancelot/Global.h>
32
 
#include <lancelot/widgets/Widget.h>
33
 
#include <lancelot/widgets/ActionListView.h>
34
 
#include <lancelot/layouts/FullBorderLayout.h>
35
 
 
36
 
#include "PartsMergedModel.h"
37
 
#include "models/Runner.h"
38
 
#include "LancelotPartConfig.h"
39
 
 
40
 
class LancelotPart : public Plasma::PopupApplet
41
 
{
42
 
    Q_OBJECT
43
 
public:
44
 
    LancelotPart(QObject * parent, const QVariantList &args);
45
 
    ~LancelotPart();
46
 
 
47
 
    void init();
48
 
    L_Override void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
49
 
    L_Override void dropEvent(QGraphicsSceneDragDropEvent * event);
50
 
 
51
 
private Q_SLOTS:
52
 
    void configAccepted();
53
 
    void search(const QString & query);
54
 
 
55
 
protected:
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);
61
 
 
62
 
private Q_SLOTS:
63
 
    void removeModel(int index);
64
 
    void immutabilityChanged(Plasma::ImmutabilityType value);
65
 
 
66
 
private:
67
 
    bool loadFromList(const QStringList & list);
68
 
    void showSearchBox(bool value);
69
 
 
70
 
    void saveConfig();
71
 
    bool loadConfig();
72
 
    void applyConfig();
73
 
 
74
 
    QGraphicsWidget * m_root;
75
 
    // Lancelot::FullBorderLayout * m_layout;
76
 
    QGraphicsLinearLayout * m_layout;
77
 
    Lancelot::ActionListView * m_list;
78
 
    Plasma::LineEdit * m_searchText;
79
 
 
80
 
    Models::PartsMergedModel * m_model;
81
 
    Models::Runner * m_runnnerModel;
82
 
 
83
 
    QString m_cmdarg;
84
 
    Plasma::IconWidget * m_icon;
85
 
    bool m_iconClickActivation;
86
 
    QBasicTimer m_timer;
87
 
 
88
 
    LancelotPartConfig m_config;
89
 
};
90
 
 
91
 
K_EXPORT_PLASMA_APPLET(lancelot-part, LancelotPart)
92
 
 
93
 
#endif // LANCELOT_PARTS_H