// -*- c++ -*-

/*
 *
 * Copyright (C) 2002 Richard Moore <rich@kde.org>
 * 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 VIEWMANAGER_H
#define VIEWMANAGER_H

#include <qguardedptr.h>
#include <qobject.h>

class QWidget;
class QtVision;
class ConfigData;
class ChannelEditor;
class SettingsDialog;
class DeviceWidgetImpl;

#include "pluginfactory.h"

/**
 * Manages the dialogs and other views.
 *
 * @author Richard Moore, rich@kde.org
 */
class ViewManager : public QObject
{
    Q_OBJECT

public:
    ViewManager( QtVision *qtv, const char *name=0 );
    ~ViewManager();

    int launchSourceDialog( QWidget *parent );
    int launchWizard( QWidget *parent );
    int launchSettings( QWidget *parent );

    ChannelEditor *createChannelEditor( QWidget *parent );

    ConfigData *getConfig();

public slots:
    void update();

protected slots:
    void setOptions(ConfigData *);
    void destroySettings();

    void slotHueChanged(int);
    void slotColourChanged(int);
    void slotBrightnessChanged(int);
    void slotWhitenessChanged(int);
    void slotContrastChanged(int);

signals:
    void showSelectedChanged(bool);
    void setFixedAspectRatio(bool, int);
    void disableScreenSaver(bool, int);
    void stayOnTopChanged(bool);
    void useListingsURL(bool);
    void getNewListingsURL(QString *);

private:
    QVSourcePlugin *dev;
    QtVision *qtv;
    ConfigData *cfg;
    SettingsDialog *settingsDialog;
    DeviceWidgetImpl *ssdlg;

};

#endif // VIEWMANAGER_H



