libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-client-qt
include
osmscoutclientqt
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
30
#include <
osmscoutclientqt/ClientQtImportExport.h
>
31
32
namespace
osmscout
{
33
37
class
OSMSCOUT_CLIENT_QT_API
StyleModule
:
public
QObject {
38
Q_OBJECT
39
40
private
:
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) {
49
emit
initialisationFinished
(b);
50
}
51
};
52
53
Slot<>
stylesheetFilenameChangeSlot{
54
[
this
]() {
55
emit
stylesheetFilenameChanged
();
56
}
57
};
58
59
signals:
60
void
initialisationFinished
(
const
osmscout::GeoBox& response);
61
void
stylesheetFilenameChanged
();
62
void
styleFlagsChanged
(QMap<QString,bool>);
63
void
flagSet
(QString key,
bool
value);
64
65
public
slots:
66
void
loadStyle
(QString stylesheetFilename,
67
std::unordered_map<std::string,bool> stylesheetFlags);
68
void
onStyleChanged
();
69
void
onStyleFlagsRequested
();
70
void
onSetFlagRequest
(QString key,
bool
value);
71
72
public
:
73
StyleModule
(QThread *thread,DBThreadRef dbThread);
74
~StyleModule
()
override
;
75
};
76
80
using
StyleModuleRef
= std::shared_ptr<StyleModule>;
81
82
}
83
84
#endif
//OSMSCOUT_CLIENT_QT_STYLEMODULE_H
ClientQtImportExport.h
OSMSCOUT_CLIENT_QT_API
#define OSMSCOUT_CLIENT_QT_API
Definition
ClientQtImportExport.h:45
osmscout::Slot
Definition
Signal.h:98
osmscout::StyleModule::onSetFlagRequest
void onSetFlagRequest(QString key, bool value)
osmscout::StyleModule::initialisationFinished
void initialisationFinished(const osmscout::GeoBox &response)
osmscout::StyleModule::onStyleChanged
void onStyleChanged()
osmscout::StyleModule::~StyleModule
~StyleModule() override
osmscout::StyleModule::styleFlagsChanged
void styleFlagsChanged(QMap< QString, bool >)
osmscout::StyleModule::flagSet
void flagSet(QString key, bool value)
osmscout::StyleModule::stylesheetFilenameChanged
void stylesheetFilenameChanged()
osmscout::StyleModule::StyleModule
StyleModule(QThread *thread, DBThreadRef dbThread)
osmscout::StyleModule::onStyleFlagsRequested
void onStyleFlagsRequested()
osmscout::StyleModule::loadStyle
void loadStyle(QString stylesheetFilename, std::unordered_map< std::string, bool > stylesheetFlags)
osmscout::StyleModuleRef
std::shared_ptr< StyleModule > StyleModuleRef
Definition
StyleModule.h:80
osmscout
Definition
Area.h:39
Generated by
1.17.0