Akonadi

cachepolicypage.h
1 /*
2  SPDX-FileCopyrightText: 2010 Till Adam <[email protected]>
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 
14 namespace Akonadi
15 {
16 class 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 <[email protected]>
29  * @since 4.6
30  */
31 class AKONADIWIDGETS_EXPORT CachePolicyPage : public CollectionPropertiesPage
32 {
33  Q_OBJECT
34 
35 public:
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  Q_REQUIRED_RESULT 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 
72 private:
73  /// @cond PRIVATE
74  std::unique_ptr<CachePolicyPagePrivate> const d;
75  /// @endcond
76 };
77 
78 AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CachePolicyPageFactory, CachePolicyPage)
79 
80 }
81 
Represents a collection of PIM items.
Definition: collection.h:61
@ UserMode
A simplified UI for end-users will be provided.
GuiMode
Describes the mode of the cache policy page.
A page in a collection properties dialog to configure the cache policy.
A single page in a collection properties dialog.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:45 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.