globalbase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                          globalbase.h  -  description
00003                              -------------------
00004     begin                : Thu Aug 8 2002
00005     copyright            : (C) 2002-2006 by Ben Swerts
00006     email                : bswerts@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00020 
00021 #ifndef GLOBALBASE_H
00022 #define GLOBALBASE_H
00023 
00025 
00027 class QDomElement;
00028 class QString;
00029 
00031 #include <globalwidget.h>
00032 
00033 
00035 class GlobalBase : public GlobalWidget
00036 {
00037   Q_OBJECT
00038 
00039   public:
00040     GlobalBase(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);       // constructor
00041     ~GlobalBase();                      // destructor
00042 
00044     enum Calculation{SinglePointEnergy, EnergyAndForces, GeometryOptimization, Frequencies};        
00045     enum Buur{NoBuur, PC, SM};          
00046     enum Run{Xbrabo, Script, Queue};    
00047 
00048     void setDefaultName(const QString name);      // sets the default calculation name
00049     unsigned int calculationType() const;         // returns the type of calculation
00050     unsigned int buurType() const;      // returns the type of crystal
00051     bool extendedFormat() const;        // returns whether extended format is to be used
00052     QString description() const;        // returns the description
00053     QString name() const;               // returns the name
00054     QString directory() const;          // returns the directory
00055     unsigned int runType() const;       // returns the type of run
00056     unsigned int queue() const;         // returns the queue
00057     void allowChanges(const bool status);         // enables/disables changing every option
00058 
00059     void loadCML(const QDomElement* root);        // loads the widget data from a CML file
00060     void saveCML(QDomElement* root);    // saves the widget data to a CML file
00061    
00062   public slots:
00063     void reset();                       // resets the widgets
00064 
00065   protected slots:
00066     void accept();                      // is called when the changes are accepted (OK clicked)
00067     void reject();                      // is called when the changes are rejected (Cancel or X clicked)
00068 
00069   private slots:
00070     void setChanged(const bool state = true);     // sets the 'changed' property of the dialog
00071     void correctType(int index);        // corrects the calculation type for unimplemented choices
00072     void chooseDir();                   // chooses a working dir
00073     
00074   private:
00076     void makeConnections();             // sets up the permanent connections
00077     void init();                        // initializes the dialog
00078     void saveWidgets();                 // saves widgets appearances
00079     void restoreWidgets();              // restores widgets appearances
00080 
00082     struct WidgetData
00085     {
00086       unsigned int      type;
00087       bool              useBuur;
00088       unsigned int      buurType;
00089       bool              useXF;
00090       QString           description;
00091       QString           name;
00092       QString           directory;
00093       unsigned int      runType;
00094       unsigned int      queue;
00095     };
00096 
00097     WidgetData data;                    
00098     QString defaultName;                
00099     bool widgetChanged;                 
00100 };
00101 
00102 #endif
00103 

Generated on Fri May 19 14:31:54 2006 for Brabosphere by  doxygen 1.4.6-NO