/* * * Notification DBus Service implementation * * Copyright (C) 2021 Emanoil Kotsev * * * This file is part of kdbusnotification. * * kdbusnotification 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. * * kdbusnotification 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 kdbusnotification; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ // TQt includes #include #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]; }