Debian Codegraph @

maz-db/src/MazOptions.h

raw symbols SCIP
1 /* Copyright (C) 2017 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
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 as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
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, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef MAZOPTIONS_H
19 #define MAZOPTIONS_H
20
21 #include <QObject>
22
23 namespace leveldb {
24 class DB;
25 struct Options;
26 }
27
28 class MazOptions : public QObject
29 {
30 Q_OBJECT
31 Q_PROPERTY(bool createIfMissing READ createIfMissing WRITE setCreateIfMissing NOTIFY optionChanged)
32 Q_PROPERTY(bool errorIfExists READ errorIfExists WRITE setErrorIfExists NOTIFY optionChanged)
33 Q_PROPERTY(bool paranoidChecks READ paranoidChecks WRITE setParanoidChecks NOTIFY optionChanged)
34 Q_PROPERTY(CompressionType compressionType READ compressionType WRITE setCompressionType NOTIFY optionChanged)
35 Q_ENUMS(CompressionType)
36 public:
37 explicit MazOptions(QObject *parent = 0);
38
39 enum CompressionType{
40 NoCompression = 0x0,
41 SnappyCompression = 0x1
42 };
43
44 bool createIfMissing() const;
45 bool errorIfExists() const;
46 bool paranoidChecks() const;
47 CompressionType compressionType() const;
48
49 signals:
50 void optionChanged();
51
52 public slots:
53 void setCreateIfMissing(const bool value);
54 void setErrorIfExists(const bool value);
55 void setParanoidChecks(const bool value);
56 void setCompressionType(const CompressionType type);
57
58 private:
59 Q_DISABLE_COPY(MazOptions)
60 bool m_createIfMissing;
61 bool m_errorIfExists;
62 bool m_paranoidChecks;
63 CompressionType m_compressionType;
64 };
65
66 #endif // MAZOPTIONS_H