CTextDocumentComp.h
Go to the documentation of this file.
1 #ifndef idoc_CTextDocumentComp_included
2 #define idoc_CTextDocumentComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 
8 // ACF includes
9 #include <icomp/CComponentBase.h>
10 #include <idoc/ITextDocument.h>
11 
12 
13 namespace idoc
14 {
15 
16 
21 {
22 public:
24 
25  I_BEGIN_COMPONENT(CTextDocumentComp);
26  I_REGISTER_INTERFACE(iser::ISerializable);
27  I_REGISTER_INTERFACE(ITextDocument);
28  I_ASSIGN(m_defaultTextAttrPtr, "DefaultText", "Default text", false, "Hallo World!");
29  I_END_COMPONENT;
30 
31  // reimplemented (idoc::ITextDocument)
32  virtual QString GetText() const;
33  virtual void SetText(const QString& text);
34 
35  // reimplemented (iser::ISerializable)
36  virtual bool Serialize(iser::IArchive& archive);
37 
38 protected:
39  // reimplemented (icomp::CComponentBase)
40  virtual void OnComponentCreated();
41 
42 private:
43  QString m_text;
44 
45  I_TEXTATTR(m_defaultTextAttrPtr);
46 };
47 
48 
49 } // namespace idoc
50 
51 
52 
53 #endif // !idoc_CTextDocumentComp_included
54 
55 
Base class for component implementation.
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
icomp::CComponentBase BaseClass
Simple implementation of a text document model.
Simple interface for a text document.
Definition: ITextDocument.h:17
Represent input/output persistence archive.
Definition: IArchive.h:30
virtual void OnComponentCreated()
virtual void SetText(const QString &text)
Set document text.
virtual QString GetText() const
Get document text.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.

© 2007-2017 Witold Gantzke and Kirill Lepskiy