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

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 SKGPROPERTIESPLUGINDOCKWIDGET_H
0007 #define SKGPROPERTIESPLUGINDOCKWIDGET_H
0008 /** @file
0009  * A plugin to manage properties on objects
0010 *
0011 * @author Stephane MANKOWSKI
0012 */
0013 #include "skgwidget.h"
0014 #include "ui_skgpropertiesplugindockwidget_base.h"
0015 
0016 /**
0017  * A plugin to manage properties on objects
0018  */
0019 class SKGPropertiesPluginDockWidget : public SKGWidget
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     /**
0025      * Default Constructor
0026      * @param iParent the parent widget
0027      * @param iDocument the document
0028      */
0029     explicit SKGPropertiesPluginDockWidget(QWidget* iParent, SKGDocument* iDocument);
0030 
0031     /**
0032      * Default Destructor
0033      */
0034     ~SKGPropertiesPluginDockWidget() override;
0035 
0036     /**
0037      * Get the main widget
0038      * @return a widget
0039      */
0040     QWidget* mainWidget() override;
0041 
0042 public Q_SLOTS:
0043     /**
0044     * Refresh the content.
0045      */
0046     virtual void refresh();
0047 
0048 private Q_SLOTS:
0049     void onSelectionChanged();
0050     void onAddProperty();
0051     void onRenameProperty();
0052     void onRemoveProperty();
0053     void onSelectFile();
0054     void onOpenFile();
0055     void onOpenPropertyFileByUrl();
0056     void cleanEditor();
0057 
0058 private:
0059     Q_DISABLE_COPY(SKGPropertiesPluginDockWidget)
0060 
0061     void openPropertyFile(const SKGPropertyObject& iProp);
0062 
0063     Ui::skgpropertiesdockplugin_base ui{};
0064 };
0065 
0066 #endif  // SKGPROPERTIESPLUGINDOCKWIDGET_H