/***************************************************************************
 *   Copyright (C) 2008 by Andreas Silberstorff   *
 *   ml@andreas-silberstorff.de   *
 *                                                                         *
 *   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.             *
 ***************************************************************************/

#ifndef kalvaview_H
#define kalvaview_H

#include <QtGui/QWidget>
#include <QTabWidget>
#include <QSplitter>
#include <QStackedWidget>
#include <QList>

class QSize;
class QPushButton;
class KConfigGroup;
class KConfigDialog;


/**
 * This is the main view class for kalva2.  Most of the non-menu,
 * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
 * here.
 *
 * @short Main view
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.0.91
 */
class kalvaview : public QWidget
{
	Q_OBJECT
public:
	/**
	 * Default constructor
	 */
	kalvaview ( QWidget *parent );

	/**
	 * Destructor
	 */
	virtual ~kalvaview();

	QSize minimumSizeHint() const;
	QSize maximumSizeHint();

public slots:
	void addToConfigDialog( KConfigDialog *dialog );
	void settingsChanged();

private:
	KConfigGroup *m_kalvaconfiggroup;
	QTabWidget *m_manager;
        QStackedWidget *m_mainViewStack;
	QSplitter *m_splitter;
	QPushButton *m_resizer;
	int m_managerSize;

	enum ManagerSize
	{
		Minimized = 0,
		Optimized = 1,
		Maximized = 2
	};

//	void createActions();
	void createWidgets();
	void layoutWidgets();
	void setupPerspectives();

private slots:

	/**
	 * resizes the manager
	 */
	void resizeManager();

signals:
	/**
	 * Use this signal to change the content of the statusbar
	 */
	void signalChangeStatusbar ( const QString& text );

	/**
	 * Use this signal to change the content of the caption
	 */
	void signalChangeCaption ( const QString& text );

};

#endif // kalvaview_H
