on 2ecb97b help sign in
unity8/plugins/IndicatorsClient/indicators/datetime/indicatorclient_datetime.h
53 lines 1.5 kB history raw
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Ubo Riboni <ugo.riboni@canonical.com>
19 */
21#ifndef INDICATORCLIENT_DATETIME_H
22#define INDICATORCLIENT_DATETIME_H
24#include "indicatorclient_common.h"
25#include <QTimer>
26#include <QDateTime>
28class QStateAction;
30class IndicatorClientDateTime : public IndicatorClientCommon
32 Q_OBJECT
33public:
34 IndicatorClientDateTime(QObject *parent=0);
35 ~IndicatorClientDateTime();
37 void init(const QSettings& settings);
38 void shutdown();
39 QString dateTime() const;
40 bool parseRootElement(const QString &type, QMap<int, QVariant> data);
41 QQmlComponent *createComponent(QQmlEngine *engine, QObject *parent=0) const;
43private Q_SLOTS:
44 void onTimeout();
45 void updateTimeFormat(const QVariant &state);
47private:
48 QTimer m_timer;
49 QString m_format;
50 QStateAction *m_action;
51};
53#endif