Stellarium 0.12.4
LabelMgr.hpp
1 /*
2  * Stellarium
3  * This file Copyright (C) 2008 Matthew Gates
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 _SKYLABELMGR_HPP_
21 #define _SKYLABELMGR_HPP_
22 
23 
24 #include "StelFader.hpp"
25 #include "StelModule.hpp"
26 #include "StelObject.hpp"
27 #include "StelObjectType.hpp"
28 #include "VecMath.hpp"
29 
30 #include <QVector>
31 #include <QString>
32 
33 class StelCore;
34 
43 class LabelMgr : public StelModule
44 {
45  Q_OBJECT
46 
47 public:
49  LabelMgr();
50  virtual ~LabelMgr();
51 
53  // Methods defined in the StelModule class
55  virtual void init();
56 
58  virtual void draw(StelCore* core, class StelRenderer* renderer);
59 
61  virtual void update(double deltaTime);
62 
64  virtual double getCallOrder(StelModuleActionName actionName) const;
65 
66 public slots:
83  int labelObject(const QString& text,
84  const QString& objectName,
85  bool visible=true,
86  float fontSize=14,
87  const QString& fontColor="#999999",
88  const QString& side="E",
89  double labelDistance=-1.0,
90  const QString& style="TextOnly");
91 
99  int labelScreen(const QString& text,
100  int x,
101  int y,
102  bool visible=true,
103  float fontSize=14,
104  const QString& fontColor="#999999");
105 
107  bool getLabelShow(int id);
109  void setLabelShow(int id, bool show);
111  void setLabelText(int id, const QString& newText);
114  bool deleteLabel(int id);
117  int deleteAllLabels(void);
118 
119 private:
120  QVector<class StelLabel*> allLabels;
121 };
122 
123 #endif // _SKYLABELMGR_HPP_