File indexing completed on 2024-05-12 17:06:43

0001 /***************************************************************************
0002  *                                                                         *
0003  *   SPDX-FileCopyrightText: 2021 Aditya Mehra <aix.m@outlook.com>         *
0004  *                                                                         *
0005  *   SPDX-License-Identifier: GPL-2.0-or-later                             *
0006  ***************************************************************************/
0007 
0008 #ifndef TIMEDATED_INTERFACE_H
0009 #define TIMEDATED_INTERFACE_H
0010 
0011 #include <QtCore/QObject>
0012 #include <QtCore/QByteArray>
0013 #include <QtCore/QList>
0014 #include <QtCore/QMap>
0015 #include <QtCore/QString>
0016 #include <QtCore/QStringList>
0017 #include <QtCore/QVariant>
0018 #include <QtDBus/QtDBus>
0019 
0020 class OrgFreedesktopTimedate1Interface : public QDBusAbstractInterface
0021 {
0022     Q_OBJECT
0023 
0024     Q_PROPERTY(bool CanNTP READ canNTP NOTIFY canNTPChanged)
0025     Q_PROPERTY(bool LocalRTC READ localRTC NOTIFY localRTCChanged)
0026     Q_PROPERTY(bool NTP READ nTP NOTIFY nTPChanged)
0027     Q_PROPERTY(bool NTPSynchronized READ nTPSynchronized NOTIFY nTPSynchronizedChanged)
0028     Q_PROPERTY(qulonglong RTCTimeUSec READ rTCTimeUSec NOTIFY rTCTimeUSecChanged)
0029     Q_PROPERTY(qulonglong TimeUSec READ timeUSec NOTIFY timeUSecChanged)
0030     Q_PROPERTY(QString Timezone READ timezone NOTIFY timezoneChanged)
0031 
0032 public:
0033     static inline const char *staticInterfaceName()
0034     {
0035         return "org.freedesktop.timedate1";
0036     }
0037 
0038 public:
0039     OrgFreedesktopTimedate1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
0040 
0041     ~OrgFreedesktopTimedate1Interface();
0042 
0043     bool canNTP() const;
0044     bool localRTC() const;
0045     bool nTP() const;
0046     bool nTPSynchronized() const;
0047     qulonglong rTCTimeUSec() const;
0048     qulonglong timeUSec() const;
0049     QString timezone() const;
0050 
0051 public Q_SLOTS: // METHODS
0052     QDBusPendingReply<> SetLocalRTC(bool in0, bool in1, bool in2);
0053     QDBusPendingReply<> SetNTP(bool in0, bool in1);
0054     QDBusPendingReply<> SetTime(qlonglong in0, bool in1, bool in2);
0055     QDBusPendingReply<> SetTimezone(const QString &in0, bool in1);
0056 
0057 Q_SIGNALS: // SIGNALS
0058     void canNTPChanged();
0059     void localRTCChanged();
0060     void nTPChanged();
0061     void nTPSynchronizedChanged();
0062     void rTCTimeUSecChanged();
0063     void timeUSecChanged();
0064     void timezoneChanged();
0065 };
0066 
0067 namespace org
0068 {
0069     namespace freedesktop
0070     {
0071         typedef ::OrgFreedesktopTimedate1Interface timedate1;
0072     }
0073 }
0074 #endif