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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 
00036 #include <QGraphicsTextItem>
00037 
00038 class QGraphicsSceneMouseEvent;
00039 class QAction;
00040 class QTimeLine;
00041 class StelButton;
00042 class BottomStelBar;
00043 class InfoPanel;
00044 
00048 class StelGui : public QObject, public StelGuiBase
00049 {
00050     Q_OBJECT
00051 public:
00052     friend class ViewDialog;
00053     
00054     StelGui();
00055     virtual ~StelGui();
00056 
00058     // Methods defined in the StelModule class
00060     virtual void init(QGraphicsWidget* topLevelGraphicsWidget, StelAppGraphicsWidget* stelAppGraphicsWidget);
00061     void update();
00062     virtual void updateI18n();
00063 
00065     virtual void setStelStyle(const StelStyle& style);
00066     
00068     // Methods specific to the StelGui class
00070     void loadStyle(const QString& fileName);
00071     
00075     class QProgressBar* addProgressBar();
00076     
00078     BottomStelBar* getButtonBar();
00079     
00081     class LeftStelBar* getWindowsButtonBar();
00082     
00084     bool getFlagShowFlipButtons() {return flagShowFlipButtons;}
00085     
00087     bool getFlagShowNebulaBackgroundButton() {return flagShowNebulaBackgroundButton;}
00088 
00090     bool initComplete(void) {return initDone;}
00091 
00092 #ifdef ENABLE_SCRIPT_CONSOLE
00093     ScriptConsole* getScriptConsole() {return &scriptConsole;}
00094 #endif
00095 
00097     virtual void forceRefreshGui();
00098     
00099     virtual void setVisible(bool b);
00100 
00101     virtual bool getVisible() const;
00102 
00103     virtual bool isCurrentlyUsed() const;
00104     
00105     virtual void setInfoTextFilters(const StelObject::InfoStringGroup& aflags);
00106     virtual const StelObject::InfoStringGroup& getInfoTextFilters() const;
00107     
00108     virtual QAction* addGuiActions(const QString& actionName, const QString& text, const QString& shortCut, const QString& helpGroup, bool checkable=true, bool autoRepeat=false);
00109     
00110 public slots:
00112     void setFlagShowFlipButtons(bool b);
00113     
00115     void setFlagShowNebulaBackgroundButton(bool b);
00116 
00118     bool getAutoHideHorizontalButtonBar() const;
00124     void setAutoHideHorizontalButtonBar(bool b);
00125     
00127     bool getAutoHideVerticalButtonBar() const;
00133     void setAutoHideVerticalButtonBar(bool b);
00134 
00136     void setScriptKeys(bool b);
00137     void increaseScriptSpeed();
00138     void decreaseScriptSpeed();
00139     void setRealScriptSpeed();
00140 
00142     void setGuiVisible(bool);
00143 
00144 private slots:
00145     void reloadStyle();
00146     void scriptStarted();
00147     void scriptStopped();
00148     
00149 private:
00150     QGraphicsWidget* topLevelGraphicsWidget;
00151             
00152     class SkyGui* skyGui;
00153     
00154     StelButton* buttonTimeRewind;
00155     StelButton* buttonTimeRealTimeSpeed;
00156     StelButton* buttonTimeCurrent;
00157     StelButton* buttonTimeForward;
00158     
00159     StelButton* buttonGotoSelectedObject;
00160     
00161     LocationDialog locationDialog;
00162     HelpDialog helpDialog;
00163     DateTimeDialog dateTimeDialog;
00164     SearchDialog searchDialog;
00165     ViewDialog viewDialog;
00166     ConfigurationDialog* configurationDialog;
00167 #ifdef ENABLE_SCRIPT_CONSOLE
00168     ScriptConsole scriptConsole;
00169 #endif
00170 
00171     bool flagShowFlipButtons;
00172     class StelButton* flipVert;
00173     class StelButton* flipHoriz;
00174     
00175     bool flagShowNebulaBackgroundButton;
00176     class StelButton* btShowNebulaeBackground;
00177 
00178     bool initDone;
00179     bool guiHidden;
00180     
00181     QSizeF savedProgressBarSize;
00182 };
00183 
00185 class StelStandardGuiPluginInterface : public QObject, public StelGuiPluginInterface
00186 {
00187     Q_OBJECT
00188     Q_INTERFACES(StelGuiPluginInterface)
00189 public:
00190     virtual class StelGuiBase* getStelGuiBase() const;
00191 };
00192 
00193 #endif // _STELGUI_HPP_

Generated on Mon Mar 22 09:55:38 2010 for Stellarium by  doxygen 1.5.5