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 "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
00061 virtual void init(QGraphicsWidget* topLevelGraphicsWidget, StelAppGraphicsWidget* stelAppGraphicsWidget);
00062 void update();
00063 virtual void updateI18n();
00064
00066 virtual void setStelStyle(const QString& section);
00067 StelStyle getStelStyle() const {return currentStelStyle;}
00068
00070
00072 void loadStyle(const QString& fileName);
00073
00077 class QProgressBar* addProgressBar();
00078
00080 BottomStelBar* getButtonBar();
00081
00083 class LeftStelBar* getWindowsButtonBar();
00084
00086 bool getFlagShowFlipButtons() {return flagShowFlipButtons;}
00087
00089 bool getFlagShowNebulaBackgroundButton() {return flagShowNebulaBackgroundButton;}
00090
00092 bool initComplete(void) {return initDone;}
00093
00094 #ifdef ENABLE_SCRIPT_CONSOLE
00095 ScriptConsole* getScriptConsole() {return &scriptConsole;}
00096 #endif
00097
00099 virtual void forceRefreshGui();
00100
00101 virtual void setVisible(bool b);
00102
00103 virtual bool getVisible() const;
00104
00105 virtual bool isCurrentlyUsed() const;
00106
00107 virtual void setInfoTextFilters(const StelObject::InfoStringGroup& aflags);
00108 virtual const StelObject::InfoStringGroup& getInfoTextFilters() const;
00109
00110 virtual QAction* addGuiActions(const QString& actionName, const QString& text, const QString& shortCut, const QString& helpGroup, bool checkable=true, bool autoRepeat=false);
00111
00112 public slots:
00114 void setFlagShowFlipButtons(bool b);
00115
00117 void setFlagShowNebulaBackgroundButton(bool b);
00118
00120 bool getAutoHideHorizontalButtonBar() const;
00126 void setAutoHideHorizontalButtonBar(bool b);
00127
00129 bool getAutoHideVerticalButtonBar() const;
00135 void setAutoHideVerticalButtonBar(bool b);
00136
00138 void setScriptKeys(bool b);
00139 void increaseScriptSpeed();
00140 void decreaseScriptSpeed();
00141 void setRealScriptSpeed();
00142
00144 void setGuiVisible(bool);
00145
00146 private slots:
00147 void reloadStyle();
00148 void scriptStarted();
00149 void scriptStopped();
00150 void quit();
00151
00152 private:
00153 QGraphicsWidget* topLevelGraphicsWidget;
00154
00155 class SkyGui* skyGui;
00156
00157 StelButton* buttonTimeRewind;
00158 StelButton* buttonTimeRealTimeSpeed;
00159 StelButton* buttonTimeCurrent;
00160 StelButton* buttonTimeForward;
00161
00162 StelButton* buttonGotoSelectedObject;
00163
00164 LocationDialog locationDialog;
00165 HelpDialog helpDialog;
00166 DateTimeDialog dateTimeDialog;
00167 SearchDialog searchDialog;
00168 ViewDialog viewDialog;
00169 ConfigurationDialog* configurationDialog;
00170 #ifdef ENABLE_SCRIPT_CONSOLE
00171 ScriptConsole scriptConsole;
00172 #endif
00173
00174 bool flagShowFlipButtons;
00175 StelButton* flipVert;
00176 StelButton* flipHoriz;
00177
00178 bool flagShowNebulaBackgroundButton;
00179 StelButton* btShowNebulaeBackground;
00180
00181 bool initDone;
00182 bool guiHidden;
00183
00184 QSizeF savedProgressBarSize;
00185
00186
00187 StelStyle currentStelStyle;
00188 };
00189
00191 class StelStandardGuiPluginInterface : public QObject, public StelGuiPluginInterface
00192 {
00193 Q_OBJECT
00194 Q_INTERFACES(StelGuiPluginInterface)
00195 public:
00196 virtual class StelGuiBase* getStelGuiBase() const;
00197 };
00198
00199 #endif // _STELGUI_HPP_