1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _OKULAR_CONFIGINTERFACE_H_
11 #define _OKULAR_CONFIGINTERFACE_H_
13 #include <okular/core/okular_export.h>
15 #include <QtCore/QObject>
22 * @short Abstract interface for configuration control
24 * This interface defines a way to configure the Generator itself.
26 * How to use it in a custom Generator:
28 class MyGenerator : public Okular::Generator, public Okular::ConfigInterface
31 Q_INTERFACES( Okular::ConfigInterface )
36 * and - of course - implementing its methods.
38 class OKULAR_EXPORT ConfigInterface
42 * Destroys the config interface.
44 virtual ~ConfigInterface() {}
47 * This method is called to tell the generator to re-parse its configuration.
49 * Returns true if something has changed.
51 * @note this method can be called also when the generator is not the
52 * active generator, or when there was not changed in the config added
53 * by the generator itself. So the suggestion is to @b check whether
54 * something changed, and only in that case return @p true
56 virtual bool reparseConfig() = 0;
59 * This method allows the generator to add custom configuration pages to the
60 * config @p dialog of okular.
62 virtual void addPages( KConfigDialog
*dialog
) = 0;
67 Q_DECLARE_INTERFACE( Okular::ConfigInterface
, "org.kde.okular.ConfigInterface/0.1" )