libosmscout 1.1.1
Loading...
Searching...
No Matches
StyleModule.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_CLIENT_QT_STYLEMODULE_H
2#define OSMSCOUT_CLIENT_QT_STYLEMODULE_H
3
4/*
5 OSMScout - a Qt backend for libosmscout and libosmscout-map
6 Copyright (C) 2017 Lukas Karas
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <QObject>
24#include <QThread>
25#include <QMutex>
26#include <QMap>
27
28#include <osmscoutclient/DBThread.h>
29
31
32namespace osmscout {
33
37class OSMSCOUT_CLIENT_QT_API StyleModule:public QObject {
38 Q_OBJECT
39
40private:
41 QMutex mutex;
42 QThread *thread;
43 DBThreadRef dbThread;
44
45 std::shared_ptr<bool> alive=std::make_shared<bool>(true);
46
47 Slot<osmscout::GeoBox> dbLoadedSlot{
48 [this](const osmscout::GeoBox &b) {
50 }
51 };
52
53 Slot<> stylesheetFilenameChangeSlot{
54 [this]() {
56 }
57 };
58
59signals:
60 void initialisationFinished(const osmscout::GeoBox& response);
62 void styleFlagsChanged(QMap<QString,bool>);
63 void flagSet(QString key, bool value);
64
65public slots:
66 void loadStyle(QString stylesheetFilename,
67 std::unordered_map<std::string,bool> stylesheetFlags);
70 void onSetFlagRequest(QString key, bool value);
71
72public:
73 StyleModule(QThread *thread,DBThreadRef dbThread);
74 ~StyleModule() override;
75};
76
80using StyleModuleRef = std::shared_ptr<StyleModule>;
81
82}
83
84#endif //OSMSCOUT_CLIENT_QT_STYLEMODULE_H
#define OSMSCOUT_CLIENT_QT_API
Definition ClientQtImportExport.h:45
Definition Signal.h:98
void onSetFlagRequest(QString key, bool value)
void initialisationFinished(const osmscout::GeoBox &response)
void styleFlagsChanged(QMap< QString, bool >)
void flagSet(QString key, bool value)
void stylesheetFilenameChanged()
StyleModule(QThread *thread, DBThreadRef dbThread)
void loadStyle(QString stylesheetFilename, std::unordered_map< std::string, bool > stylesheetFlags)
std::shared_ptr< StyleModule > StyleModuleRef
Definition StyleModule.h:80
Definition Area.h:39