Stellarium 0.15.0
StelObjectModule.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2006 Fabien Chereau
4  * Copyright (C) 2016 Marcos Cardinot
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _STELOBJECTMODULE_HPP_
22 #define _STELOBJECTMODULE_HPP_
23 
24 #include "StelModule.hpp"
25 #include "StelObjectType.hpp"
26 #include "VecMath.hpp"
27 
28 #include <QList>
29 #include <QString>
30 #include <QStringList>
31 
37 {
38  Q_OBJECT
39 public:
42 
50  virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const = 0;
51 
55  virtual StelObjectP searchByNameI18n(const QString& nameI18n) const = 0;
56 
59  virtual StelObjectP searchByName(const QString& name) const = 0;
60 
67  virtual QStringList listMatchingObjects(const QString& objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const;
68 
72  virtual QStringList listAllObjects(bool inEnglish) const = 0;
73 
78  virtual QStringList listAllObjectsByType(const QString& objType, bool inEnglish) const;
79 
80  virtual QString getName() const = 0;
81 
87  bool matchObjectName(const QString& objName, const QString& objPrefix, bool useStartOfWords) const;
88 };
89 
90 #endif // _STELOBJECTMODULE_HPP_
virtual QStringList listAllObjectsByType(const QString &objType, bool inEnglish) const
List all StelObjects by type.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Specialization of StelModule which manages a collection of StelObject.
bool matchObjectName(const QString &objName, const QString &objPrefix, bool useStartOfWords) const
Auxiliary method of listMatchingObjects()
virtual StelObjectP searchByName(const QString &name) const =0
Return the matching StelObject if exists or the empty StelObject if not found.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const
Find and return the list of at most maxNbItem objects auto-completing passed object name...
Define the StelObjectP type.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const =0
Find a StelObject by name.
virtual QStringList listAllObjects(bool inEnglish) const =0
List all StelObjects.
virtual QList< StelObjectP > searchAround(const Vec3d &v, double limitFov, const StelCore *core) const =0
Search for StelObject in an area around a specifid point.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49