GCC Code Coverage Report


Directory: ./
File: service/backenddbuswrapper.h
Date: 2023-04-20 22:59:23
Exec Total Coverage
Lines: 0 2 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 * Copyright (C) 2014 Daniel Vratil <dvratil@redhat.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 */
19
20 #ifndef BACKENDDBUSWRAPPER_H
21 #define BACKENDDBUSWRAPPER_H
22
23 #include <QObject>
24 #include <QTimer>
25
26 #include "types.h"
27
28 namespace Disman
29 {
30 class Backend;
31 }
32
33 class BackendDBusWrapper : public QObject
34 {
35 Q_OBJECT
36 Q_CLASSINFO("D-Bus Interface", "org.kwinft.disman.backend")
37
38 public:
39 explicit BackendDBusWrapper(Disman::Backend* backend);
40 ~BackendDBusWrapper() override;
41
42 bool init();
43
44 QVariantMap getConfig() const;
45 QVariantMap setConfig(const QVariantMap& config);
46
47 inline Disman::Backend* backend() const
48 {
49 return mBackend;
50 }
51
52 Q_SIGNALS:
53 void configChanged(const QVariantMap& config);
54
55 private Q_SLOTS:
56 void backendConfigChanged(const Disman::ConfigPtr& config);
57 void doEmitConfigChanged();
58
59 private:
60 Disman::Backend* mBackend = nullptr;
61 QTimer mChangeCollector;
62 Disman::ConfigPtr mCurrentConfig;
63 };
64
65 #endif // BACKENDDBUSWRAPPER_H
66