// -*- c++ -*-

/*
 *
 * Copyright (C) 2002 Richard Moore, rich@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 SIDEBAR_H
#define SIDEBAR_H

#include <qtabwidget.h>

class KHTMLPart;
class KHTMLView;

class ChannelEditor;
class QtVisionWidget;
class ConfigData;

/**
 * Displays a widget as sidebar, showing the widget caption as the
 * title of the bar.
 *
 * @version $Id: sidebar.h,v 1.5 2002/08/05 20:15:02 hellwig Exp $
 * @author Richard Moore, rich@kde.org
*/
class Sidebar : public QTabWidget
{
    Q_OBJECT

public:
    Sidebar( QWidget *parent, const char *name=0 );
    virtual ~Sidebar();

    void setScreen( QtVisionWidget *s ) { screen = s; }

    void createViews();

    ChannelEditor *channels() const { return chans; }
    KHTMLView *listings() const { return lists; }
    KHTMLPart *listingsPart() const { return listPart; }

public slots:
    void viewChanged( QWidget *view );
    void useListingsURL( bool );
    void listingsURLChanged( QString *url );

protected:
    ChannelEditor *createChannels();
    QWidget *createListings();

private:
    QtVisionWidget *screen;

    ChannelEditor *chans;
    KHTMLPart *listPart;
    KHTMLView *lists;

    ConfigData *cfg;
};

#endif // SIDEBAR_H
