3
MediaTomb - http://www.mediatomb.cc/
5
upnp_cds.h - this file is part of MediaTomb.
7
Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
10
Copyright (C) 2006-2007 Gena Batyan <bgeradz@mediatomb.cc>,
11
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
Leonhard Wimmer <leo@mediatomb.cc>
14
MediaTomb is free software; you can redistribute it and/or modify
15
it under the terms of the GNU General Public License version 2
16
as published by the Free Software Foundation.
18
MediaTomb is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU General Public License for more details.
23
You should have received a copy of the GNU General Public License
24
version 2 along with MediaTomb; if not, write to the Free Software
25
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
27
$Id: upnp_cds.h 1294 2007-05-13 16:28:24Z lww $
31
/// \brief Definition of the ContentDirectoryService class.
32
#ifndef __UPNP_CDS_H__
33
#define __UPNP_CDS_H__
36
#include "singleton.h"
37
#include "action_request.h"
38
#include "subscription_request.h"
40
/// \brief This class is responsible for the UPnP Content Directory Service operations.
42
/// Handles subscription and action invocation requests for the CDS.
43
class ContentDirectoryService : public Singleton<ContentDirectoryService>
46
/// \brief The system update ID indicates changes in the content directory.
48
/// Whenever something in the content directory changes, the value of
49
/// systemUpdateID is increased and an event is sent out to all subscribed
51
/// Also, this variable is returned by the upnp_action_GetSystemUpdateID()
55
/// \brief All strings in the XML will be cut at this length.
58
/// \brief UPnP standard defined action: Browse()
59
/// \param request Incoming ActionRequest.
61
/// Browse(string ObjectID, string BrowseFlag, string Filter, ui4 StartingIndex,
62
/// ui4 RequestedCount, string SortCriteria, string Result, ui4 NumberReturned,
63
/// ui4 TotalMatches, ui4 UpdateID)
64
void upnp_action_Browse(zmm::Ref<ActionRequest> request);
66
/// \brief UPnP standard defined action: GetSearchCapabilities()
67
/// \param request Incoming ActionRequest.
69
/// GetSearchCapabilities(string SearchCaps)
70
void upnp_action_GetSearchCapabilities(zmm::Ref<ActionRequest> request);
72
/// \brief UPnP standard defined action: GetSortCapabilities()
73
/// \param request Incoming ActionRequest.
75
/// GetSortCapabilities(string SortCaps)
76
void upnp_action_GetSortCapabilities(zmm::Ref<ActionRequest> request);
78
/// \brief UPnP standard defined action: GetSystemUpdateID()
79
/// \param request Incoming ActionRequest.
81
/// GetSystemUpdateID(ui4 Id)
82
void upnp_action_GetSystemUpdateID(zmm::Ref<ActionRequest> request);
84
/// \brief UPnP standard defined service type
85
/// \todo Check if it makes sense to use it as it is done now...why not define constants here?
86
static zmm::String serviceType;
87
/// \brief ID of the service.
88
static zmm::String serviceID;
91
/// \brief Constructor for the CDS, saves the service type and service id
92
/// in internal variables.
93
/// \todo Check if it makes sense to use it as it is done now...why not define them as constants?
94
ContentDirectoryService();
95
virtual ~ContentDirectoryService();
97
static void setStaticArgs(zmm::String serviceType, zmm::String serviceID);
99
/// \brief Dispatches the ActionRequest between the available actions.
100
/// \param request ActionRequest to be processed by the function.
102
/// This function looks at the incoming ActionRequest and passes it on
103
/// to the appropriate action for processing.
104
void process_action_request(zmm::Ref<ActionRequest> request);
106
/// \brief Processes an incoming SubscriptionRequest.
107
/// \param request SubscriptionRequest to be processed by the function.
109
/// Looks at the incoming SubscriptionRequest and accepts the subscription
110
/// if everything is ok.
111
void process_subscription_request(zmm::Ref<SubscriptionRequest> request);
113
/// \brief Sends out an event to all subscribed devices.
114
/// \param containerUpdateIDs_CSV Comma Separated Value list of container update ID's (as defined in the UPnP CDS specs)
116
/// When something in the content directory chagnes, we will send out
117
/// an event to all subscribed devices. Container updates are supported,
118
/// and of course the mimimum required - systemUpdateID.
119
void subscription_update(zmm::String containerUpdateIDs_CSV);
122
#endif // __UPNP_CDS_H__