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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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     private:
00046         StelObject::InfoStringGroup infoTextFilters;
00047 };
00048 
00050 class SkyGui: public QGraphicsWidget
00051 {
00052     Q_OBJECT
00053 
00054 public:
00055     friend class StelGui;
00056     
00057     SkyGui(QGraphicsItem * parent=NULL);
00061     class QProgressBar* addProgressBar();
00062     
00063     void init(class StelGui* stelGui);
00064     
00066     void setStelStyle(const StelStyle& style);
00067 
00068     virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
00069     
00070 protected:
00071     virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
00072     virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
00073 
00074 private slots:
00076     void updateBarsPos();
00077     
00078 private:
00079     class StelBarsPath* buttonBarPath;
00080     QTimeLine* animLeftBarTimeLine;
00081     QTimeLine* animBottomBarTimeLine;
00082     int lastButtonbarWidth;
00083     class LeftStelBar* winBar;
00084     BottomStelBar* buttonBar;
00085     class InfoPanel* infoPanel;
00086     class StelProgressBarMgr* progressBarMgr;
00087 
00088     // The 2 auto hide buttons in the lower left corner
00089     StelButton* btHorizAutoHide;
00090     StelButton* btVertAutoHide;
00091 
00092     class CornerButtons* autoHidebts;
00093 
00094     bool autoHideHorizontalButtonBar;
00095     bool autoHideVerticalButtonBar;
00096     
00097     StelGui* stelGui;
00098 };
00099 
00100 #endif // _SKYGUI_HPP_