You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.7 KiB
112 lines
3.7 KiB
15 years ago
|
/***************************************************************************
|
||
|
* Copyright (C) 2005 by Will Stephenson *
|
||
|
* wstephenson@kde.org *
|
||
|
* *
|
||
|
* This program 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. *
|
||
|
* *
|
||
|
* This program 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 this program; if not, write to the *
|
||
|
* Free Software Foundation, Inc., *
|
||
15 years ago
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||
15 years ago
|
***************************************************************************/
|
||
|
|
||
|
#ifndef SERVICE_H
|
||
|
#define SERVICE_H
|
||
|
|
||
15 years ago
|
#include <tqdatetime.h>
|
||
|
#include <tqdom.h>
|
||
|
#include <tqmap.h>
|
||
|
#include <tqregexp.h>
|
||
|
#include <tqstring.h>
|
||
|
#include <tqstringlist.h>
|
||
15 years ago
|
#include <kurl.h>
|
||
|
|
||
|
|
||
|
class ProgramInformation {
|
||
|
public:
|
||
|
ProgramInformation() {}
|
||
15 years ago
|
ProgramInformation( const TQString & title, const TQString &synopsis );
|
||
15 years ago
|
virtual ~ProgramInformation() {}
|
||
|
|
||
15 years ago
|
TQString id() const { return mId; }
|
||
|
TQString title() const { return mTitle; }
|
||
|
TQString synopsis() const { return mSynopsis; }
|
||
|
TQStringList genres() const { return mGenres; }
|
||
15 years ago
|
|
||
15 years ago
|
void setId ( const TQString & id ) { mId = id; }
|
||
|
void setGenres( const TQStringList & genres ) { mGenres = genres; }
|
||
|
bool loadXML( const TQDomElement & );
|
||
|
bool loadAttribute( const TQDomElement& element );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQString mId;
|
||
|
TQString mTitle;
|
||
|
TQString mSynopsis;
|
||
|
TQStringList mGenres;
|
||
15 years ago
|
};
|
||
|
|
||
15 years ago
|
typedef TQMap< TQString, ProgramInformation > ProgramInformationMap;
|
||
15 years ago
|
|
||
|
class ScheduleEvent {
|
||
|
public:
|
||
|
ScheduleEvent() {}
|
||
|
virtual ~ScheduleEvent() {}
|
||
|
|
||
15 years ago
|
TQString crid() const { return mCrid; }
|
||
|
TQDateTime startTime() const { return mStartTime; }
|
||
15 years ago
|
uint duration() const { return mDuration; }
|
||
15 years ago
|
TQString programUrl() const { return mUrl; }
|
||
15 years ago
|
|
||
15 years ago
|
bool loadXML( const TQDomElement & );
|
||
|
bool loadAttribute( const TQDomElement& element );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQString mCrid;
|
||
|
TQString mUrl;
|
||
|
TQDateTime mStartTime;
|
||
15 years ago
|
uint mDuration;
|
||
|
|
||
15 years ago
|
static TQRegExp sRegExp;
|
||
15 years ago
|
};
|
||
|
|
||
|
class Service {
|
||
|
public:
|
||
|
Service();
|
||
15 years ago
|
Service( bool active, const TQString & name, const TQString & owner, const KURL & serviceUrl, const KURL & logo, const TQStringList & genres );
|
||
15 years ago
|
virtual ~Service() {}
|
||
|
|
||
15 years ago
|
void setId( const TQString & id ) { mId = id; }
|
||
15 years ago
|
void setActive( bool active );
|
||
15 years ago
|
void setName( const TQString& name );
|
||
15 years ago
|
void setProgramInformation( const ProgramInformationMap & map );
|
||
|
|
||
15 years ago
|
TQString id() const { return mId; }
|
||
15 years ago
|
bool active() const;
|
||
15 years ago
|
TQString name() const;
|
||
15 years ago
|
ProgramInformationMap programmeInformation() const;
|
||
|
|
||
15 years ago
|
bool loadXML( const TQDomElement & );
|
||
|
bool loadDescription( const TQDomElement & );
|
||
|
bool loadAttribute( const TQDomElement& element );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQString mId;
|
||
15 years ago
|
bool mActive;
|
||
15 years ago
|
TQString mName;
|
||
|
TQString mOwner;
|
||
15 years ago
|
KURL mServiceUrl;
|
||
|
KURL mLogo;
|
||
15 years ago
|
TQStringList mGenres;
|
||
15 years ago
|
ProgramInformationMap mProgInfo;
|
||
|
};
|
||
|
|
||
|
#endif
|