Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelGui.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2008 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (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 Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00018  */
00019 
00020 #ifndef _STELGUI_HPP_
00021 #define _STELGUI_HPP_
00022 
00023 #include "StelModule.hpp"
00024 #include "StelObject.hpp"
00025 #include "StelGuiBase.hpp"
00026 #include "StelStyle.hpp"
00027 
00028 #include <QGraphicsTextItem>
00029 
00030 class QGraphicsSceneMouseEvent;
00031 class QAction;
00032 class QTimeLine;
00033 class StelButton;
00034 class BottomStelBar;
00035 class InfoPanel;
00036 class ConfigurationDialog;
00037 class DateTimeDialog;
00038 class HelpDialog;
00039 class LocationDialog;
00040 class SearchDialog;
00041 class ViewDialog;
00042 class ShortcutsDialog;
00043 #ifdef ENABLE_SCRIPT_CONSOLE
00044 class ScriptConsole;
00045 #endif
00046 
00050 class StelGui : public QObject, public StelGuiBase
00051 {
00052     Q_OBJECT
00053 public:
00054     friend class ViewDialog;
00055     
00056     StelGui();
00057     virtual ~StelGui();
00058 
00060     // Methods defined in the StelModule class
00062     virtual void init(QGraphicsWidget* topLevelGraphicsWidget, StelAppGraphicsWidget* stelAppGraphicsWidget);
00063     void update();
00064 
00065     StelStyle getStelStyle() const {return currentStelStyle;}
00066     
00068     // Methods specific to the StelGui class
00070     void loadStyle(const QString& fileName);
00071     
00075     class QProgressBar* addProgressBar();
00076     
00078     BottomStelBar* getButtonBar() const;
00079     
00081     class LeftStelBar* getWindowsButtonBar() const;
00082 
00085     class SkyGui* getSkyGui() const;
00086     
00088     bool getFlagShowFlipButtons() const;
00089     
00091     bool getFlagShowNebulaBackgroundButton() const;
00092 
00094     bool initComplete(void) const;
00095 
00096 #ifdef ENABLE_SCRIPT_CONSOLE
00097     ScriptConsole* getScriptConsole() {return scriptConsole;}
00098 #endif
00099 
00101     virtual void forceRefreshGui();
00102     
00103     virtual void setVisible(bool b);
00104 
00105     virtual bool getVisible() const;
00106 
00107     virtual bool isCurrentlyUsed() const;
00108     
00109     virtual void setInfoTextFilters(const StelObject::InfoStringGroup& aflags);
00110     virtual const StelObject::InfoStringGroup& getInfoTextFilters() const;
00111 
00112     virtual QAction* getGuiAction(const QString& actionName);
00113 
00114 public slots:
00116     void setFlagShowFlipButtons(bool b);
00117     
00119     void setFlagShowNebulaBackgroundButton(bool b);
00120 
00122     bool getAutoHideHorizontalButtonBar() const;
00128     void setAutoHideHorizontalButtonBar(bool b);
00129     
00131     bool getAutoHideVerticalButtonBar() const;
00137     void setAutoHideVerticalButtonBar(bool b);
00138 
00139 #ifndef DISABLE_SCRIPTING
00140 
00141     void setScriptKeys(bool b);
00142     void increaseScriptSpeed();
00143     void decreaseScriptSpeed();
00144     void setRealScriptSpeed();
00145     void stopScript();
00146     void pauseScript();
00147     void resumeScript();
00148 #endif
00149 
00151     void setGuiVisible(bool);   
00152 
00153 private slots:
00154     void reloadStyle();
00155 #ifndef DISABLE_SCRIPTING
00156     void scriptStarted();
00157     void scriptStopped();
00158 #endif
00159 
00160     void setStelStyle(const QString& section);
00161     void quit();    
00162     void updateI18n();
00164     void artDisplayedUpdated(const bool displayed);
00165     void boundariesDisplayedUpdated(const bool displayed);
00166     void linesDisplayedUpdated(const bool displayed);
00167     void namesDisplayedUpdated(const bool displayed);
00169     void azimuthalGridDisplayedUpdated(const bool displayed);
00170     void equatorGridDisplayedUpdated(const bool displayed);
00171     void equatorJ2000GridDisplayedUpdated(const bool displayed);
00172     void eclipticJ2000GridDisplayedUpdated(const bool displayed);
00173     void galacticGridDisplayedUpdated(const bool displayed);
00174     void equatorLineDisplayedUpdated(const bool displayed);
00175     void eclipticLineDisplayedUpdated(const bool displayed);
00176     void meridianLineDisplayedUpdated(const bool displayed);
00177     void horizonLineDisplayedUpdated(const bool displayed);
00178     void galacticPlaneLineDisplayedUpdated(const bool displayed);
00180     void atmosphereDisplayedUpdated(const bool displayed);
00181     void cardinalsPointsDisplayedUpdated(const bool displayed);
00182     void fogDisplayedUpdated(const bool displayed);
00183     void landscapeDisplayedUpdated(const bool displayed);
00184     void copySelectedObjectInfo(void);
00185 
00186 private:
00187     QGraphicsWidget* topLevelGraphicsWidget;
00188 
00189     class SkyGui* skyGui;
00190     
00191     StelButton* buttonTimeRewind;
00192     StelButton* buttonTimeRealTimeSpeed;
00193     StelButton* buttonTimeCurrent;
00194     StelButton* buttonTimeForward;
00195     
00196     StelButton* buttonGotoSelectedObject;
00197     
00198     LocationDialog* locationDialog;
00199     HelpDialog* helpDialog;
00200     DateTimeDialog* dateTimeDialog;
00201     SearchDialog* searchDialog;
00202     ViewDialog* viewDialog;
00203     ShortcutsDialog* shortcutsDialog;
00204     ConfigurationDialog* configurationDialog;
00205 #ifdef ENABLE_SCRIPT_CONSOLE
00206     ScriptConsole* scriptConsole;
00207 #endif
00208 
00209     bool flagShowFlipButtons;
00210     StelButton* flipVert;
00211     StelButton* flipHoriz;
00212     
00213     bool flagShowNebulaBackgroundButton;
00214     StelButton* btShowNebulaeBackground;
00215 
00216     bool initDone;
00217     bool guiHidden;
00218     
00219     QSizeF savedProgressBarSize;
00220 
00221     // Currently used StelStyle
00222     StelStyle currentStelStyle;
00223 
00224     // This method is used by init() to initialize the ConstellationMgr instance.
00225     void initConstellationMgr();
00226 
00227     // This method is used by init() to initialize the GridLineMgr instance.
00228     void initGrindLineMgr();
00229 
00230     // This method is used by init() to initialize the LandscapeMgr instance.
00231     void initLandscapeMgr();
00232 };
00233 
00235 class StelStandardGuiPluginInterface : public QObject, public StelGuiPluginInterface
00236 {
00237     Q_OBJECT;
00238     Q_INTERFACES(StelGuiPluginInterface);
00239 public:
00240     virtual class StelGuiBase* getStelGuiBase() const;
00241 };
00242 
00243 #endif // _STELGUI_HPP_
Generated on Thu Jan 31 14:05:42 2013 for Stellarium by  doxygen 1.6.3