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

SkyGui.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2009 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 _SKYGUI_HPP_
00021 #define _SKYGUI_HPP_
00022 
00023 #include "StelStyle.hpp"
00024 #include "StelObject.hpp"
00025 
00026 #include <QDebug>
00027 #include <QGraphicsWidget>
00028 
00029 class QGraphicsSceneMouseEvent;
00030 class QAction;
00031 class QGraphicsTextItem;
00032 class QTimeLine;
00033 class StelButton;
00034 class BottomStelBar;
00035 
00036 
00038 class InfoPanel : public QGraphicsTextItem
00039 {
00040     public:
00043         InfoPanel(QGraphicsItem* parent);
00044         void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
00045         const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
00046         void setTextFromObjects(const QList<StelObjectP>&);
00047         const QString getSelectedText(void);
00048 
00049     private:
00050         StelObject::InfoStringGroup infoTextFilters;
00051 };
00052 
00054 class SkyGui: public QGraphicsWidget
00055 {
00056     Q_OBJECT
00057 
00058 public:
00059     friend class StelGui;
00060     
00061     SkyGui(QGraphicsItem * parent=NULL);
00065     class QProgressBar* addProgressBar();
00066     
00067     void init(class StelGui* stelGui);
00068     
00069     virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
00070     
00071 protected:
00072     virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
00073     virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
00074 
00075 private slots:
00077     void setStelStyle(const QString& style);
00078     
00080     void updateBarsPos();
00081     
00082 private:
00083     class StelBarsPath* buttonBarPath;
00084     QTimeLine* animLeftBarTimeLine;
00085     QTimeLine* animBottomBarTimeLine;
00086     int lastButtonbarWidth;
00087     class LeftStelBar* winBar;
00088     BottomStelBar* buttonBar;
00089     class InfoPanel* infoPanel;
00090     class StelProgressBarMgr* progressBarMgr;
00091 
00092     // The 2 auto hide buttons in the lower left corner
00093     StelButton* btHorizAutoHide;
00094     StelButton* btVertAutoHide;
00095 
00096     class CornerButtons* autoHidebts;
00097 
00098     bool autoHideHorizontalButtonBar;
00099     bool autoHideVerticalButtonBar;
00100     
00101     StelGui* stelGui;
00102 };
00103 
00104 #endif // _SKYGUI_HPP_
Generated on Thu Jan 31 14:05:42 2013 for Stellarium by  doxygen 1.6.3