/****************************************************************************
** Form interface generated from reading ui file '../ide/idewindow.ui'
**
** Created: dom dic 28 12:16:10 2008
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#ifndef IDEWINDOW_H
#define IDEWINDOW_H

#include <qvariant.h>
#include <qmainwindow.h>

class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QAction;
class QActionGroup;
class QToolBar;
class QPopupMenu;
class QTabWidget;
class QWidget;
class QDockWindow;
class QSProject;
class QSScript;
class QSOutputContainer;
class QSProjectContainer;
class QSVariablesContainer;
class QSPreferencesContainer;
class QListViewItem;
class QSFindText;
class QSGotoLine;
class QSReplaceText;
class PreferencesBase;

class IdeWindow : public QMainWindow
{
    Q_OBJECT

public:
    IdeWindow( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel );
    ~IdeWindow();

    QTabWidget* tabWidget;
    QWidget* tab;
    QMenuBar *menubar;
    QPopupMenu *fileMenu;
    QPopupMenu *editMenu;
    QPopupMenu *searchMenu;
    QPopupMenu *projectMenu;
    QPopupMenu *windowMenu;
    QPopupMenu *helpMenu;
    QToolBar *fileToolBar;
    QToolBar *editToolbar;
    QToolBar *projectToolbar;
    QAction* fileNewAction;
    QAction* fileImportAction;
    QAction* fileExportAction;
    QAction* fileExitAction;
    QAction* filePrintAction;
    QAction* fileRenameAction;
    QAction* editUndoAction;
    QAction* editRedoAction;
    QAction* editCutAction;
    QAction* editCopyAction;
    QAction* editPasteAction;
    QAction* editFindAction;
    QAction* editFindAgainAction;
    QAction* editFindAgainBWAction;
    QAction* editPreferencesAction;
    QAction* helpContentsAction;
    QAction* helpIndexAction;
    QAction* helpAboutAction;
    QAction* fileCloseAction;
    QAction* fileRemoveAction;
    QAction* projectRunAction;
    QAction* editSelectAllAction;
    QAction* editGotoLineAction;
    QAction* editReplaceAction;
    QAction* projectCallAction;
    QAction* projectEvaluateAction;
    QAction* projectStopAction;

    QSProject *project;

    virtual void editReplace( bool all );
    void init();
    void setupActionIcons();
    virtual void setProject( QSProject * p );
    virtual void showEvent(QShowEvent *e);
    virtual void hideEvent(QHideEvent *e);
    virtual void setRunningState(bool);

public slots:
    virtual void scriptNew();
    virtual void scriptImport();
    virtual void scriptExport();
    virtual void scriptExit();
    virtual void scriptPrint();
    virtual void scriptRename();
    virtual void editUndo();
    virtual void editRedo();
    virtual void editCut();
    virtual void editCopy();
    virtual void editPaste();
    virtual void editFind();
    virtual void editFindNext();
    virtual void editFindPrev();
    virtual void editReplace();
    virtual void editReplaceAll();
    virtual void editSelectAll();
    virtual void editPreferences();
    virtual void editGotoLine();
    virtual void helpIndex();
    virtual void helpContents();
    virtual void helpAbout();
    virtual void addPage( QSScript * s );
    virtual void removePage( QSScript * s );
    virtual void removePage();
    virtual void showPage( QSScript * s );
    virtual void showFunction( QSScript * s, const QString & f );
    virtual void removeScript( QSScript * s );
    virtual void removeScript();
    virtual void projectRun();
    virtual void projectCall();
    virtual void projectStop();
    virtual void currentTabChanged( QWidget * w );
    virtual void projectError( const QString & msg, const QString &, int line );
    virtual void scriptItemDoubleClicked( QListViewItem * i );
    virtual void enableEditActions( bool enable );
    virtual void enableProjectActions( bool enable );
    virtual void textChanged();
    virtual void savePreferences();
    virtual void projectChanged();
    virtual void evaluateProject();
    virtual void interpreterTimeout(int);

protected:
    int newVariable;

    QGridLayout* IdeWindowLayout;
    QGridLayout* tabLayout;

protected slots:
    virtual void languageChange();

private:
    int errorMode;
    bool hadError;
    PreferencesBase *qsaEditorSyntax;
    QSPreferencesContainer *preferencesContainer;
    QSProjectContainer *projectContainer;
    QDockWindow *projectContainerDock;
    QSVariablesContainer *variablesContainer;
    QDockWindow *variablesContainerDock;
    QString runFunction;
    QDockWindow *outputContainerDock;
    QSOutputContainer *outputContainer;
    QSFindText *findText;
    QSGotoLine *gotoLine;
    QSReplaceText *replaceText;

};

#endif // IDEWINDOW_H
