programpage.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Lynn Hazan                                      *
00003  *   lynn.hazan@myrealbox.com                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef PROGRAMPAGE_H
00021 #define PROGRAMPAGE_H
00022 
00023 //include files for the application
00024 #include "parameterpage.h"
00025 #include "editormanager.h"
00026 
00027 // include files for QT
00028 #include <qwidget.h>
00029 #include <qframe.h>
00030 
00031 //include files for KDE
00032 #include <kurl.h> 
00033 #include <kate/view.h>
00034 
00035 //forward declaration
00036 class QTabWidget;
00037 class QPushButton;
00038 class KTextEdit;
00039 
00040 //General C++ include files
00041 #include <iostream>
00042 using namespace std;
00043 
00047 class ProgramPage : public QFrame
00048 {
00049 Q_OBJECT
00050 public:
00056  ProgramPage(bool expertMode,QWidget* parent = 0, const char* name = 0);
00057  ~ProgramPage();
00058  
00060  inline ParameterPage* getParameterPage(){return parameters;};
00061  
00063  inline KTextEditor::Document* getScript(){return scriptDoc;}; 
00064  
00066  inline Kate::View* getScriptView(){return scriptView;}; 
00067  
00069  QString getHelp();
00070  
00072  void setHelp(QString helpContent);
00073  
00075  bool areParametersModified()const;
00076 
00081  bool isDescriptionModified()const;
00082  
00087  bool isDescriptionModifiedAndNotSaved()const;
00088  
00090  inline bool isScriptModified()const{return sciptIsModified;};
00091  
00093  inline void initialisationOver(){isInit = false;}
00094  
00095 signals:
00096  void programToRemove(ProgramPage* programPage);
00097  void programNameChanged(ProgramPage* programPage,const QString& name,QString message,QString title);
00098  void scriptShown(Kate::View* scriptView);
00099  void scriptHidden();
00100  
00101  
00102 public slots:
00103  inline void removeProgram(){
00104   emit programToRemove(this);
00105  };
00107  void saveProgramParameters();
00108  
00112  bool saveProgramScript();
00113   
00117  void nameChanged(const QString& name);
00118     
00120  inline void scriptModified(){if(!isInit) sciptIsModified = true;};
00121  
00123  inline void helpModified(){if(!isInit) helpIsModified = true;};
00124  
00126  inline void resetModificationStatus(){
00127   sciptIsModified = false;
00128   helpIsModified = false;
00129   parameters->resetModificationStatus();
00130  };
00131  
00132 private slots:
00133   
00135  void tabChange(QWidget* widget);
00136 
00137  
00138 private: 
00139  QTabWidget* tabWidget;
00140  QPushButton* removeButton;
00141  QPushButton* saveScriptButton; 
00142  QPushButton* saveParametersButton;      
00143  ParameterPage* parameters;
00144  KTextEdit* script; 
00145  bool sciptIsModified;
00146  bool isInit;
00147  QString programName;
00148  KURL descriptionUrl;
00149  KTextEdit* help;
00150  bool helpIsModified;
00151  EditorManager* editorMgr;
00152  KTextEditor::Document* scriptDoc;
00153  Kate::View* scriptView; 
00154  bool descriptionNotSaved;
00155  
00157  bool expertMode;  
00158 };
00159 
00160 #endif

Generated on Sat Sep 15 16:04:45 2007 for ndmanager.kdevelop by  doxygen 1.5.1