Stellarium 0.12.3
SkyGui.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2009 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _SKYGUI_HPP_
21 #define _SKYGUI_HPP_
22 
23 #include "StelStyle.hpp"
24 #include "StelObject.hpp"
25 
26 #include <QDebug>
27 #include <QGraphicsWidget>
28 
29 class QGraphicsSceneMouseEvent;
30 class QAction;
31 class QGraphicsTextItem;
32 class QTimeLine;
33 class StelButton;
34 class BottomStelBar;
35 
36 
38 class InfoPanel : public QGraphicsTextItem
39 {
40  public:
43  InfoPanel(QGraphicsItem* parent);
44  void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
45  const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
46  void setTextFromObjects(const QList<StelObjectP>&);
47  const QString getSelectedText(void);
48 
49  private:
50  StelObject::InfoStringGroup infoTextFilters;
51 };
52 
54 class SkyGui: public QGraphicsWidget
55 {
56  Q_OBJECT
57 
58 public:
59  friend class StelGui;
60 
61  SkyGui(QGraphicsItem * parent=NULL);
65  class QProgressBar* addProgressBar();
66 
67  void init(class StelGui* stelGui);
68 
69  virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
70 
71 protected:
72  virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
73  virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
74 
75 private slots:
77  void setStelStyle(const QString& style);
78 
80  void updateBarsPos();
81 
82 private:
83  class StelBarsPath* buttonBarPath;
84  QTimeLine* animLeftBarTimeLine;
85  QTimeLine* animBottomBarTimeLine;
86  int lastButtonbarWidth;
87  class LeftStelBar* winBar;
88  BottomStelBar* buttonBar;
89  class InfoPanel* infoPanel;
90  class StelProgressBarMgr* progressBarMgr;
91 
92  // The 2 auto hide buttons in the lower left corner
93  StelButton* btHorizAutoHide;
94  StelButton* btVertAutoHide;
95 
96  class CornerButtons* autoHidebts;
97 
98  bool autoHideHorizontalButtonBar;
99  bool autoHideVerticalButtonBar;
100 
101  StelGui* stelGui;
102 };
103 
104 #endif // _SKYGUI_HPP_