Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serices: Add a method to query Schedules Direct lineups.
Adds "GetDDLineups" to the Channel service. Usage: http://BackendServerIP:6544/Channel/GetDDLineups?UserId=abcd&Password=1234 Returns all configured lineups from Schedules Direct as a LineupList data contract. Gives ZIP code, name, displayname, lineupID, etc. This will need a distclean, most likely.
- Loading branch information
Robert McNamara
committed
Sep 19, 2011
1 parent
eed7862
commit 7d80a99
Showing
5 changed files
with
204 additions
and
1 deletion.
There are no files selected for viewing
149 changes: 149 additions & 0 deletions
149
mythtv/libs/libmythservicecontracts/datacontracts/lineup.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: lineup.h | ||
// Created : Sep. 18, 2011 | ||
// | ||
// Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org> | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or at your option any later version of the LGPL. | ||
// | ||
// This library 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 | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef LINEUP_H_ | ||
#define LINEUP_H_ | ||
|
||
#include <QString> | ||
|
||
#include "serviceexp.h" | ||
#include "datacontracthelper.h" | ||
|
||
namespace DTC | ||
{ | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
class SERVICE_PUBLIC Lineup : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO( "version" , "1.0" ); | ||
|
||
Q_PROPERTY( QString LineupId READ LineupId WRITE setLineupId ) | ||
Q_PROPERTY( QString Name READ Name WRITE setName ) | ||
Q_PROPERTY( QString DisplayName READ DisplayName WRITE setDisplayName ) | ||
Q_PROPERTY( QString Type READ Type WRITE setType ) | ||
Q_PROPERTY( QString Postal READ Postal WRITE setPostal ) | ||
Q_PROPERTY( QString Device READ Device WRITE setDevice ) | ||
|
||
PROPERTYIMP ( QString , LineupId ) | ||
PROPERTYIMP ( QString , Name ) | ||
PROPERTYIMP ( QString , DisplayName ) | ||
PROPERTYIMP ( QString , Type ) | ||
PROPERTYIMP ( QString , Postal ) | ||
PROPERTYIMP ( QString , Device ) | ||
|
||
public: | ||
|
||
static void InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< Lineup >(); | ||
qRegisterMetaType< Lineup* >(); | ||
} | ||
|
||
public: | ||
|
||
Lineup(QObject *parent = 0) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
Lineup( const Lineup &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
void Copy( const Lineup &src ) | ||
{ | ||
m_LineupId = src.m_LineupId ; | ||
m_Name = src.m_Name ; | ||
m_DisplayName = src.m_DisplayName ; | ||
m_Type = src.m_Type ; | ||
m_Postal = src.m_Postal ; | ||
m_Device = src.m_Device ; | ||
} | ||
}; | ||
|
||
class SERVICE_PUBLIC LineupList : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO( "version", "1.0" ); | ||
|
||
// We need to know the type that will ultimately be contained in | ||
// any QVariantList or QVariantMap. We do his by specifying | ||
// A Q_CLASSINFO entry with "<PropName>_type" as the key | ||
// and the type name as the value | ||
|
||
Q_CLASSINFO( "Lineups_type", "DTC::Lineup"); | ||
|
||
Q_PROPERTY( QVariantList Lineups READ Lineups DESIGNABLE true ) | ||
|
||
PROPERTYIMP_RO_REF( QVariantList, Lineups ) | ||
|
||
public: | ||
|
||
static void InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< LineupList >(); | ||
qRegisterMetaType< LineupList* >(); | ||
|
||
Lineup::InitializeCustomTypes(); | ||
} | ||
|
||
public: | ||
|
||
LineupList(QObject *parent = 0) | ||
: QObject( parent ) | ||
{ | ||
} | ||
|
||
LineupList( const LineupList &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
void Copy( const LineupList &src ) | ||
{ | ||
CopyListContents< Lineup >( this, m_Lineups, src.m_Lineups ); | ||
} | ||
|
||
Lineup *AddNewLineup() | ||
{ | ||
// We must make sure the object added to the QVariantList has | ||
// a parent of 'this' | ||
|
||
Lineup *pObject = new Lineup( this ); | ||
m_Lineups.append( QVariant::fromValue<QObject *>( pObject )); | ||
|
||
return pObject; | ||
} | ||
|
||
}; | ||
|
||
} // namespace DTC | ||
|
||
Q_DECLARE_METATYPE( DTC::LineupList ) | ||
Q_DECLARE_METATYPE( DTC::LineupList* ) | ||
|
||
Q_DECLARE_METATYPE( DTC::Lineup ) | ||
Q_DECLARE_METATYPE( DTC::Lineup* ) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters