/***************************************************************************
                          kcakeview.h  -  description
                             -------------------
    begin                : Die Nov 19 10:27:05 CET 2002
    copyright            : (C) 2002 by Harald Krippel
    email                : neuro.harald@surfeu.at
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KCAKEVIEW_H
#define KCAKEVIEW_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif 

// include files for Qt

#include <qvbox.h>
#include <qworkspace.h>
#include <qsplitter.h>
#include <qstring.h>
#include <qobject.h>
#include <qdatetime.h>
#include <qptrlist.h>
#include <qlistview.h>
#include <qwidget.h>
#include <qvbox.h>
#include <qwidgetstack.h>

// include files for Qt
#include <qwidget.h>
#include <qdom.h>

// dialoge
#include <mylampdlg.h>
#include <default.h>
#include <mycameradlg.h>
#include <myobjdlg.h>
#include <myfiredlg.h>
#include <mypartsysdlg.h>
#include <mywavesysdlg.h>
#include <myfogdlg.h>
#include <myscenedlg.h>
#include <myplayerdlg.h>
#include <mybarrierdlg.h>
#include <mybodydlg.h>
#include <myskydlg.h>
#include <myspldlg.h>
#include <mysounddlg.h>
#include <myguitxtdlg.h>
#include <myguibuttondlg.h>
#include <myguiinputdlg.h>
#include <myguiosbuttondlg.h>
#include <mynetworkdlg.h>
#include <myglobaldlg.h>
#include <myterraindlg.h>
#include <myshaderdlg.h>
#include <mycursordlg.h>

#include "listviews.h"

class QcakeDoc;
class QListView;
class QLabel;
class QPainter;
class QColorGroup;
class QObjectList;
class QPopupMenu;
class Glcontrol;


/** The KCakeView class provides the view widget for the KCakeApp instance.	
 * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As KCakeView is part of the
 * docuement-view model, it needs a reference to the document object connected with it by the KCakeApp class to manipulate and display
 * the document structure provided by the KCakeDoc class.
 * 	
 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
 * @version KDevelop version 0.4 code generation
 */
class KCakeView : public QVBox
{
  Q_OBJECT
  public:
    /** Constructor for the main view */
    KCakeView(QWidget *parent = 0, const char *name=0);
    /** Destructor for the main view */
    ~KCakeView();

    /** returns a pointer to the document connected to the view instance. Mind that this method requires a KCakeApp instance as a parent
     * widget to get to the window document pointer by calling the KCakeApp::getDocument() method.
     *
     * @see KCakeApp#getDocument
     */
    QcakeDoc *getDocument() const;

    void newWirebox(FolderListItem * i);

    void initListView(QDomDocument *domdoc, const QString &path);
    void getListView(QDomDocument *domdoc);
    void buildDomTree( QDomElement *parentElement, FolderListItem *parentItem, QDomDocument *domdoc );
    void buildTree( FolderListItem *parentItem, const QDomElement &parentElement );
        
    /** contains the implementation for printing functionality */
    void print(QPrinter *pPrinter);

    QcakeDoc *doc;

    
public slots:

    void slotLoadObject();
    void slotAddTerrain();
    void slotAddBarrier();
    void slotAddFire();
    void slotAddPartSys();
    void slotAddWaveSys();
    void slotAddCamera();
    void slotViewCamera();
    void slotAddFog();
    void slotAddPlayer();
    void slotAddSpl();
    void slotAddSound();
    void slotAddGUITXT();
    void slotAddGUIInput();
    void slotAddGUIButton();
    void slotAddGUIOSButton();
    void slotAddSky();
    void slotAddBody();    
    void slotAddScene();
    void slotAddLamp();
    void slotAddShader();
    void slotAddCursor();
    void slotExportPlib();
    void slotRMB( QListViewItem *Item, const QPoint & point, int );
    void slotFolderChanged(QListViewItem *i);
  	
protected:


    QListView *messages, *folders;
    QLabel *message;
    QPopupMenu* menu[41];

  private:


   QListViewItem *folderitem;
   QWidgetStack* stack;
   QWorkspace* workspace;
   QSplitter* m_pMainSplitter;
   QSplitter* m_pTreeEditSplitter;
   QString mypath;
   Glcontrol    *gl;
   FolderListItem *tmpItem;
	
};

#endif // KCAKEVIEW_H
