diff options
Diffstat (limited to 'src/daemon/notificationNodeService.cpp')
-rw-r--r-- | src/daemon/notificationNodeService.cpp | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/daemon/notificationNodeService.cpp b/src/daemon/notificationNodeService.cpp new file mode 100644 index 0000000..a028904 --- /dev/null +++ b/src/daemon/notificationNodeService.cpp @@ -0,0 +1,106 @@ +/* + * + * HardwareControl DBus Service implementation + * + * Copyright (C) 2020 Emanoil Kotsev <[email protected]> + * + * + * This file is part of tdecore/tdehw. + * + * hardwarecontrol is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * hardwarecontrol is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with tdelibs; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +// TQt includes +#include <tqdbusobjectpath.h> + +#include "notificationNodeService.h" +#include "NotificationsService.h" +#define NOTIFICATIONS_DBUS_PATH "/org/freedesktop/Notifications" +/* + * Root Node + */ +RootNodeService::RootNodeService(TQT_DBusConnection &connection ) +: DBusBaseNode(), mConnection(connection) +{ + addChildNode(TQString("org")); + registerObject(mConnection,TQString("/")); +} + +RootNodeService::~RootNodeService(){ +} + +TQT_DBusObjectBase* RootNodeService::createInterface(const TQString& interfaceName) +{ + return (TQT_DBusObjectBase*) mInterfaces[interfaceName]; +} + +/* + * Org Node + */ +OrgNodeService::OrgNodeService(TQT_DBusConnection &connection ) +: DBusBaseNode(), mConnection(connection) +{ + addChildNode(TQString("freedesktop")); + registerObject(mConnection,TQString("/org")); +} + +OrgNodeService::~OrgNodeService(){ +} + +TQT_DBusObjectBase* OrgNodeService::createInterface(const TQString& interfaceName) +{ + return (TQT_DBusObjectBase*) mInterfaces[interfaceName]; +} + +/* + * FreeDesktop Node + */ +FreeDesktopNodeService::FreeDesktopNodeService(TQT_DBusConnection &connection ) +: DBusBaseNode(), mConnection(connection) +{ + addChildNode(TQString("Notifications")); + registerObject(mConnection,TQString("/org/freedesktop")); +} + +FreeDesktopNodeService::~FreeDesktopNodeService(){ +} + +TQT_DBusObjectBase* FreeDesktopNodeService::createInterface(const TQString& interfaceName) +{ + return (TQT_DBusObjectBase*) mInterfaces[interfaceName]; +} + +/* + * Notifications Node + */ +NotificationsNodeService::NotificationsNodeService(TQT_DBusConnection &conn) +: org::freedesktop::NotificationsNode(), + mConnection(conn) +{ + mInterfaces.insert("org.freedesktop.DBus.Introspectable", this); + mInterfaces.insert("org.freedesktop.Notifications", new NotificationsService(mConnection)); + registerObject(mConnection,TQString(NOTIFICATIONS_DBUS_PATH)); +} + +NotificationsNodeService::~NotificationsNodeService(){ +} + +TQT_DBusObjectBase* NotificationsNodeService::createInterface(const TQString& interfaceName) +{ + return (TQT_DBusObjectBase*) mInterfaces[interfaceName]; +} + + |