ACF $AcfVersion:0$
CTextParamComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
7#include <iprm/CTextParam.h>
8
9
10namespace iprm
11{
12
13
19 public iprm::CTextParam
20{
21public:
24
25 I_BEGIN_COMPONENT(CTextParamComp);
26 I_REGISTER_INTERFACE(iprm::ITextParam);
27 I_REGISTER_INTERFACE(iser::ISerializable);
28 I_REGISTER_INTERFACE(istd::IChangeable);
29 I_ASSIGN(m_defaultTextAttrPtr, "DefaultText", "Default text", false, "");
30 I_ASSIGN(m_isReadonlyAttrPtr, "IsReadOnly", "When enabled, the text is fixed and cannot be changed during run tume", true, false);
31 I_ASSIGN(m_serializeParamsAttrPtr, "SerializeParams", "If set the parameters will be serialized/saved (true by default)", true, true);
32 I_END_COMPONENT;
33
34 // reimplemented (iprm::INameParam)
35 virtual void SetText(const QString& name) override;
36 virtual bool IsReadOnly() const override;
37
38 // reimplemented (iser::ISerializable)
39 virtual bool Serialize(iser::IArchive& archive) override;
40
41protected:
42 // reimplemented (icomp::CComponentBase)
43 virtual void OnComponentCreated() override;
44
45private:
46 I_TEXTATTR(m_defaultTextAttrPtr);
47 I_ATTR(bool, m_isReadonlyAttrPtr);
48 I_ATTR(bool, m_serializeParamsAttrPtr);
49};
50
51
52} // namespace iprm
53
54
55
56
Base class for component implementation.
Component for automatic creation of the Universally Unique Identifier (UUID)
virtual void SetText(const QString &name) override
Set the text value.
iprm::CTextParam BaseClass2
virtual void OnComponentCreated() override
icomp::CComponentBase BaseClass
virtual bool IsReadOnly() const override
Return true if the text is read-only.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
Implementation of the text value over iprm::ITextParam interface.
Definition CTextParam.h:17
Interface for an object containing simple text.
Definition ITextParam.h:76
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Common class for all classes which objects can be archived or restored from archive.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
#define I_TEXTATTR(member)
Declare translatable text attribute member.
Contains interfaces and implementations of flexible parameter concept.