digiKam
Loading...
Searching...
No Matches
statesavingobject.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digikam project
4 * https://www.digikam.org
5 *
6 * Date : 2009-20-12
7 * Description : Interface class for objects that can store their state.
8 *
9 * SPDX-FileCopyrightText: 2009 by Johannes Wienke <languitar at semipol dot de>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QObject>
20
21// Local includes
22
23#include "digikam_export.h"
24
25class KConfigGroup;
26
27namespace Digikam
28{
29
65class DIGIKAM_EXPORT StateSavingObject
66{
67public:
68
74 {
80
86
91 RECURSIVE
92 };
93
100 explicit StateSavingObject(QObject* const host);
101
105 virtual ~StateSavingObject();
106
113 StateSavingDepth getStateSavingDepth() const;
114
120 void setStateSavingDepth(const StateSavingDepth depth);
121
132 virtual void setConfigGroup(const KConfigGroup& group);
133
143 virtual void setEntryPrefix(const QString& prefix);
144
148 void loadState();
149
153 void saveState();
154
155protected:
156
161 virtual void doLoadState() = 0;
162
167 virtual void doSaveState() = 0;
168
174 KConfigGroup getConfigGroup() const;
175
183 QString entryName(const QString& base) const;
184
185private:
186
187 // Disable
188 StateSavingObject(const StateSavingObject&) = delete;
189 StateSavingObject& operator=(const StateSavingObject&) = delete;
190
191private:
192
193 class Private;
194 Private* const d = nullptr;
195};
196
197} // namespace Digikam
Definition statesavingobject.h:66
virtual void doSaveState()=0
virtual void doLoadState()=0
StateSavingDepth
Definition statesavingobject.h:74
@ DIRECT_CHILDREN
Definition statesavingobject.h:85
@ INSTANCE
Definition statesavingobject.h:79
QStringView prefix
Definition itemviewutilities.cpp:586
Definition datefolderview.cpp:34