Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Toggle main menu visibility
Loading...
Searching...
No Matches
qobjectsettingswrapper.h
Go to the documentation of this file.
1
/*
2
* Sailfin: a Jellyfin client written using Qt
3
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library 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 GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
#ifndef JELLYFIN_QOBJECTSETTINGSWRAPPER_H
20
#define JELLYFIN_QOBJECTSETTINGSWRAPPER_H
21
22
23
#if USE_MLITE
24
#include <MDConfGroup>
25
namespace
Jellyfin
{
26
using
QObjectSettingsWrapper
= MDConfGroup;
27
}
// NS Jellyfin
28
#else
29
30
/***************************************************************************
31
** Copyright (C) 2014 Jolla Mobile <andrew.den.exter@jollamobile.com>
32
**
33
** This library is free software; you can redistribute it and/or
34
** modify it under the terms of the GNU Lesser General Public
35
** License version 2.1 as published by the Free Software Foundation
36
** and appearing in the file LICENSE.LGPL included in the packaging
37
** of this file.
38
**
39
****************************************************************************/
40
41
#include <QMetaType>
42
#include <QObject>
43
#include <QScopedPointer>
44
#include <QVariant>
45
46
namespace
Jellyfin
{
47
class
QObjectSettingsWrapperPrivate
;
48
53
class
QObjectSettingsWrapper
:
public
QObject {
54
Q_OBJECT
55
Q_DECLARE_PRIVATE(
QObjectSettingsWrapper
)
56
Q_PROPERTY(
bool
synchronous
READ
isSynchronous
WRITE
setSynchronous
NOTIFY
synchronousChanged
);
57
Q_PROPERTY(QString
path
READ
path
WRITE
setPath
NOTIFY
pathChanged
);
58
Q_PROPERTY(
Jellyfin
::
QObjectSettingsWrapper
*
scope
READ
scope
WRITE
setScope
NOTIFY
scopeChanged
);
59
public:
60
enum
BindOption
{
61
DontBindProperties
,
62
BindProperties
63
};
64
65
explicit
QObjectSettingsWrapper
(QObject *parent =
nullptr
,
BindOption
option =
DontBindProperties
);
66
explicit
QObjectSettingsWrapper
(
const
QString &path, QObject *parent =
nullptr
,
BindOption
option =
DontBindProperties
);
67
virtual
~QObjectSettingsWrapper
();
68
69
bool
isSynchronous
()
const
;
70
void
setSynchronous
(
bool
synchronous
);
71
72
QString
path
()
const
;
73
void
setPath
(
const
QString &path);
74
75
QObjectSettingsWrapper
*
scope
()
const
;
76
void
setScope
(
QObjectSettingsWrapper
*
scope
);
77
78
Q_INVOKABLE QVariant
value
(
const
QString &key,
79
const
QVariant &defaultValue = QVariant(),
80
int
typeHint = QMetaType::UnknownType)
const
;
81
Q_INVOKABLE
void
setValue
(
const
QString &key,
const
QVariant &
value
);
82
signals:
83
void
synchronousChanged
();
84
void
pathChanged
();
85
void
scopeChanged
();
86
public
slots:
87
void
sync
();
88
void
clear
();
89
protected
:
90
void
resolveMetaObject
(
int
propertyOffset = -1);
91
private
slots:
92
void
propertyChanged();
93
private
:
94
QScopedPointer<QObjectSettingsWrapperPrivate> d_ptr;
95
};
96
97
}
// NS Jellyfin
98
#endif
99
100
#endif
// JELLYFIN_QOBJECTSETTINGSWRAPPER_H
Jellyfin::QObjectSettingsWrapperPrivate
Definition
qobjectsettingswrapper.cpp:41
Jellyfin::QObjectSettingsWrapper
Almost-API reimplementation of https://github.com/sailfishos/mlite/blob/master/src/mdconfgroup....
Definition
qobjectsettingswrapper.h:53
Jellyfin::QObjectSettingsWrapper::synchronous
bool synchronous
Definition
qobjectsettingswrapper.h:56
Jellyfin::QObjectSettingsWrapper::QObjectSettingsWrapper
QObjectSettingsWrapper(QObject *parent=nullptr, BindOption option=DontBindProperties)
Definition
qobjectsettingswrapper.cpp:59
Jellyfin::QObjectSettingsWrapper::synchronousChanged
void synchronousChanged()
Jellyfin::QObjectSettingsWrapper::scope
Jellyfin::QObjectSettingsWrapper * scope
Definition
qobjectsettingswrapper.h:58
Jellyfin::QObjectSettingsWrapper::path
QString path
Definition
qobjectsettingswrapper.h:57
Jellyfin::QObjectSettingsWrapper::resolveMetaObject
void resolveMetaObject(int propertyOffset=-1)
Definition
qobjectsettingswrapper.cpp:170
Jellyfin::QObjectSettingsWrapper::BindOption
BindOption
Definition
qobjectsettingswrapper.h:60
Jellyfin::QObjectSettingsWrapper::DontBindProperties
@ DontBindProperties
Definition
qobjectsettingswrapper.h:61
Jellyfin::QObjectSettingsWrapper::BindProperties
@ BindProperties
Definition
qobjectsettingswrapper.h:62
Jellyfin::QObjectSettingsWrapper::sync
void sync()
Definition
qobjectsettingswrapper.cpp:160
Jellyfin::QObjectSettingsWrapper::setSynchronous
void setSynchronous(bool synchronous)
Definition
qobjectsettingswrapper.cpp:86
Jellyfin::QObjectSettingsWrapper::scopeChanged
void scopeChanged()
Jellyfin::QObjectSettingsWrapper::setValue
Q_INVOKABLE void setValue(const QString &key, const QVariant &value)
Definition
qobjectsettingswrapper.cpp:150
Jellyfin::QObjectSettingsWrapper::~QObjectSettingsWrapper
virtual ~QObjectSettingsWrapper()
Definition
qobjectsettingswrapper.cpp:80
Jellyfin::QObjectSettingsWrapper::setPath
void setPath(const QString &path)
Definition
qobjectsettingswrapper.cpp:91
Jellyfin::QObjectSettingsWrapper::setScope
void setScope(QObjectSettingsWrapper *scope)
Definition
qobjectsettingswrapper.cpp:120
Jellyfin::QObjectSettingsWrapper::value
Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), int typeHint=QMetaType::UnknownType) const
Definition
qobjectsettingswrapper.cpp:140
Jellyfin::QObjectSettingsWrapper::isSynchronous
bool isSynchronous() const
Definition
qobjectsettingswrapper.cpp:82
Jellyfin::QObjectSettingsWrapper::clear
void clear()
Definition
qobjectsettingswrapper.cpp:164
Jellyfin::QObjectSettingsWrapper::pathChanged
void pathChanged()
Jellyfin
core
include
JellyfinQt
qobjectsettingswrapper.h
Generated by
1.17.0