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

gui/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 "LocationDialog.hpp"
00026 #include "ViewDialog.hpp"
00027 #include "HelpDialog.hpp"
00028 #include "DateTimeDialog.hpp"
00029 #include "SearchDialog.hpp"
00030 #include "ConfigurationDialog.hpp"
00031 #ifdef ENABLE_SCRIPT_CONSOLE
00032 #include "ScriptConsole.hpp"
00033 #endif
00034 #include "StelGuiBase.hpp"
00035 #include "StelStyle.hpp"
00036 
00037 #include <QGraphicsTextItem>
00038 
00039 class QGraphicsSceneMouseEvent;
00040 class QAction;
00041 class QTimeLine;
00042 class StelButton;
00043 class BottomStelBar;
00044 class InfoPanel;
00045 
00049 class StelGui : public QObject, public StelGuiBase
00050 {
00051     Q_OBJECT
00052 public:
00053     friend class ViewDialog;
00054     
00055     StelGui();
00056     virtual ~StelGui();
00057 
00059     // Methods defined in the StelModule class
00061     virtual void init(QGraphicsWidget* topLevelGraphicsWidget, StelAppGraphicsWidget* stelAppGraphicsWidget);
00062     void update();
00063 
00064     StelStyle getStelStyle() const {return currentStelStyle;}
00065     
00067     // Methods specific to the StelGui class
00069     void loadStyle(const QString& fileName);
00070     
00074     class QProgressBar* addProgressBar();
00075     
00077     BottomStelBar* getButtonBar() const;
00078     
00080     class LeftStelBar* getWindowsButtonBar() const;
00081 
00084     class SkyGui* getSkyGui() const;
00085     
00087     bool getFlagShowFlipButtons() const;
00088     
00090     bool getFlagShowNebulaBackgroundButton() const;
00091 
00093     bool initComplete(void) const;
00094 
00095 #ifdef ENABLE_SCRIPT_CONSOLE
00096     ScriptConsole* getScriptConsole() {return &scriptConsole;}
00097 #endif
00098 
00100     virtual void forceRefreshGui();
00101     
00102     virtual void setVisible(bool b);
00103 
00104     virtual bool getVisible() const;
00105 
00106     virtual bool isCurrentlyUsed() const;
00107     
00108     virtual void setInfoTextFilters(const StelObject::InfoStringGroup& aflags);
00109     virtual const StelObject::InfoStringGroup& getInfoTextFilters() const;
00110     
00111     virtual QAction* addGuiActions(const QString& actionName,
00112                                      const QString& text,
00113                                      const QString& shortCut,
00114                                      const QString& helpGroup,
00115                                      bool checkable=true,
00116                                      bool autoRepeat=false,
00117                                      bool global = false);
00118     
00119 public slots:
00121     void setFlagShowFlipButtons(bool b);
00122     
00124     void setFlagShowNebulaBackgroundButton(bool b);
00125 
00127     bool getAutoHideHorizontalButtonBar() const;
00133     void setAutoHideHorizontalButtonBar(bool b);
00134     
00136     bool getAutoHideVerticalButtonBar() const;
00142     void setAutoHideVerticalButtonBar(bool b);
00143 
00144     #ifndef DISABLE_SCRIPTING
00145 
00146     void setScriptKeys(bool b);
00147     void increaseScriptSpeed();
00148     void decreaseScriptSpeed();
00149     void setRealScriptSpeed();
00150     #endif
00151 
00153     void setGuiVisible(bool);
00154 
00155 private slots:
00156     void reloadStyle();
00157     #ifndef DISABLE_SCRIPTING
00158     void scriptStarted();
00159     void scriptStopped();
00160     #endif
00161 
00162     void setStelStyle(const QString& section);
00163     void quit();
00164     void updateI18n();
00166     void artDisplayedUpdated(const bool displayed);
00167     void boundariesDisplayedUpdated(const bool displayed);
00168     void linesDisplayedUpdated(const bool displayed);
00169     void namesDisplayedUpdated(const bool displayed);
00171     void azimuthalGridDisplayedUpdated(const bool displayed);
00172     void equatorGridDisplayedUpdated(const bool displayed);
00173     void equatorJ2000GridDisplayedUpdated(const bool displayed);
00174     void eclipticJ2000GridDisplayedUpdated(const bool displayed);
00175     void galacticGridDisplayedUpdated(const bool displayed);
00176     void equatorLineDisplayedUpdated(const bool displayed);
00177     void eclipticLineDisplayedUpdated(const bool displayed);
00178     void meridianLineDisplayedUpdated(const bool displayed);
00179     void horizonLineDisplayedUpdated(const bool displayed);
00180     void galacticPlaneLineDisplayedUpdated(const bool displayed);
00182     void atmosphereDisplayedUpdated(const bool displayed);
00183     void cardinalsPointsDisplayedUpdated(const bool displayed);
00184     void fogDisplayedUpdated(const bool displayed);
00185     void landscapeDisplayedUpdated(const bool displayed);
00186     void copySelectedObjectInfo(void);
00187 
00188 private:
00189     QGraphicsWidget* topLevelGraphicsWidget;
00190 
00191     class SkyGui* skyGui;
00192     
00193     StelButton* buttonTimeRewind;
00194     StelButton* buttonTimeRealTimeSpeed;
00195     StelButton* buttonTimeCurrent;
00196     StelButton* buttonTimeForward;
00197     
00198     StelButton* buttonGotoSelectedObject;
00199     
00200     LocationDialog locationDialog;
00201     HelpDialog helpDialog;
00202     DateTimeDialog dateTimeDialog;
00203     SearchDialog searchDialog;
00204     ViewDialog viewDialog;
00205     ConfigurationDialog* configurationDialog;
00206 #ifdef ENABLE_SCRIPT_CONSOLE
00207     ScriptConsole scriptConsole;
00208 #endif
00209 
00210     bool flagShowFlipButtons;
00211     StelButton* flipVert;
00212     StelButton* flipHoriz;
00213     
00214     bool flagShowNebulaBackgroundButton;
00215     StelButton* btShowNebulaeBackground;
00216 
00217     bool initDone;
00218     bool guiHidden;
00219     
00220     QSizeF savedProgressBarSize;
00221 
00222     // Currently used StelStyle
00223     StelStyle currentStelStyle;
00224 
00225     // This method is used by init() to initialize the ConstellationMgr instance.
00226     void initConstellationMgr();
00227 
00228     // This method is used by init() to initialize the GridLineMgr instance.
00229     void initGrindLineMgr();
00230 
00231     // This method is used by init() to initialize the LandscapeMgr instance.
00232     void initLandscapeMgr();
00233 };
00234 
00236 class StelStandardGuiPluginInterface : public QObject, public StelGuiPluginInterface
00237 {
00238     Q_OBJECT
00239     Q_INTERFACES(StelGuiPluginInterface)
00240 public:
00241     virtual class StelGuiBase* getStelGuiBase() const;
00242 };
00243 
00244 #endif // _STELGUI_HPP_
Generated on Thu May 31 10:37:19 2012 for Stellarium by  doxygen 1.6.3