libosmscout  1.1.1
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 <osmscout/DBThread.h>
26 
28 
29 namespace osmscout {
30 
34 class OSMSCOUT_CLIENT_QT_API StyleModule:public QObject {
35  Q_OBJECT
36 
37 private:
38  QMutex mutex;
39  QThread *thread;
40  DBThreadRef dbThread;
41 
42 signals:
43  void initialisationFinished(const DatabaseLoadedResponse& response);
44  void stylesheetFilenameChanged();
45  void styleFlagsChanged(QMap<QString,bool>);
46  void flagSet(QString key, bool value);
47 
48 public slots:
49  void loadStyle(QString stylesheetFilename,
50  std::unordered_map<std::string,bool> stylesheetFlags);
51  void onStyleChanged();
52  void onStyleFlagsRequested();
53  void onSetFlagRequest(QString key, bool value);
54 
55 public:
56  StyleModule(QThread *thread,DBThreadRef dbThread);
57  ~StyleModule() override;
58 };
59 
63 using StyleModuleRef = std::shared_ptr<StyleModule>;
64 
65 }
66 
67 #endif //OSMSCOUT_CLIENT_QT_STYLEMODULE_H
#define OSMSCOUT_CLIENT_QT_API
Definition: ClientQtImportExport.h:45
std::shared_ptr< StyleModule > StyleModuleRef
Definition: StyleModule.h:63
Definition: Area.h:38
std::shared_ptr< DBThread > DBThreadRef
Definition: DBThread.h:239
Definition: StyleModule.h:34
Definition: DBThread.h:74