ACF $AcfVersion:0$
CLabel.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
6#include <istd/CIndex2d.h>
7
8#include <i2d/CPosition2d.h>
9
10
11namespace i2d
12{
13
14
19{
20public:
22
23 static QByteArray GetTypeName();
24
30 CLabel(const i2d::CVector2d& position = i2d::CVector2d(0, 0), const QString& labelText = "Label");
31
35 virtual const QString& GetText() const;
36
40 virtual void SetText(const QString& labelText);
41
42 // reimplemented (iser::ISerializable)
43 virtual bool Serialize(iser::IArchive& archive) override;
44
45 // reimplemented (iser::IObject)
46 virtual QByteArray GetFactoryId() const override;
47
48 // reimplemented istd::IChangeable
49 virtual int GetSupportedOperations() const override;
50 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
52
53private:
54 QString m_text;
55};
56
57
58// public inline methods
59
60inline const QString& CLabel::GetText() const
61{
62 return m_text;
63}
64
65
66} // namespace i2d
67
68
69
70
Data model for the label shape.
Definition CLabel.h:19
virtual const QString & GetText() const
Get label text.
Definition CLabel.h:60
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
virtual void SetText(const QString &labelText)
Set label text.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual QByteArray GetFactoryId() const override
CLabel(const i2d::CVector2d &position=i2d::CVector2d(0, 0), const QString &labelText="Label")
Construct the label object with predefined parameters.
static QByteArray GetTypeName()
i2d::CPosition2d BaseClass
Definition CLabel.h:21
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
Definition of graphical point object.
Definition CPosition2d.h:18
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Unique ownership smart pointer for interface types.
Contains the 2D objects.
Definition CAffine2d.h:11