compile
[kdegraphics.git] / okular / interfaces / guiinterface.h
blob6f105970a0ac9e9a47077d951e514b69a5a2190c
1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
3 * *
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_GUIINTERFACE_H_
11 #define _OKULAR_GUIINTERFACE_H_
13 #include <okular/core/okular_export.h>
15 #include <QtCore/QObject>
17 #include <kxmlguiclient.h>
19 namespace Okular {
21 /**
22 * @short Abstract interface for user interface control
24 * This interface defines an way to interact with the Okular user interface,
25 * e.g. adding actions in the menus.
27 * How to use it in a custom Generator:
28 * @code
29 class MyGenerator : public Okular::Generator, public Okular::GuiInterface
31 Q_OBJECT
32 Q_INTERFACES( Okular::GuiInterface )
34 ...
36 * @endcode
37 * and - of course - implementing its methods.
39 class OKULAR_EXPORT GuiInterface : protected KXMLGUIClient
41 public:
42 /**
43 * Destroys the gui interface.
45 virtual ~GuiInterface() {}
47 /**
48 * This method requests the XML GUI Client provided by the interface.
50 KXMLGUIClient* guiClient() { return this; }
55 Q_DECLARE_INTERFACE( Okular::GuiInterface, "org.kde.okular.GuiInterface/0.1" )
57 #endif