/*
    Copyright (C) 2006  Nicolas Le Guen <goldenear@free.fr>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// QT includes
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qsplitter.h>
#include <qlayout.h>

// KDE includes
#include <klocale.h>
#include <kiconloader.h>

// Local includes.
#include "sidebar.h"
#include "oskarview.h"
#include "startview.h"
#include "playlistview.h"
#include "infoview.h"
#include "filesview.h"
#include "playerview.h"

OskarView::OskarView(QWidget *parent)
    : QHBox(parent)
{
//    mParent      = static_cast<OskarApp *>(parent);
    mMainSidebar = new Oskar::Sidebar(this, Oskar::Sidebar::Left);
    
    mSplitter    = new QSplitter(this);
//    mSplitter->setFrameStyle( QFrame::NoFrame );
//    mSplitter->setFrameShadow( QFrame::Plain );
//    mSplitter->setFrameShape( QFrame::NoFrame );
//    mSplitter->setOpaqueResize(false);
    
    mMainSidebar->setSplitter(mSplitter);
    
    mStartView     = new StartView(this);
    mPlaylistView  = new PlaylistView(this);
    mInfoView      = new InfoView(this);
    mFilesView     = new FilesView(this);

    
    mMainSidebar->appendTab(mStartView, SmallIcon("misc"), i18n("Start"));
    mMainSidebar->appendTab(mPlaylistView, SmallIcon("player_playlist"), i18n("Playlist"));
    mMainSidebar->appendTab(mInfoView, SmallIcon("info"), i18n("Info"));
    mMainSidebar->appendTab(mFilesView, SmallIcon("folder_red"), i18n("Files"));
    mPlayerView    = new PlayerView(mSplitter);
    QSizePolicy rightSzPolicy(QSizePolicy::Preferred, QSizePolicy::Expanding, 2, 1);
    mPlayerView->setSizePolicy(rightSzPolicy);
}

OskarView::~OskarView()
{
//    saveViewState();
}
