~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/hav_devicemodel_infoprovider.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP Av (HUPnPAv) library.
 
7
 *
 
8
 *  Herqq UPnP Av is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU General Public License as published by
 
10
 *  the Free Software Foundation, either version 3 of the License, or
 
11
 *  (at your option) any later version.
 
12
 *
 
13
 *  Herqq UPnP Av is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
16
 *  GNU General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#include "hav_devicemodel_infoprovider.h"
 
23
 
 
24
#include "transport/havtransport_info.h"
 
25
#include "mediaserver/hmediaserver_info.h"
 
26
#include "mediarenderer/hmediarenderer_info.h"
 
27
#include "renderingcontrol/hrenderingcontrol_info.h"
 
28
#include "contentdirectory/hcontentdirectory_info.h"
 
29
#include "connectionmanager/hconnectionmanager_info.h"
 
30
 
 
31
#include <HUpnpCore/HDeviceInfo>
 
32
#include <HUpnpCore/HServiceInfo>
 
33
 
 
34
#include <HUpnpCore/HDevicesSetupData>
 
35
#include <HUpnpCore/HActionsSetupData>
 
36
#include <HUpnpCore/HServicesSetupData>
 
37
#include <HUpnpCore/HStateVariablesSetupData>
 
38
 
 
39
namespace Herqq
 
40
{
 
41
 
 
42
namespace Upnp
 
43
{
 
44
 
 
45
namespace Av
 
46
{
 
47
 
 
48
/*******************************************************************************
 
49
 * HAvDeviceModelInfoProvider
 
50
 ******************************************************************************/
 
51
HAvDeviceModelInfoProvider::HAvDeviceModelInfoProvider()
 
52
{
 
53
}
 
54
 
 
55
HAvDeviceModelInfoProvider::~HAvDeviceModelInfoProvider()
 
56
{
 
57
}
 
58
 
 
59
HAvDeviceModelInfoProvider* HAvDeviceModelInfoProvider::newInstance() const
 
60
{
 
61
    return new HAvDeviceModelInfoProvider();
 
62
}
 
63
 
 
64
HServicesSetupData HAvDeviceModelInfoProvider::servicesSetupData(
 
65
    const HDeviceInfo& info) const
 
66
{
 
67
    if (info.deviceType().compare(
 
68
        HMediaRendererInfo::supportedDeviceType(), HResourceType::Inclusive))
 
69
    {
 
70
        return HMediaRendererInfo::servicesSetupData();
 
71
    }
 
72
    else if (info.deviceType().compare(
 
73
        HMediaServerInfo::supportedDeviceType(), HResourceType::Inclusive))
 
74
    {
 
75
        return HMediaServerInfo::servicesSetupData();
 
76
    }
 
77
    return HServicesSetupData();
 
78
}
 
79
 
 
80
HActionsSetupData HAvDeviceModelInfoProvider::actionsSetupData(
 
81
    const HServiceInfo& serviceInfo, const HDeviceInfo&) const
 
82
{
 
83
    if (serviceInfo.serviceType().compare(
 
84
        HContentDirectoryInfo::supportedServiceType(), HResourceType::Inclusive))
 
85
    {
 
86
        return HContentDirectoryInfo::actionsSetupData();
 
87
    }
 
88
    else if (serviceInfo.serviceType().compare(
 
89
        HRenderingControlInfo::supportedServiceType(), HResourceType::Inclusive))
 
90
    {
 
91
        return HRenderingControlInfo::actionsSetupData();
 
92
    }
 
93
    else if (serviceInfo.serviceType().compare(
 
94
        HConnectionManagerInfo::supportedServiceType(), HResourceType::Inclusive))
 
95
    {
 
96
        return HConnectionManagerInfo::actionsSetupData();
 
97
    }
 
98
    else if (serviceInfo.serviceType().compare(
 
99
        HAvTransportInfo::supportedServiceType(), HResourceType::Inclusive))
 
100
    {
 
101
        return HAvTransportInfo::actionsSetupData();
 
102
    }
 
103
 
 
104
    return HActionsSetupData();
 
105
}
 
106
 
 
107
HStateVariablesSetupData HAvDeviceModelInfoProvider::stateVariablesSetupData(
 
108
    const HServiceInfo& serviceInfo, const HDeviceInfo&) const
 
109
{
 
110
    if (serviceInfo.serviceType().compare(
 
111
        HContentDirectoryInfo::supportedServiceType(), HResourceType::Inclusive))
 
112
    {
 
113
        return HContentDirectoryInfo::stateVariablesSetupData();
 
114
    }
 
115
    else if (serviceInfo.serviceType().compare(
 
116
        HRenderingControlInfo::supportedServiceType(), HResourceType::Inclusive))
 
117
    {
 
118
        return HRenderingControlInfo::stateVariablesSetupData();
 
119
    }
 
120
    else if (serviceInfo.serviceType().compare(
 
121
        HConnectionManagerInfo::supportedServiceType(), HResourceType::Inclusive))
 
122
    {
 
123
        return HConnectionManagerInfo::stateVariablesSetupData();
 
124
    }
 
125
    else if (serviceInfo.serviceType().compare(
 
126
        HAvTransportInfo::supportedServiceType(), HResourceType::Inclusive))
 
127
    {
 
128
        return HAvTransportInfo::stateVariablesSetupData();
 
129
    }
 
130
 
 
131
    return HStateVariablesSetupData();
 
132
}
 
133
 
 
134
HAvDeviceModelInfoProvider* HAvDeviceModelInfoProvider::clone() const
 
135
{
 
136
    return static_cast<HAvDeviceModelInfoProvider*>(HClonable::clone());
 
137
}
 
138
 
 
139
}
 
140
}
 
141
}