source: calamares/trunk/fuentes/src/libcalamaresui/viewpages/PythonQtGlobalStorageWrapper.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 1.7 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2016, Teo Mrnjavac <teo@kde.org>
4 *   Copyright 2018, Adriaan de Groot <groot@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PYTHONQTGLOBALSTORAGEWRAPPER_H
21#define PYTHONQTGLOBALSTORAGEWRAPPER_H
22
23#include <QObject>
24#include <QStringList>
25#include <QVariant>
26
27namespace Calamares
28{
29class GlobalStorage;
30}
31
32
33/**
34 * @brief This GlobalStorage class is a namespace-free wrapper for
35 *        Calamares::GlobalStorage. This is unfortunately a necessity
36 *        because PythonQt doesn't like namespaces.
37 */
38class GlobalStorage : public QObject
39{
40    Q_OBJECT
41public:
42    explicit GlobalStorage( Calamares::GlobalStorage* gs );
43    virtual ~GlobalStorage() {}
44
45public slots:
46    bool contains( const QString& key ) const;
47    int count() const;
48    void insert( const QString& key, const QVariant& value );
49    QStringList keys() const;
50    int remove( const QString& key );
51    QVariant value( const QString& key ) const;
52
53private:
54    Calamares::GlobalStorage* m_gs;
55};
56
57#endif // PYTHONQTGLOBALSTORAGEWRAPPER_H
Note: See TracBrowser for help on using the repository browser.