Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / plasma / containments / desktop / desktop.h
blob389ef75dffcbe99ae4cf51cb78053b9fa7433022
1 /*
2 * Copyright 2007 by Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2,
6 * or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef PLASMA_DESKTOP_H
20 #define PLASMA_DESKTOP_H
22 #include <QGraphicsItem>
23 #include <QList>
24 #include <QObject>
25 #include <QStyleOptionGraphicsItem>
26 #include <QTimer>
28 #include <KDialog>
29 #include <KIcon>
31 #include <plasma/containment.h>
32 #include <plasma/phase.h>
33 #include <plasma/widgets/widget.h>
35 #include "iconloader.h"
37 #include "renderthread.h"
39 class BackgroundDialog;
40 class QAction;
41 class QTimeLine;
43 namespace Plasma
45 class AppletBrowser;
46 class Svg;
49 namespace Ui
51 class config;
54 /*class Tool : public QObject, public QGraphicsItem
56 Q_OBJECT
58 public:
59 explicit Tool(QGraphicsItem *parent = 0);
60 QRectF boundingRect() const;
61 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
63 };*/
65 class DefaultDesktop : public Plasma::Containment
67 Q_OBJECT
69 public:
70 DefaultDesktop(QObject *parent, const QVariantList &args);
71 ~DefaultDesktop();
72 void init();
73 void constraintsUpdated(Plasma::Constraints constraints);
75 QList<QAction*> contextActions();
77 /**
78 * Paints a default background image. Nothing fancy, but that's what plugins
79 * are for. Reimplemented from Plasma::Containment;
81 void paintInterface(QPainter *painter,
82 const QStyleOptionGraphicsItem *option,
83 const QRect& contentsRect);
85 protected Q_SLOTS:
86 void runCommand();
87 void configure();
88 void applyConfig();
89 void nextSlide(bool skipUpdates=false);
91 void toggleDesktopImmutability();
92 void lockScreen();
93 void logout();
95 void updateBackground();
96 void updateBackground(int, const QImage &img);
97 private:
98 void reloadConfig(bool skipUpdates=false);
99 QSize resolution() const;
101 QAction *m_lockDesktopAction;
102 QAction *m_appletBrowserAction;
103 QAction *m_runCommandAction;
104 QAction *m_setupDesktopAction;
105 QAction *m_lockScreenAction;
106 QAction *m_logoutAction;
107 QAction *m_separator;
108 QAction *m_separator2;
110 BackgroundDialog *m_configDialog;
112 int m_backgroundMode;
114 // slideshow settings
115 // the index of which m_slidePath is currently visible
116 int m_currentSlide;
117 QTimer m_slideshowTimer;
118 QStringList m_slideFiles;
120 QPixmap m_bitmapBackground;
121 QString m_wallpaperPath;
123 int m_wallpaperPosition;
124 QColor m_wallpaperColor;
126 RenderThread m_renderer;
127 int m_current_renderer_token;
129 //Desktop icons
130 static IconLoader *s_icons;
133 #endif // PLASMA_PANEL_H