File indexing completed on 2024-05-26 05:10:25

0001 /***************************************************************************
0002  * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
0003  * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  ***************************************************************************/
0006 #ifndef SKGDEBUGPLUGIN_H
0007 #define SKGDEBUGPLUGIN_H
0008 /** @file
0009 * This file is a plugin for debug.
0010 *
0011 * @author Stephane MANKOWSKI / Guillaume DE BURE
0012  */
0013 #include "skginterfaceplugin.h"
0014 
0015 
0016 /**
0017  * This file is a plugin for debug
0018  */
0019 class SKGDebugPlugin : public SKGInterfacePlugin
0020 {
0021     Q_OBJECT
0022     Q_INTERFACES(SKGInterfacePlugin)
0023 
0024 public:
0025     /**
0026      * Default Constructor
0027      */
0028     explicit SKGDebugPlugin(QWidget* iWidget, QObject* iParent, const QVariantList& iArg);
0029 
0030     /**
0031      * Default Destructor
0032      */
0033     ~SKGDebugPlugin() override;
0034 
0035     /**
0036      * Called to initialise the plugin
0037      * @param iDocument the main document
0038      * @return true if the plugin is compatible with the document
0039      */
0040     bool setupActions(SKGDocument* iDocument) override;
0041 
0042     /**
0043      * The page widget of the plugin.
0044      * @return The page widget of the plugin
0045      */
0046     SKGTabPage* getWidget() override;
0047 
0048     /**
0049      * The title of the plugin.
0050      * @return The title of the plugin
0051      */
0052     QString title() const override;
0053 
0054     /**
0055      * The icon of the plugin.
0056      * @return The icon of the plugin
0057      */
0058     QString icon() const override;
0059 
0060     /**
0061      * The toolTip of the plugin.
0062      * @return The toolTip of the plugin
0063      */
0064     QString toolTip() const override;
0065 
0066     /**
0067      * Must be implemented to know if a plugin must be display in pages chooser.
0068      * @return true of false (default = false)
0069      */
0070     bool isInPagesChooser() const override;
0071 
0072     /**
0073      * Must be implemented to know if this plugin is enabled
0074      * @return true of false (default = true)
0075      */
0076     bool isEnabled() const override;
0077 
0078 private Q_SLOTS:
0079     void onRestartProfiling();
0080     void onOpenProfiling();
0081 
0082 private:
0083     Q_DISABLE_COPY(SKGDebugPlugin)
0084 
0085     SKGDocument* m_currentDocument;
0086 };
0087 
0088 #endif  // SKGDEBUGPLUGIN_H