/**
 *  GraphTFT plugin for the Video Disk Recorder 
 * 
 *  theme.h - A plugin for the Video Disk Recorder
 *
 *  (c) 2004 Lars Tegeler, Sascha Volkenandt  
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 * $Id: theme.h,v 1.4 2004/05/25 08:41:15 tegeler Exp $
 *
 **/

#ifndef __GTFT_THEME_H
#define __GTFT_THEME_H

#include <string>
#include <vdr/config.h>

	// items knowen by graphtft
	enum eThemeItem {
		itemNone,
    	itemTheme,
    	itemText,
		itemImage,
		itemImageCover,
		itemImageFile,
    	itemDate,
		itemDateOnly,
		itemTimeOnly,
    	itemChannel,
		itemChannelOnly,
		itemChannelNumber,
		itemRectangle,
    	itemLogo,
    	itemTimebar,
    	itemPresentTitle,
    	itemPresentSubtitle,
		itemPresentTime,
    	itemFollowingTitle,
    	itemFollowingSubtitle,
		itemFollowingTime,
		itemRecording,
    	itemSymRecording,
    	itemSym2ch,
    	itemSymDD,
    	itemSymVTX,
    	itemSymCrypt,
		itemSymRepPlay,
		itemSymRepPause,
		itemSymRepFF,
		itemSymRepFB,
		itemSymRepSF,
		itemSymRepSB,
		itemMessage,
		itemMessageBackground,
		itemVolumeMuteSymbol,
		itemVolumebar,
		itemVolumeBackground,
		itemReplayName,
		itemReplayFolder,
		itemReplayProcessbar,
		itemReplayTotal,
		itemReplayCurrent,
		itemReplayRemaining,
		itemMenuTitle,
		itemMenu,
		itemMenuSelected,
		itemMenuButtonRed,
		itemMenuButtonGreen,
		itemMenuButtonBlue,
		itemMenuButtonYellow,
		itemMenuButtonBackgroundRed,
		itemMenuButtonBackgroundGreen,
		itemMenuButtonBackgroundBlue,
		itemMenuButtonBackgroundYellow,
		itemMenuText,
		itemMenuTextBackground,
		itemMenuImageMap,

    };

	// section for the themes
	enum eThemeSection {
		sectionNone,
		sectionNormalTV,
		sectionNormalRadio,
		sectionReplayNormal,
		sectionReplayDVD,
		sectionReplayMP3,
		sectionMenu,
	};


//class for the themeitems
class cGraphTFTThemeItem : public cListObject {
	
	private:	
		int _item, _section;
		int _x,_y,_width,_height,_red,_green,_blue,_transperents,_lines,_size,_sw;
		int _align, _animated, _delay, _count;
		std::string _name;
		std::string _version;
		std::string _font;
		std::string _path;
		std::string _path2;
		std::string _type;
		std::string _text;
	  
	protected:
		bool ParseImage(std::string toParse);
		bool ParseText(std::string toParse);
  
		bool ParseVar(std::string toParse, std::string name, int *value);
		bool ParseVar(std::string toParse, std::string name, std::string *value);

	public:
		cGraphTFTThemeItem(void);
		~cGraphTFTThemeItem();
		
		bool Parse (const char *s);
		int Item(void) const { return _item; }
		int Section(void) const { return _section; }
		std::string Name(void) const {return _name; }
		std::string Version(void) const {return _version; }

		int X(void) const { return _x; }
		int Y(void) const { return _y; }
		int Width(void) const { return _width; }
		int Height(void) const { return _height; }
		int Red(void) const { return _red; }
		int Green(void) const { return _green; }
		int Blue(void) const { return _blue; }
		int Transperents(void) const { return _transperents; }
		int Lines(void) const { return _lines; }
		int Size(void) const { return _size; }  
		int Switch(void) const { return _sw; }
		int Align(void) const { return _align; }
		int Animated(void) const { return _animated; }
		int Delay(void) const { return _delay; }
		int Count(void) const { return _count; }
		std::string Font(void) const {return _font; }
		std::string Path(void) const {return _path; }
		std::string Path2(void) const {return _path2; }
		std::string Type(void) const {return _type; }
		std::string Text(void) const {return _text; }

};

//class for the theme
class cGraphTFTTheme : public cConfig<cGraphTFTThemeItem> {
	
	public:
		cGraphTFTThemeItem *Get(int item);
		int getSection() const { return _section; }
		void setSection(int section) { _section = section; }
		std::string getDir() const { return _dir; }
		void setDir(std::string dir) { _dir = dir; }
	
	private:
		int _section;
		std::string _dir;
};
extern cGraphTFTTheme GraphTFTTheme;

#endif //__GTFT_THEME_H
