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

gui/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:
00041         InfoPanel(QGraphicsItem* parent);
00042         void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
00043         const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
00044         void setTextFromObjects(const QList<StelObjectP>&);
00045         const QString getSelectedText(void);
00046 
00047     private:
00048         StelObject::InfoStringGroup infoTextFilters;
00049 };
00050 
00052 class SkyGui: public QGraphicsWidget
00053 {
00054     Q_OBJECT
00055 
00056 public:
00057     friend class StelGui;
00058     
00059     SkyGui(QGraphicsItem * parent=NULL);
00063     class QProgressBar* addProgressBar();
00064     
00065     void init(class StelGui* stelGui);
00066     
00067     virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
00068     
00069 protected:
00070     virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
00071     virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
00072 
00073 private slots:
00075     void setStelStyle(const QString& style);
00076     
00078     void updateBarsPos();
00079     
00080 private:
00081     class StelBarsPath* buttonBarPath;
00082     QTimeLine* animLeftBarTimeLine;
00083     QTimeLine* animBottomBarTimeLine;
00084     int lastButtonbarWidth;
00085     class LeftStelBar* winBar;
00086     BottomStelBar* buttonBar;
00087     class InfoPanel* infoPanel;
00088     class StelProgressBarMgr* progressBarMgr;
00089 
00090     // The 2 auto hide buttons in the lower left corner
00091     StelButton* btHorizAutoHide;
00092     StelButton* btVertAutoHide;
00093 
00094     class CornerButtons* autoHidebts;
00095 
00096     bool autoHideHorizontalButtonBar;
00097     bool autoHideVerticalButtonBar;
00098     
00099     StelGui* stelGui;
00100 };
00101 
00102 #endif // _SKYGUI_HPP_
Generated on Thu May 31 10:37:19 2012 for Stellarium by  doxygen 1.6.3