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 <QtCore/QTime>
00025 #include <QtCore/QDate>
00026
00027 #include <plasma/applet.h>
00028 #include <plasma/dataengine.h>
00029 #include <plasma/dialog.h>
00030
00031 #include "ui_clockConfig.h"
00032 #include "ui_calendar.h"
00033 #include "clockapplet.h"
00034
00035 class Clock : public ClockApplet
00036 {
00037 Q_OBJECT
00038 public:
00039 Clock(QObject *parent, const QVariantList &args);
00040 ~Clock();
00041
00042 void init();
00043 void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
00044 void setPath(const QString&);
00045
00046 public slots:
00047 void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
00048 void updateColors();
00049
00050 protected slots:
00051 void configAccepted();
00052 void constraintsEvent(Plasma::Constraints constraints);
00053
00054 protected:
00055 void createConfigurationInterface(KConfigDialog *parent);
00056
00057 private:
00058 void updateToolTipContent();
00059 void updateSize();
00060 QRect preparePainter(QPainter *p, const QRect &rect, const QFont &font, const QString &text);
00061
00062 QFont m_plainClockFont;
00063 bool m_useCustomColor;
00064 QColor m_plainClockColor;
00065 QRect m_dateRect;
00066
00067 bool m_showDate;
00068 bool m_showYear;
00069 bool m_showDay;
00070 bool m_showSeconds;
00071 bool m_showTimezone;
00072
00073 int updateInterval() const;
00074 Plasma::IntervalAlignment intervalAlignment() const;
00075
00076 QStringList m_timeZones;
00077 QString m_prettyTimezone;
00078 QTime m_time;
00079 QDate m_date;
00080 Plasma::Dialog *m_calendar;
00081 QVBoxLayout *m_layout;
00082 QTime m_lastTimeSeen;
00083 QPixmap m_toolTipIcon;
00085 Ui::clockConfig ui;
00086 Ui::calendar m_calendarUi;
00087 };
00088
00089 K_EXPORT_PLASMA_APPLET(dig_clock, Clock)
00090
00091 #endif