Okular

guiinterface.h
1 /*
2  SPDX-FileCopyrightText: 2007 Pino Toscano <[email protected]>
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 
16 namespace 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  */
36 class OKULARCORE_EXPORT GuiInterface : protected KXMLGUIClient
37 {
38 public:
39  GuiInterface()
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 
64 Q_DECLARE_INTERFACE(Okular::GuiInterface, "org.kde.okular.GuiInterface/0.1")
65 
66 #endif
~GuiInterface() override
Destroys the gui interface.
Definition: guiinterface.h:46
Abstract interface for user interface control.
Definition: guiinterface.h:36
global.h
Definition: action.h:16
KXMLGUIClient * guiClient()
This method requests the XML GUI Client provided by the interface.
Definition: guiinterface.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 22:32:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.