Stellarium 0.13.2
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 
77 private slots:
79  void setStelStyle(const QString& style);
80 
82  void updateBarsPos();
83 
84 private:
85  class StelBarsPath* buttonBarPath;
86  QTimeLine* animLeftBarTimeLine;
87  QTimeLine* animBottomBarTimeLine;
88  int lastButtonbarWidth;
89  class LeftStelBar* winBar;
90  BottomStelBar* buttonBar;
91  class InfoPanel* infoPanel;
92  class StelProgressBarMgr* progressBarMgr;
93 
94  // The 2 auto hide buttons in the lower left corner
95  StelButton* btHorizAutoHide;
96  StelButton* btVertAutoHide;
97 
98  class CornerButtons* autoHidebts;
99 
100  bool autoHideHorizontalButtonBar;
101  bool autoHideVerticalButtonBar;
102 
103  StelGui* stelGui;
104 };
105 
106 #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:49