00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 #ifdef ENABLE_SCRIPT_CONSOLE
00043 class ScriptConsole;
00044 #endif
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
00061 virtual void init(QGraphicsWidget* topLevelGraphicsWidget, StelAppGraphicsWidget* stelAppGraphicsWidget);
00062 void update();
00063
00064 StelStyle getStelStyle() const {return currentStelStyle;}
00065
00067
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 void stopScript();
00151 void pauseScript();
00152 void resumeScript();
00153 #endif
00154
00156 void setGuiVisible(bool);
00157
00158 private slots:
00159 void reloadStyle();
00160 #ifndef DISABLE_SCRIPTING
00161 void scriptStarted();
00162 void scriptStopped();
00163 #endif
00164
00165 void setStelStyle(const QString& section);
00166 void quit();
00167 void updateI18n();
00169 void artDisplayedUpdated(const bool displayed);
00170 void boundariesDisplayedUpdated(const bool displayed);
00171 void linesDisplayedUpdated(const bool displayed);
00172 void namesDisplayedUpdated(const bool displayed);
00174 void azimuthalGridDisplayedUpdated(const bool displayed);
00175 void equatorGridDisplayedUpdated(const bool displayed);
00176 void equatorJ2000GridDisplayedUpdated(const bool displayed);
00177 void eclipticJ2000GridDisplayedUpdated(const bool displayed);
00178 void galacticGridDisplayedUpdated(const bool displayed);
00179 void equatorLineDisplayedUpdated(const bool displayed);
00180 void eclipticLineDisplayedUpdated(const bool displayed);
00181 void meridianLineDisplayedUpdated(const bool displayed);
00182 void horizonLineDisplayedUpdated(const bool displayed);
00183 void galacticPlaneLineDisplayedUpdated(const bool displayed);
00185 void atmosphereDisplayedUpdated(const bool displayed);
00186 void cardinalsPointsDisplayedUpdated(const bool displayed);
00187 void fogDisplayedUpdated(const bool displayed);
00188 void landscapeDisplayedUpdated(const bool displayed);
00189 void copySelectedObjectInfo(void);
00190
00191 private:
00192 QGraphicsWidget* topLevelGraphicsWidget;
00193
00194 class SkyGui* skyGui;
00195
00196 StelButton* buttonTimeRewind;
00197 StelButton* buttonTimeRealTimeSpeed;
00198 StelButton* buttonTimeCurrent;
00199 StelButton* buttonTimeForward;
00200
00201 StelButton* buttonGotoSelectedObject;
00202
00203 LocationDialog* locationDialog;
00204 HelpDialog* helpDialog;
00205 DateTimeDialog* dateTimeDialog;
00206 SearchDialog* searchDialog;
00207 ViewDialog* viewDialog;
00208 ConfigurationDialog* configurationDialog;
00209 #ifdef ENABLE_SCRIPT_CONSOLE
00210 ScriptConsole* scriptConsole;
00211 #endif
00212
00213 bool flagShowFlipButtons;
00214 StelButton* flipVert;
00215 StelButton* flipHoriz;
00216
00217 bool flagShowNebulaBackgroundButton;
00218 StelButton* btShowNebulaeBackground;
00219
00220 bool initDone;
00221 bool guiHidden;
00222
00223 QSizeF savedProgressBarSize;
00224
00225
00226 StelStyle currentStelStyle;
00227
00228
00229 void initConstellationMgr();
00230
00231
00232 void initGrindLineMgr();
00233
00234
00235 void initLandscapeMgr();
00236 };
00237
00239 class StelStandardGuiPluginInterface : public QObject, public StelGuiPluginInterface
00240 {
00241 Q_OBJECT
00242 Q_INTERFACES(StelGuiPluginInterface)
00243 public:
00244 virtual class StelGuiBase* getStelGuiBase() const;
00245 };
00246
00247 #endif // _STELGUI_HPP_