/*
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * Author:
 *         Roman Krenicky
 *
 * $Id: epgtypes.h,v 1.6 2005/11/23 17:51:35 kutzner Exp $
 *
 */

/*
  epgtypes.h
  created: 2.12.2004
  last change: 21.5.2005
*/
/*! @file
    plugin-internal EPG-related types and functions
*/

#ifndef _EPGTYPES_H
#define _EPGTYPES_H


#include "globalheader.h"

#include <sstream>
#include <string>
#include <channels.h>
using namespace std;



/*! @c TIME_BLOCK_SIZE (in seconds) separates the UNIX time into blocks

    all timeblock specifications are to be understood as rounded off to the
    next block bound, i.e.  timeblock - (timeblock % TIME_BLOCK_SIZE)

    TIME_BLOCK_SIZE should be a divisor of 24*60*60 (a day) !
*/
#define TIME_BLOCK_SIZE    (24*60*60)



/*! @c epgdata is the plugin-internal representation of a bunch of EPG data
    for one channel
*/
/*
    currently this is similar to the data used in epg.data, but for one
    channel only (thus without 'C ...' and 'c' entries and with mandatory
    table id and version in event entries ['E ...'])
*/
struct epgdata
{
   //! several EPG records in ASCII coding
   ostringstream data;
}; // epgdata



/*! @c epgchannel identifies the channel some EPG data belongs to
*/
/*
    currently this is simply the channel description as used in channels.conf,
    cChannel::Parse() and cChannel::ToText() as a string but WITHOUT trailing
    newline characters!
*/
typedef string epgchannel;



bool epgchannel2vdrchannel (const epgchannel &channel, cChannel *vdrchannel);


bool vdrchannel2epgchannel (const cChannel &vdrchannel, epgchannel *channel);


bool epgchannel2igorchannelid (const epgchannel &channel,
                              string *igor_channel_id);



#endif // _EPGTYPES_H
