/*
 *
 * Copyright (C) 2002 George Staikos <staikos@kde.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */



#ifndef _CFGDATA_H
#define _CFGDATA_H

#include <qstring.h>


// Not used yet.  Just here for info at the moment.  They might not
// correspond to other areas of the code.
#define NORM_AUTO	0
#define NORM_NTSC	1
#define NORM_PAL	2
#define NORM_SECAM	3

// Aspect ratio algorithms:

#define AR_HEIGHT_TO_WIDTH 0
#define AR_WIDTH_TO_HEIGHT 1

// Screensaver modes:

#define SAVER_RUNNING      0
#define SAVER_VISIBLE      1
#define SAVER_FULLSCREEN   2

class KConfig;

/**
 * Global configuration data.
 */
 
class ConfigData
{
public:
    /** Constructor */
    ConfigData(KConfig* config);
    
    /** Copy ctor */    
    ConfigData(const ConfigData&);
    
    /** Destructor */
    ~ConfigData();
    
    /** Copy operator */
    ConfigData const &operator=(ConfigData const &);

    void defaults();

    // Allow default values to be restored on a 'page' by 'page' basis in the config dialog
    void defaultsGeneral();
    void defaultsDevice();
    void defaultsPicture();
    void defaultsChannels();
    
    int save();
    int load();
    int loadTuning(const QString&, const QString&);
    int saveTuning(const QString&, const QString&);
    const QString lastSourceFor(const QString& dev) const;

public:
    int frameRate;
    bool autoStart;
    bool maxResolution;
    bool landscape;
    bool mirror;
    bool videoDesktopEnabled;
    bool stayOnTop;
    bool autoScaleEnabled;
    bool showSelectedOnly;
    bool firstTime;
    bool fixAR;
    int  ARmode;
    bool disableScreenSaver;
    int  screenSaverMode;

    // position and size of topLevel view
    QPoint topLevelPos;
    QSize topLevelSize;

    bool useListingsURL;
    
    QString lastSource; // the last source for this device from loadTuning()
    QString channelFile;
    QString listingsURL;

    int hue;
    int colour;    
    int contrast;
    int whiteness;
    int brightness;

    
    QString prevDev;
    QString prevSrc;
    int lastChannel;
    int nps;  // ntsc/pal/secam
    
    // Volume Related Settings
    bool volumeMuted;
    int volumeLeft;
    int volumeRight;
    int volumeRestoreDelay;   

private:
    KConfig* _cfg;    
};


#endif

