Skip to content

Commit

Permalink
chore: add ControlCenter DBus adaptor
Browse files Browse the repository at this point in the history
Add DBus adaptor class for org.deepin.dde.ControlCenter1 interface

Log: add ControlCenter DBus adaptor
  • Loading branch information
wyu71 committed Jan 13, 2025
1 parent 5ea0a6c commit 4858c43
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
35 changes: 35 additions & 0 deletions calendar-client/config/dbus/ControlCenterAdaptor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "ControlCenterAdaptor.h"
#include <QtCore/QMetaObject>

Check warning on line 6 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QMetaObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 6 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QMetaObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QByteArray>

Check warning on line 7 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QByteArray> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 7 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QByteArray> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QList>

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QList> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QList> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QMap>

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QString>

Check warning on line 10 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QString> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 10 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QString> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QStringList>

Check warning on line 11 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QStringList> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 11 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QStringList> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QVariant>

Check warning on line 12 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QVariant> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 12 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QVariant> not found. Please note: Cppcheck does not need standard library headers to get proper results.

/*
* Implementation of adaptor class ControlCenterAdaptor
*/

ControlCenterAdaptor::ControlCenterAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
// constructor
setAutoRelaySignals(true);
}

ControlCenterAdaptor::~ControlCenterAdaptor()
{
// destructor
}

void ControlCenterAdaptor::ShowPage(const QString &url)
{
// handle method call org.deepin.dde.ControlCenter1.ShowPage
QMetaObject::invokeMethod(parent(), "ShowPage", Q_ARG(QString, url));
}

43 changes: 43 additions & 0 deletions calendar-client/config/dbus/ControlCenterAdaptor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef CONTROLCENTERADAPTOR_H
#define CONTROLCENTERADAPTOR_H

#include <QtCore/QObject>

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtDBus/QtDBus>

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtDBus/QtDBus> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtDBus/QtDBus> not found. Please note: Cppcheck does not need standard library headers to get proper results.
QT_BEGIN_NAMESPACE
class QByteArray;
template<class T> class QList;
template<class Key, class Value> class QMap;
class QString;
class QStringList;
class QVariant;
QT_END_NAMESPACE

/*
* Adaptor class for interface org.deepin.dde.ControlCenter1
*/
class ControlCenterAdaptor: public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.ControlCenter1")
Q_CLASSINFO("D-Bus Introspection", ""
" <interface name=\"org.deepin.dde.ControlCenter1\">\n"
" <method name=\"ShowPage\">\n"
" <arg direction=\"in\" type=\"s\" name=\"url\"/>\n"
" </method>\n"
" </interface>\n"
"")
public:
ControlCenterAdaptor(QObject *parent);
virtual ~ControlCenterAdaptor();

public: // PROPERTIES
public Q_SLOTS: // METHODS

Check warning on line 38 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.

Check warning on line 38 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.
void ShowPage(const QString &url);
Q_SIGNALS: // SIGNALS
};

#endif

0 comments on commit 4858c43

Please sign in to comment.