Okular

configinterface.h
1/*
2 SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
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
14class KConfigDialog;
15
16namespace 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 */
35class OKULARCORE_EXPORT ConfigInterface
36{
37public:
39 {
40 }
41
42 /**
43 * Destroys the config interface.
44 */
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
73Q_DECLARE_INTERFACE(Okular::ConfigInterface, "org.kde.okular.ConfigInterface/0.1")
74
75#endif
Abstract interface for configuration control.
virtual bool reparseConfig()=0
This method is called to tell the generator to re-parse its configuration.
virtual void addPages(KConfigDialog *dialog)=0
This method allows the generator to add custom configuration pages to the config dialog of okular.
virtual ~ConfigInterface()
Destroys the config interface.
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.