2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-01-02 16:40:22 +00:00
|
|
|
|
|
|
|
#ifndef _OKULAR_GUIINTERFACE_H_
|
|
|
|
#define _OKULAR_GUIINTERFACE_H_
|
|
|
|
|
2015-04-15 23:54:32 +00:00
|
|
|
#include "../core/okularcore_export.h"
|
2007-01-02 16:40:22 +00:00
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QObject>
|
2007-04-22 10:39:31 +00:00
|
|
|
|
2020-07-08 11:54:37 +00:00
|
|
|
#include <KXMLGUIClient>
|
2007-01-02 16:40:22 +00:00
|
|
|
|
|
|
|
namespace Okular
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @short Abstract interface for user interface control
|
|
|
|
*
|
|
|
|
* This interface defines an way to interact with the Okular user interface,
|
2007-01-02 17:25:26 +00:00
|
|
|
* e.g. adding actions in the menus.
|
|
|
|
*
|
|
|
|
* How to use it in a custom Generator:
|
|
|
|
* @code
|
|
|
|
class MyGenerator : public Okular::Generator, public Okular::GuiInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_INTERFACES( Okular::GuiInterface )
|
|
|
|
|
|
|
|
...
|
|
|
|
};
|
|
|
|
* @endcode
|
|
|
|
* and - of course - implementing its methods.
|
2007-01-02 16:40:22 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT GuiInterface : protected KXMLGUIClient
|
2007-01-02 16:40:22 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-02-21 15:11:42 +00:00
|
|
|
GuiInterface()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-01-02 17:25:26 +00:00
|
|
|
/**
|
|
|
|
* Destroys the gui interface.
|
|
|
|
*/
|
2020-11-11 00:31:47 +00:00
|
|
|
~GuiInterface() override
|
|
|
|
{
|
|
|
|
}
|
2007-01-02 16:40:22 +00:00
|
|
|
|
2020-02-21 15:11:42 +00:00
|
|
|
GuiInterface(const GuiInterface &) = delete;
|
|
|
|
GuiInterface &operator=(const GuiInterface &) = delete;
|
|
|
|
|
2007-01-02 17:25:26 +00:00
|
|
|
/**
|
2007-08-28 23:17:00 +00:00
|
|
|
* This method requests the XML GUI Client provided by the interface.
|
2007-01-02 17:25:26 +00:00
|
|
|
*/
|
2007-08-28 23:17:00 +00:00
|
|
|
KXMLGUIClient *guiClient()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
2007-01-02 16:40:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_DECLARE_INTERFACE(Okular::GuiInterface, "org.kde.okular.GuiInterface/0.1")
|
|
|
|
|
|
|
|
#endif
|