• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Applets

clock.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright 2007 by Aaron Seigo <aseigo@kde.org>                        *
00003  *   Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org>               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
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

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal