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 "config.h"
24 #include "StelStyle.hpp"
25 #include "StelObject.hpp"
26 
27 #include <QDebug>
28 #include <QGraphicsWidget>
29 
30 class QGraphicsSceneMouseEvent;
31 class QGraphicsTextItem;
32 class QTimeLine;
33 class StelButton;
34 class BottomStelBar;
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);
66 
67  void init(class StelGui* stelGui);
68 
69  virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0);
70 
71  int getSkyGuiWidth() const;
72  int getSkyGuiHeight() const;
73 
74 protected:
75  virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
76  virtual void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
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:38
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:54
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