File indexing completed on 2024-10-06 09:43:57

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2002 Simon Hausmann <hausmann@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KTOOLBARHANDLER_H
0009 #define KTOOLBARHANDLER_H
0010 
0011 #include <QObject>
0012 
0013 #include <kxmlguiclient.h>
0014 
0015 class KXmlGuiWindow;
0016 
0017 namespace KDEPrivate
0018 {
0019 class ToolBarHandler : public QObject, public KXMLGUIClient
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     /**
0025      * Creates a new tool bar handler for the supplied
0026      * @param mainWindow.
0027      */
0028     explicit ToolBarHandler(KXmlGuiWindow *mainWindow);
0029 
0030     /**
0031      * Creates a new tool bar handler for the supplied
0032      * @param mainWindow and with the supplied parent.
0033      */
0034     ToolBarHandler(KXmlGuiWindow *mainWindow, QObject *parent);
0035 
0036     /**
0037      * Destroys the tool bar handler.
0038      */
0039     ~ToolBarHandler() override;
0040 
0041     /**
0042      * Returns the action which is responsible for the tool bar menu.
0043      */
0044     QAction *toolBarMenuAction();
0045 
0046 public Q_SLOTS:
0047     void setupActions();
0048 
0049 private Q_SLOTS:
0050     void clientAdded(KXMLGUIClient *client);
0051 
0052 private:
0053     class Private;
0054     Private *const d;
0055 };
0056 
0057 } // namespace KDEPrivate
0058 
0059 #endif // KTOOLBARHANDLER_H