Okular

configinterface.h
1 /*
2  SPDX-FileCopyrightText: 2007 Pino Toscano <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_CONFIGINTERFACE_H_
8 #define _OKULAR_CONFIGINTERFACE_H_
9 
10 #include "../core/okularcore_export.h"
11 
12 #include <QObject>
13 
14 class KConfigDialog;
15 
16 namespace Okular
17 {
18 /**
19  * @short Abstract interface for configuration control
20  *
21  * This interface defines a way to configure the Generator itself.
22  *
23  * How to use it in a custom Generator:
24  * @code
25  class MyGenerator : public Okular::Generator, public Okular::ConfigInterface
26  {
27  Q_OBJECT
28  Q_INTERFACES( Okular::ConfigInterface )
29 
30  ...
31  };
32  * @endcode
33  * and - of course - implementing its methods.
34  */
35 class OKULARCORE_EXPORT ConfigInterface
36 {
37 public:
39  {
40  }
41 
42  /**
43  * Destroys the config interface.
44  */
45  virtual ~ConfigInterface()
46  {
47  }
48 
49  ConfigInterface(const ConfigInterface &) = delete;
50  ConfigInterface &operator=(const ConfigInterface &) = delete;
51 
52  /**
53  * This method is called to tell the generator to re-parse its configuration.
54  *
55  * Returns true if something has changed.
56  *
57  * @note this method can be called also when the generator is not the
58  * active generator, or when there was not changed in the config added
59  * by the generator itself. So the suggestion is to @b check whether
60  * something changed, and only in that case return @p true
61  */
62  virtual bool reparseConfig() = 0;
63 
64  /**
65  * This method allows the generator to add custom configuration pages to the
66  * config @p dialog of okular.
67  */
68  virtual void addPages(KConfigDialog *dialog) = 0;
69 };
70 
71 }
72 
73 Q_DECLARE_INTERFACE(Okular::ConfigInterface, "org.kde.okular.ConfigInterface/0.1")
74 
75 #endif
The documentation to the global Okular namespace.
Definition: action.h:16
Abstract interface for configuration control.
virtual ~ConfigInterface()
Destroys the config interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:04:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.