cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
lib
include
cc_tools_qt
PluginProperties.h
1
//
2
// Copyright 2016 - 2024 (C). Alex Robenko. All rights reserved.
3
//
4
5
// This file is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18
19
#pragma once
20
21
#include <functional>
22
23
#include <QtCore/QVariant>
24
#include <QtCore/QVariantMap>
25
#include <QtCore/QString>
26
#include <QtCore/QMetaType>
27
#include <QtCore/QList>
28
29
#include "Socket.h"
30
#include "Protocol.h"
31
#include "Filter.h"
32
#include "Api.h"
33
34
class
QAction;
35
class
QWidget;
36
37
namespace
cc_tools_qt
38
{
39
42
class
CC_API
PluginProperties
43
{
44
public
:
46
using
ListOfFilters
= QList<FilterPtr>;
47
49
using
ListOfGuiActions
= QList<QAction*>;
50
52
PluginProperties
();
53
55
~PluginProperties
() noexcept;
56
58
using
SocketCreateFunc
= std::function<
SocketPtr
()>;
59
61
using
ProtocolCreateFunc
= std::function<
ProtocolPtr
()>;
62
64
using
FiltersCreateFunc
= std::function<
ListOfFilters
()>;
65
70
using
GuiActionsCreateFunc
= std::function<
ListOfGuiActions
()>;
71
76
using
ConfigWidgetCreateFunc
= std::function<QWidget* ()>;
77
81
PluginProperties
& setSocketCreateFunc(
SocketCreateFunc
&& func);
82
86
PluginProperties
& setProtocolCreateFunc(
ProtocolCreateFunc
&& func);
87
91
PluginProperties
& setFiltersCreateFunc(
FiltersCreateFunc
&& func);
92
96
PluginProperties
& setGuiActionsCreateFunc(
GuiActionsCreateFunc
&& func);
97
101
PluginProperties
& setConfigWidgetCreateFunc(
ConfigWidgetCreateFunc
&& func);
102
106
PluginProperties
& setCustomProperty(const QString& name, QVariant&& val);
107
109
SocketCreateFunc
getSocketCreateFunc() const;
110
112
ProtocolCreateFunc
getProtocolCreateFunc() const;
113
115
FiltersCreateFunc
getFiltersCreateFunc() const;
116
118
GuiActionsCreateFunc
getGuiActionsCreateFunc() const;
119
121
ConfigWidgetCreateFunc
getConfigWidgetCreateFunc() const;
122
126
QVariant getCustomProperty(const QString& name) const;
127
128
private:
129
QVariantMap m_props;
130
};
131
132
}
// namespace cc_tools_qt
133
134
Q_DECLARE_METATYPE(
cc_tools_qt
::
PluginProperties
::
SocketCreateFunc
);
135
Q_DECLARE_METATYPE(
cc_tools_qt
::
PluginProperties
::
ProtocolCreateFunc
);
136
Q_DECLARE_METATYPE(
cc_tools_qt
::
PluginProperties
::
FiltersCreateFunc
);
137
Q_DECLARE_METATYPE(
cc_tools_qt
::
PluginProperties
::
GuiActionsCreateFunc
);
138
Q_DECLARE_METATYPE(
cc_tools_qt
::
PluginProperties
::
ConfigWidgetCreateFunc
);
139
140
cc_tools_qt::PluginProperties
Accumulation of various properties of Plugin.
Definition
PluginProperties.h:43
cc_tools_qt::PluginProperties::~PluginProperties
~PluginProperties() noexcept
Destructor.
cc_tools_qt::PluginProperties::ListOfGuiActions
QList< QAction * > ListOfGuiActions
List of dynamically allocated QAction objects.
Definition
PluginProperties.h:49
cc_tools_qt::PluginProperties::FiltersCreateFunc
std::function< ListOfFilters()> FiltersCreateFunc
Type of callback to be used to allocate a Filter objects.
Definition
PluginProperties.h:64
cc_tools_qt::PluginProperties::GuiActionsCreateFunc
std::function< ListOfGuiActions()> GuiActionsCreateFunc
Type of callback to be used to allocate QAction to be displayed in the main toolbar of GUI applicatio...
Definition
PluginProperties.h:70
cc_tools_qt::PluginProperties::SocketCreateFunc
std::function< SocketPtr()> SocketCreateFunc
Type of callback to be used to allocate a Socket object.
Definition
PluginProperties.h:58
cc_tools_qt::PluginProperties::ListOfFilters
QList< FilterPtr > ListOfFilters
List of Filter objects.
Definition
PluginProperties.h:46
cc_tools_qt::PluginProperties::PluginProperties
PluginProperties()
Constructor.
cc_tools_qt::PluginProperties::ProtocolCreateFunc
std::function< ProtocolPtr()> ProtocolCreateFunc
Type of callback to be used to allocate a Protocol object.
Definition
PluginProperties.h:61
cc_tools_qt::PluginProperties::ConfigWidgetCreateFunc
std::function< QWidget *()> ConfigWidgetCreateFunc
Type of callback to be used when a widget responsible to configure the plugin needs to be allocated....
Definition
PluginProperties.h:76
cc_tools_qt
Main namespace for all classes / functions of the shared library.
cc_tools_qt::SocketPtr
std::shared_ptr< Socket > SocketPtr
Pointer to Socket object.
Definition
Socket.h:246
cc_tools_qt::ProtocolPtr
std::shared_ptr< Protocol > ProtocolPtr
Pointer to Protocol object.
Definition
Protocol.h:293
Generated by
1.9.8