2020-09-19 19:06:34 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2023-11-19 07:31:45 -05:00
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2016-2020, 2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
2020-09-19 19:06:34 -04:00
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef SDRGUI_FEATURE_FEATUREUISET_H_
|
|
|
|
#define SDRGUI_FEATURE_FEATUREUISET_H_
|
|
|
|
|
2020-10-03 17:55:24 -04:00
|
|
|
#include <QObject>
|
2020-09-19 19:06:34 -04:00
|
|
|
#include <QString>
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
#include "export.h"
|
|
|
|
|
|
|
|
class QWidget;
|
2020-10-03 17:55:24 -04:00
|
|
|
class FeatureGUI;
|
2020-09-23 23:38:05 -04:00
|
|
|
class PluginAPI;
|
2020-10-10 18:22:42 -04:00
|
|
|
class FeatureSet;
|
2020-09-20 21:13:36 -04:00
|
|
|
class Feature;
|
2020-09-23 23:38:05 -04:00
|
|
|
class FeatureSetPreset;
|
|
|
|
class WebAPIAdapterInterface;
|
2022-04-04 04:23:52 -04:00
|
|
|
class Workspace;
|
2020-09-19 19:06:34 -04:00
|
|
|
|
2020-10-03 17:55:24 -04:00
|
|
|
class SDRGUI_API FeatureUISet : public QObject
|
2020-09-19 19:06:34 -04:00
|
|
|
{
|
2020-10-03 17:55:24 -04:00
|
|
|
Q_OBJECT
|
2020-09-19 19:06:34 -04:00
|
|
|
public:
|
2020-10-10 18:22:42 -04:00
|
|
|
FeatureUISet(int tabIndex, FeatureSet *featureSet);
|
2020-09-19 19:06:34 -04:00
|
|
|
~FeatureUISet();
|
|
|
|
|
|
|
|
int getNumberOfFeatures() const { return m_featureInstanceRegistrations.size(); }
|
2020-10-16 02:35:06 -04:00
|
|
|
void registerFeatureInstance(FeatureGUI* featureGUI, Feature *feature);
|
2020-09-19 19:06:34 -04:00
|
|
|
void deleteFeature(int featureIndex);
|
2020-09-20 21:13:36 -04:00
|
|
|
const Feature *getFeatureAt(int featureIndex) const;
|
|
|
|
Feature *getFeatureAt(int featureIndex);
|
2022-04-05 10:26:57 -04:00
|
|
|
const FeatureGUI *getFeatureGuiAt(int featureIndex) const;
|
|
|
|
FeatureGUI *getFeatureGuiAt(int featureIndex);
|
2022-04-04 04:23:52 -04:00
|
|
|
void loadFeatureSetSettings(
|
|
|
|
const FeatureSetPreset* preset,
|
|
|
|
PluginAPI *pluginAPI,
|
|
|
|
WebAPIAdapterInterface *apiAdapter,
|
2022-04-09 07:38:22 -04:00
|
|
|
QList<Workspace*> *workspaces,
|
|
|
|
Workspace *currentWorkspace
|
2022-04-05 10:26:57 -04:00
|
|
|
);
|
2020-09-23 23:38:05 -04:00
|
|
|
void saveFeatureSetSettings(FeatureSetPreset* preset);
|
2022-04-05 10:26:57 -04:00
|
|
|
void freeFeatures();
|
2020-09-19 19:06:34 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct FeatureInstanceRegistration
|
|
|
|
{
|
2020-10-03 17:55:24 -04:00
|
|
|
FeatureGUI* m_gui;
|
2020-09-20 21:13:36 -04:00
|
|
|
Feature* m_feature;
|
2020-09-19 19:06:34 -04:00
|
|
|
|
|
|
|
FeatureInstanceRegistration() :
|
2020-09-20 21:13:36 -04:00
|
|
|
m_gui(nullptr),
|
|
|
|
m_feature(nullptr)
|
2020-09-19 19:06:34 -04:00
|
|
|
{ }
|
|
|
|
|
2020-10-16 02:35:06 -04:00
|
|
|
FeatureInstanceRegistration(FeatureGUI* pluginGUI, Feature *feature) :
|
2020-09-20 21:13:36 -04:00
|
|
|
m_gui(pluginGUI),
|
|
|
|
m_feature(feature)
|
2020-09-19 19:06:34 -04:00
|
|
|
{ }
|
|
|
|
|
|
|
|
bool operator<(const FeatureInstanceRegistration& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<FeatureInstanceRegistration> FeatureInstanceRegistrations;
|
|
|
|
|
|
|
|
FeatureInstanceRegistrations m_featureInstanceRegistrations;
|
|
|
|
int m_featureTabIndex;
|
2020-10-10 18:22:42 -04:00
|
|
|
FeatureSet *m_featureSet;
|
2020-10-03 17:55:24 -04:00
|
|
|
|
2020-10-04 04:30:49 -04:00
|
|
|
|
2020-10-03 17:55:24 -04:00
|
|
|
private slots:
|
2020-10-04 13:07:42 -04:00
|
|
|
void handleClosingFeatureGUI(FeatureGUI *featureGUI);
|
2022-07-21 21:25:14 -04:00
|
|
|
void handleDeleteFeature(Feature *feature);
|
|
|
|
|
2020-09-19 19:06:34 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SDRGUI_FEATURE_FEATUREUISET_H_
|