summaryrefslogtreecommitdiffstats
path: root/src/daemon/notificationNodeService.cpp
blob: 8131f6f3313916ecd23163ee10c338b51f76796b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 *
 *  Notification DBus Service implementation
 *
 *  Copyright (C) 2021  Emanoil Kotsev <[email protected]>
 *
 *
 *  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 <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];
}