Applets
clock.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CLOCK_H
00022 #define CLOCK_H
00023
00024 #include <QImage>
00025 #include <QPaintDevice>
00026 #include <QLabel>
00027 #include <QPixmap>
00028 #include <QTimer>
00029 #include <QPaintEvent>
00030 #include <QPainter>
00031 #include <QTime>
00032 #include <QGraphicsItem>
00033 #include <QColor>
00034
00035 #include <plasma/containment.h>
00036 #include <plasma/dataengine.h>
00037
00038 #include "clockapplet.h"
00039 #include "ui_clockConfig.h"
00040 #include "ui_calendar.h"
00041
00042 class QTimer;
00043
00044 namespace Plasma
00045 {
00046 class Svg;
00047 class Dialog;
00048 }
00049
00050 class Clock : public ClockApplet
00051 {
00052 Q_OBJECT
00053 public:
00054 Clock(QObject *parent, const QVariantList &args);
00055 ~Clock();
00056
00057 void init();
00058 void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
00059 void setPath(const QString&);
00060 void constraintsEvent(Plasma::Constraints constraints);
00061 QPainterPath shape() const;
00062
00063 public slots:
00064 void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
00065
00066 protected:
00067 void createConfigurationInterface(KConfigDialog *parent);
00068
00069 protected slots:
00070 void configAccepted();
00071 void moveSecondHand();
00072
00073 private:
00074 void drawHand(QPainter *p, qreal rotation, const QString &handName);
00075 void connectToEngine();
00076
00077 bool m_showTimeString;
00078 bool m_showSecondHand;
00079 bool m_fancyHands;
00080 Plasma::Svg* m_theme;
00081 QTime m_time;
00082 QTime m_lastTimeSeen;
00083 QTimer *m_secondHandUpdateTimer;
00084 int m_animationStart;
00086 Ui::clockConfig ui;
00087 Plasma::Dialog *m_calendar;
00088 Ui::calendar m_calendarUi;
00089 };
00090
00091 K_EXPORT_PLASMA_APPLET(clock, Clock)
00092
00093 #endif