cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ToolsRawDataField.h
1//
2// Copyright 2015 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7// This file is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20#pragma once
21
22#include "cc_tools_qt/ToolsField.h"
23
24#include <QtCore/QString>
25
26#include <memory>
27
28namespace cc_tools_qt
29{
30
31namespace field
32{
33
34class CC_TOOLS_API ToolsRawDataField : public ToolsField
35{
36public:
37 using ActPtr = std::unique_ptr<ToolsRawDataField>;
38
39 ToolsRawDataField();
40 virtual ~ToolsRawDataField() noexcept;
41
42 QString getValue() const;
43
44 void setValue(const QString& val);
45
46 int maxSize() const;
47
48 int minSize() const;
49
50 bool getForcedShowAll() const;
51 void setForcedShowAll(bool val = true);
52 bool isTruncated() const;
53
54 ActPtr actClone();
55
56protected:
57 virtual QString getValueImpl() const = 0;
58 virtual void setValueImpl(const QString& val) = 0;
59 virtual int maxSizeImpl() const = 0;
60 virtual int minSizeImpl() const = 0;
61
62 void dispatchImpl(ToolsFieldHandler& handler);
63
64 static const std::size_t TruncateLength = 128;
65
66private:
67 bool m_forcedShowAll = false;
68};
69
70using ToolsRawDataFieldPtr = ToolsRawDataField::ActPtr;
71
72} // namespace field
73
74} // namespace cc_tools_qt
75
Main namespace for all classes / functions of the shared library.