Okular

guiinterface.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_GUIINTERFACE_H_
8#define _OKULAR_GUIINTERFACE_H_
9
10#include "../core/okularcore_export.h"
11
12#include <QObject>
13
14#include <KXMLGUIClient>
15
16namespace Okular
17{
18/**
19 * @short Abstract interface for user interface control
20 *
21 * This interface defines an way to interact with the Okular user interface,
22 * e.g. adding actions in the menus.
23 *
24 * How to use it in a custom Generator:
25 * @code
26 class MyGenerator : public Okular::Generator, public Okular::GuiInterface
27 {
28 Q_OBJECT
29 Q_INTERFACES( Okular::GuiInterface )
30
31 ...
32 };
33 * @endcode
34 * and - of course - implementing its methods.
35 */
36class OKULARCORE_EXPORT GuiInterface : protected KXMLGUIClient
37{
38public:
40 {
41 }
42
43 /**
44 * Destroys the gui interface.
45 */
46 ~GuiInterface() override
47 {
48 }
49
50 GuiInterface(const GuiInterface &) = delete;
51 GuiInterface &operator=(const GuiInterface &) = delete;
52
53 /**
54 * This method requests the XML GUI Client provided by the interface.
55 */
57 {
58 return this;
59 }
60};
61
62}
63
64Q_DECLARE_INTERFACE(Okular::GuiInterface, "org.kde.okular.GuiInterface/0.1")
65
66#endif
Abstract interface for user interface control.
~GuiInterface() override
Destroys the gui interface.
KXMLGUIClient * guiClient()
This method requests the XML GUI Client provided by the 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.