• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 6345643563

29 Sep 2023 12:15AM UTC coverage: 11.865% (-0.002%) from 11.867%
6345643563

Pull #3433

github

gzotti
Allow window size change via RemoteControl API
- also follow Qt recommendations w.r.t. nullptr and override.
Pull Request #3433: Remote control command to change window size

52 of 52 new or added lines in 18 files covered. (100.0%)

14841 of 125077 relevant lines covered (11.87%)

27788.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/plugins/RemoteControl/src/AbstractAPIService.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 ABSTRACTAPISERVICE_HPP
21
#define ABSTRACTAPISERVICE_HPP
22

23
#include "RemoteControlServiceInterface.hpp"
24

25
//! \addtogroup remoteControl
26
//! @{
27

28
//! Abstract base class for all RemoteControlServiceInterface implementations which are provided by the \ref remoteControl plugin directly.
29
class AbstractAPIService : public QObject, public RemoteControlServiceInterface
30
{
31
        Q_OBJECT
32
        //Probably not really necessary to do this here but it probably won't hurt either
33
        Q_INTERFACES(RemoteControlServiceInterface)
34
public:
35
        //! Only calls QObject constructor
36
        AbstractAPIService(QObject* parent = nullptr) : QObject(parent)
×
37
        {
38
        }
×
39

40
        // Provides a default implementation which returns false.
41
        bool isThreadSafe() const override;
42
        //! Called in the main thread each frame. Default implementation does nothing.
43
        //! Can be used for ongoing actions, for example movement control.
44
        void update(double deltaTime) override;
45
        //! Provides a default implementation which returns an error message.
46
        void get(const QByteArray &operation, const APIParameters &parameters, APIServiceResponse& response) override;
47
        //! Provides a default implementation which returns an error message.
48
        void post(const QByteArray &operation, const APIParameters &parameters, const QByteArray& data, APIServiceResponse& response) override;
49

50
protected:
51
        //! This defines the connection type QMetaObject::invokeMethod has to use inside a service: either Qt::DirectConnection for main thread handling, or
52
        //! Qt::BlockingQueuedConnection for HTTP thread handling
53
        static const Qt::ConnectionType SERVICE_DEFAULT_INVOKETYPE;
54
};
55

56
//! @}
57

58
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc