Stellarium 0.15.2
ObjectService.hpp
1 /*
2  * Stellarium Remote Control plugin
3  * Copyright (C) 2015 Florian Schaukowitsch
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 OBJECTSERVICE_HPP_
21 #define OBJECTSERVICE_HPP_
22 
23 #include "AbstractAPIService.hpp"
24 #include "StelObjectType.hpp"
25 
26 #include <QStringList>
27 
28 class StelCore;
29 class StelObjectMgr;
30 
36 {
37  Q_OBJECT
38 public:
39  ObjectService(const QByteArray& serviceName, QObject* parent = 0);
40 
41  virtual ~ObjectService() {}
42 
43 protected:
46  virtual void getImpl(const QByteArray& operation,const APIParameters& parameters, APIServiceResponse& response) Q_DECL_OVERRIDE;
47 
48 private slots:
50  QStringList performSearch(const QString& text);
52  QString substituteGreek(const QString& text);
53 
55  StelObjectP findObject(const QString& name);
56 
58  QString getInfoString(const StelObjectP obj);
59 private:
60  StelCore* core;
61  StelObjectMgr* objMgr;
62  bool useStartOfWords;
63 };
64 
65 
66 
67 #endif
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Thread-safe version of HttpResponse that can be passed around through QMetaObject::invokeMethod.
Provides operations to look up objects in the Stellarium catalogs.
Abstract base class for all Remote Control Plug-in service implementations.
QMultiMap< QByteArray, QByteArray > APIParameters
Defines the HTTP request parameters for the service.
Define the StelObjectP type.
virtual void getImpl(const QByteArray &operation, const APIParameters &parameters, APIServiceResponse &response) Q_DECL_OVERRIDE
Implements the HTTP GET method.
Manage the selection and queries on one or more StelObjects.
QByteArray serviceName()
Returns the service name, used for request path mapping by the APIController.