| 1 | /* |
| 2 | This file is part of the KDE libraries |
| 3 | SPDX-FileCopyrightText: 2002 Simon Hausmann <hausmann@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-only |
| 6 | */ |
| 7 | |
| 8 | #ifndef KTOOLBARHANDLER_H |
| 9 | #define KTOOLBARHANDLER_H |
| 10 | |
| 11 | #include <QObject> |
| 12 | |
| 13 | #include <kxmlguiclient.h> |
| 14 | |
| 15 | class KXmlGuiWindow; |
| 16 | |
| 17 | namespace KDEPrivate |
| 18 | { |
| 19 | class ToolBarHandler : public QObject, public KXMLGUIClient |
| 20 | { |
| 21 | Q_OBJECT |
| 22 | |
| 23 | public: |
| 24 | /*! |
| 25 | * Creates a new tool bar handler for the supplied |
| 26 | * \a mainWindow. |
| 27 | */ |
| 28 | explicit ToolBarHandler(KXmlGuiWindow *mainWindow); |
| 29 | |
| 30 | /*! |
| 31 | * Creates a new tool bar handler for the supplied |
| 32 | * \a mainWindow and with the supplied parent. |
| 33 | */ |
| 34 | ToolBarHandler(KXmlGuiWindow *mainWindow, QObject *parent); |
| 35 | |
| 36 | /*! |
| 37 | * Destroys the tool bar handler. |
| 38 | */ |
| 39 | ~ToolBarHandler() override; |
| 40 | |
| 41 | /*! |
| 42 | * Returns the action which is responsible for the tool bar menu. |
| 43 | */ |
| 44 | QAction *toolBarMenuAction(); |
| 45 | |
| 46 | public Q_SLOTS: |
| 47 | void setupActions(); |
| 48 | |
| 49 | private Q_SLOTS: |
| 50 | void clientAdded(KXMLGUIClient *client); |
| 51 | |
| 52 | private: |
| 53 | class Private; |
| 54 | Private *const d; |
| 55 | }; |
| 56 | |
| 57 | } // namespace KDEPrivate |
| 58 | |
| 59 | #endif // KTOOLBARHANDLER_H |
| 60 | |