Stellarium 0.14.0
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 QGraphicsTextItem;
31 class QTimeLine;
32 class StelButton;
33 class BottomStelBar;
35 
37 class InfoPanel : public QGraphicsTextItem
38 {
39  public:
42  InfoPanel(QGraphicsItem* parent);
43  void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
44  const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
45  void setTextFromObjects(const QList<StelObjectP>&);
46  const QString getSelectedText(void);
47 
48  private:
49  StelObject::InfoStringGroup infoTextFilters;
50 };
51 
53 class SkyGui: public QGraphicsWidget
54 {
55  Q_OBJECT
56 
57 public:
58  friend class StelGui;
59 
60  SkyGui(QGraphicsItem * parent=NULL);
65 
66  void init(class StelGui* stelGui);
67 
68  virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
69 
70  int getSkyGuiWidth() const;
71  int getSkyGuiHeight() const;
72 
73 protected:
74  virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
75  virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
76  virtual QVariant itemChange(GraphicsItemChange change, const QVariant & value) Q_DECL_OVERRIDE;
77 
78 private slots:
80  void setStelStyle(const QString& style);
81 
83  void updateBarsPos();
84 
85 private:
86  class StelBarsPath* buttonBarPath;
87  QTimeLine* animLeftBarTimeLine;
88  QTimeLine* animBottomBarTimeLine;
89  int lastButtonbarWidth;
90  class LeftStelBar* winBar;
91  BottomStelBar* buttonBar;
92  class InfoPanel* infoPanel;
93  class StelProgressBarMgr* progressBarMgr;
94 
95  // The 2 auto hide buttons in the lower left corner
96  StelButton* btHorizAutoHide;
97  StelButton* btVertAutoHide;
98 
99  class CornerButtons* autoHidebts;
100 
101  bool autoHideHorizontalButtonBar;
102  bool autoHideVerticalButtonBar;
103 
104  StelGui* stelGui;
105 };
106 
107 #endif // _SKYGUI_HPP_
InfoPanel(QGraphicsItem *parent)
Reads "gui/selected_object_info", etc from the configuration file.
The informations about the currently selected object.
Definition: SkyGui.hpp:37
A Button Graphicsitem for use in Stellarium's graphic widgets.
The class managing the layout for button bars, selected object info and loading bars.
Definition: SkyGui.hpp:53
void addProgressBar(StelProgressController *)
Add a new progress bar in the lower right corner of the screen.
Maintain the state of a progress bar.
virtual void init(QGraphicsWidget *topLevelGraphicsWidget)
Initialize the StelGui object.
Main class for the GUI based on QGraphicView.
Definition: StelGui.hpp:51