Akonadi

cachepolicypage.h
1/*
2 SPDX-FileCopyrightText: 2010 Till Adam <adam@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akonadiwidgets_export.h"
10#include "collectionpropertiespage.h"
11
12#include <memory>
13
14namespace Akonadi
15{
16class CachePolicyPagePrivate;
17
18/**
19 * @short A page in a collection properties dialog to configure the cache policy.
20 *
21 * This page allows the user to fine tune the cache policy of a collection
22 * in the Akonadi storage. It provides two modes, a UserMode and an AdvancedMode.
23 * While the former should be used in end-user applications, the latter can be
24 * used in debugging tools.
25 *
26 * @see Akonadi::CollectionPropertiesDialog, Akonadi::CollectionPropertiesPageFactory
27 *
28 * @author Till Adam <adam@kde.org>
29 * @since 4.6
30 */
31class AKONADIWIDGETS_EXPORT CachePolicyPage : public CollectionPropertiesPage
32{
33 Q_OBJECT
34
35public:
36 /**
37 * Describes the mode of the cache policy page.
38 */
39 enum GuiMode {
40 UserMode, ///< A simplified UI for end-users will be provided.
41 AdvancedMode ///< An advanced UI for debugging will be provided.
42 };
43
44 /**
45 * Creates a new cache policy page.
46 *
47 * @param parent The parent widget.
48 * @param mode The UI mode that will be used for the page.
49 */
50 explicit CachePolicyPage(QWidget *parent, GuiMode mode = UserMode);
51
52 /**
53 * Destroys the cache policy page.
54 */
55 ~CachePolicyPage() override;
56
57 /**
58 * Checks if the cache policy page can actually handle the given @p collection.
59 */
60 [[nodiscard]] bool canHandle(const Collection &collection) const override;
61
62 /**
63 * Loads the page content from the given @p collection.
64 */
65 void load(const Collection &collection) override;
66
67 /**
68 * Saves page content to the given @p collection.
69 */
70 void save(Collection &collection) override;
71
72private:
73 /// @cond PRIVATE
74 std::unique_ptr<CachePolicyPagePrivate> const d;
75 /// @endcond
76};
77
78AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CachePolicyPageFactory, CachePolicyPage)
79
80}
A page in a collection properties dialog to configure the cache policy.
GuiMode
Describes the mode of the cache policy page.
@ UserMode
A simplified UI for end-users will be provided.
~CachePolicyPage() override
Destroys the cache policy page.
A single page in a collection properties dialog.
Represents a collection of PIM items.
Definition collection.h:62
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:51:45 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.