00001 /*************************************************************************** 00002 crdview.h - description 00003 ------------------- 00004 begin : Tue Jan 13 2004 00005 copyright : (C) 2004-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 CRDVIEW_H 00022 #define CRDVIEW_H 00023 00025 00026 // Qt forward class declarations 00027 class QAction; 00028 class QPopupmenu; 00029 00030 // CrdView forward class declarations and includes 00031 class AtomSet; 00032 class GLSimpleMoleculeView; 00033 class PreferencesCV; 00034 #include "glbaseparameters.h" 00035 #include "glmoleculeparameters.h" 00036 #include "iconsets.h" 00037 00038 // CrdView base class header file 00039 #include <qmainwindow.h> 00040 00042 class CrdView : public QMainWindow 00043 { 00044 Q_OBJECT 00045 00046 public: 00047 CrdView(); // constructor 00048 ~CrdView(); // destructor 00049 00050 void readCoordinates(QString filename = QString::null); // loads the given filename for viewing or asks for one if not specified 00051 00052 private slots: 00053 void fileOpen(); // Opens a coordinate file 00054 void fileSave(); // Saves a coordinate file 00055 void fileExport(); // Saves the current view as an image 00056 void filePreferences(); // Sets up the preferences 00057 void viewToolBar(bool toggle); // Toggles the visibility of the toolbar 00058 void viewStatusBar(bool toggle); // Toggles the visibility of the statusbar 00059 void helpHelp(); // Shows help 00060 void helpWhatsThis(); // Enters What's This mode 00061 void helpAbout(); // Shows the About dialog box 00062 00063 //protected: 00064 //void showEvent(QShowEvent*); // re-updates the GLMoleculeView in case of preloading 00065 00066 private: 00068 void initActions(); // creates all actions 00069 void initMenuBar(); // creates the menu 00070 void initToolBar(); // creates the toolbar(s) 00071 void readSettings(); // reads the Brabosphere and CrdView settings 00072 void saveSettings(); // saves the CrdView settings 00073 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 00074 00076 // toolbars 00077 QToolBar* ToolBarFile; // the toolbar containing shortcuts to the File menu 00078 // actions: menu File 00079 QAction* actionFileOpen; 00080 QAction* actionFileSave; 00081 QAction* actionFilePreferences; 00082 QAction* actionFileExport; 00083 QAction* actionFileQuit; 00084 // actions: menu View 00085 QAction* actionViewToolBar; 00086 QAction* actionViewStatusBar; 00087 // actions: menu Reset 00088 QAction* actionCenterView; 00089 QAction* actionResetOrientation; 00090 QAction* actionZoomFit; 00091 QAction* actionResetView; 00092 // actions: other 00093 QAction* actionSelectAll; 00094 QAction* actionSelectNone; 00095 QAction* actionAnimate; 00096 // actions: menu Help 00097 QAction* actionHelp; 00098 QAction* actionWhatsThis; 00099 QAction* actionAbout; 00100 // Xbrabo classes 00101 AtomSet* atoms; 00102 GLSimpleMoleculeView* glview; 00103 }; 00104 #endif 00105