00001 /*************************************************************************** 00002 xbrabo.h - description 00003 ------------------- 00004 begin : Fri Jul 19 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 XBRABO_H 00022 #define XBRABO_H 00023 00025 00026 // Qt forward class declarations 00027 class QAction; 00028 class QPopupMenu; 00029 00030 // Xbrabo forward class declarations 00031 #include "iconsets.h" 00032 class PreferencesBase; 00033 class XbraboView; 00034 00035 // Base class header file 00036 #if defined(USE_KMDI) || defined(USE_KMDI_DLL) 00037 # include<kmdimainfrm.h> 00038 # define QextMdiMainFrm KMdiMainFrm 00039 #else 00040 #include <qextmdimainfrm.h> 00041 #endif 00042 00044 class Xbrabo : public QextMdiMainFrm 00045 { 00046 Q_OBJECT 00047 00048 public: 00050 Xbrabo(); // constructor 00051 ~Xbrabo(); // destructor 00052 00054 void init(); // initializes everything 00055 void fileOpen(const QString filename); // opens a calculation with the specified name 00056 00057 protected: 00058 bool event(QEvent* e); // handles MDI child close events 00059 void resizeEvent(QResizeEvent* ); // fits the system menu button position to the menu position 00060 void closeEvent(QCloseEvent* e); // closes the application 00061 00062 private slots: 00064 void fileNew(); // creates a new calculation 00065 void fileOpen(); // opens an existing calculation and asks a filename (overloaded) 00066 void fileSave(); // saves a calculation 00067 void fileSaveAs(); // saves a calculation under a different name 00068 void fileClose(); // closes the active calculation 00069 00071 void editCut(); // deletes the marked text and put it on the clipboard 00072 void editCopy(); // puts the marked text on the clipboard 00073 void editPaste(); // pastes the contents of the clipboard 00074 void editPrefs(); // changes program references 00075 00077 void viewToolBarStandard(); // toggles the Standard toolbar 00078 void viewToolBarCalculation(); // toggles the Calculation toolbar 00079 void viewToolBarCoordinates(); // toggles the Coordinates toolbar 00080 void viewStatusBar(); // toggles the statusbar 00081 void viewTaskBar(); // toggles the taskbar 00082 00084 void moleculeReadCoordinates(); // reads coordinates from disk 00085 void moleculeCenterView(); // centers the molecule in the view 00086 void moleculeResetOrientation(); // resets the orientation of the molecule 00087 void moleculeZoomFit(); // resets the zoom of the molecule 00088 void moleculeResetView(); // resets translation/orientation/zoom of the molecule 00089 void moleculeAnimate(); // toggles animation of the molecule on/off 00090 void moleculeFPS(); // calculates the FPS with the current view parameters 00091 void moleculeImage(); // saves the current view to an image 00092 void moleculeAddAtoms(); // allows atoms to be added 00093 void moleculeDeleteSelection(); // deletes the selected atoms 00094 void moleculeDensity(); // changes the density isosurfaces 00095 void moleculeDisplayMode(); // changes the molecular display mode 00096 void moleculeAlterCartesian(); // alters the cartesian coordinates of the selected atoms 00097 void moleculeAlterInternal(); // alters the selected internal coordinate 00098 void moleculeSelectAll(); // selects all atoms 00099 void moleculeSelectNone(); // deselects all atoms 00100 void moleculeSaveCoordinates(); // saves the coordinates from disk 00101 void moleculeSelection(); // toggles manipulation of the selection 00102 00104 void setupGlobal(); // sets up global options 00105 void setupBrabo(); // sets up Brabo options 00106 void setupRelax(); // sets up Relax options 00107 void setupFreq(); // sets up Distor & Forkon options 00108 void setupBuur(); // sets up Buur options 00109 00111 void runStart(); // starts the calculation 00112 void runPause(); // pauses the calculation 00113 void runStop(); // stops the calculation 00114 void runWrite(); // writes all the input files needed for the calculation 00115 void runClean(); // cleans the calculation directory. 00116 00118 void resultsViewOutput(); // shows the output file(s) 00119 00121 void toolsPlotMap(); // shows a 2D map from a .map.1 file 00122 void toolsOrbitals(); // shows a 3D representation of orbitals 00123 00125 void helpHelp(); // shows some general help 00126 void helpWhatsThis(); // enters What's This mode 00127 void helpCredits(); // gives some credits 00128 void helpAbout(); // shows an about dialog 00129 00131 virtual void switchToToplevelMode(); // undocks all view windows 00132 virtual void switchToChildframeMode(); // docks all view windows 00133 virtual void switchToTabPageMode(); // docks all view windows in tabpage mode 00134 void updateActions(); // adapts actions when focus between views changed 00135 void fixToplevelModeHeight(); // updates the fixed height when in Toplevel mode 00136 void fixToplevelModeHeight2(); // the actual worker function for the previously declared function 00137 00138 private: 00141 void loadGeometry(); // initialization needed for the first showing of the mainwindow 00142 void initActions(); // creates the actions 00143 void initMenuBar(); // creates the menubar 00144 void initToolBars(); // creates the toolbars 00145 //void initStatusBar(); // creates the statusbar 00146 00148 void updatePreferences(); // updates the preferences 00149 void updateToolbarsInfo(); // updates editPreferences with the toolbar info 00150 void restoreToolbars(); // restores the toolbars 00151 QString actionText(const QString title, const QString brief, const QString details = QString::null, const IconSets::IconSetID iconID = IconSets::LastIcon); // constructs a text for the What's This mode for actions 00152 00155 QToolBar* ToolBarStandard; 00156 QToolBar* ToolBarCalculation; 00157 QToolBar* ToolBarCoordinates; 00158 00159 QAction* actionFileNew; 00160 QAction* actionFileOpen; 00161 QAction* actionFileSave; 00162 QAction* actionFileSaveAs; 00163 QAction* actionFileClose; 00164 QAction* actionFileQuit; 00165 QAction* actionEditCut; 00166 QAction* actionEditCopy; 00167 QAction* actionEditPaste; 00168 QAction* actionEditPrefs; 00169 QAction* actionViewToolBarStandard; 00170 QAction* actionViewToolBarCalculation; 00171 QAction* actionViewToolBarCoordinates; 00172 QAction* actionViewStatusBar; 00173 QAction* actionViewTaskBar; 00174 QAction* actionMoleculeReadCoordinates; 00175 QAction* actionMoleculeCenterView; 00176 QAction* actionMoleculeResetOrientation; 00177 QAction* actionMoleculeZoomFit; 00178 QAction* actionMoleculeResetView; 00179 QAction* actionMoleculeAnimate; 00180 QAction* actionMoleculeFPS; 00181 QAction* actionMoleculeImage; 00182 QAction* actionMoleculeAddAtom; 00183 QAction* actionMoleculeDeleteSelection; 00184 QAction* actionMoleculeDensity; 00185 QAction* actionMoleculeDisplayMode; 00186 QAction* actionMoleculeAlterCartesian; 00187 QAction* actionMoleculeAlterInternal; 00188 QAction* actionMoleculeSelectAll; 00189 QAction* actionMoleculeSelectNone; 00190 QAction* actionMoleculeSaveCoordinates; 00191 QAction* actionMoleculeSelection; 00192 QAction* actionSetupGlobal; 00193 QAction* actionSetupBrabo; 00194 QAction* actionSetupRelax; 00195 QAction* actionSetupFreq; 00196 QAction* actionSetupBuur; 00197 QAction* actionRunStart; 00198 QAction* actionRunPause; 00199 QAction* actionRunStop; 00200 QAction* actionRunWrite; 00201 QAction* actionRunClean; 00202 QAction* actionResultsViewOutput; 00203 QAction* actionToolsPlotMap; 00204 QAction* actionToolsOrbitals; 00205 QAction* actionHelp; 00206 QAction* actionWhatsThis; 00207 QAction* actionCredits; 00208 QAction* actionAbout; 00209 00210 XbraboView* view; 00211 PreferencesBase* editPreferences; 00212 }; 00213 00214 #endif 00215