2007-01-02 16:40:22 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#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
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
2007-01-02 16:40:22 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
{
|
2020-07-10 22:15:05 +00:00
|
|
|
public:
|
|
|
|
GuiInterface()
|
|
|
|
{
|
|
|
|
}
|
2020-02-21 15:11:42 +00:00
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
/**
|
|
|
|
* Destroys the gui interface.
|
|
|
|
*/
|
|
|
|
~GuiInterface() override
|
|
|
|
{
|
|
|
|
}
|
2007-01-02 16:40:22 +00:00
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
GuiInterface(const GuiInterface &) = delete;
|
|
|
|
GuiInterface &operator=(const GuiInterface &) = delete;
|
2020-02-21 15:11:42 +00:00
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
/**
|
|
|
|
* This method requests the XML GUI Client provided by the interface.
|
|
|
|
*/
|
|
|
|
KXMLGUIClient *guiClient()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
2007-01-02 16:40:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
Q_DECLARE_INTERFACE(Okular::GuiInterface, "org.kde.okular.GuiInterface/0.1")
|
2007-01-02 16:40:22 +00:00
|
|
|
|
|
|
|
#endif
|