ACF $AcfVersion:0$
CTextEditorComp.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// Qt includes
6#include <QtCore/QtGlobal>
7#if QT_VERSION >= 0x050000
8#include <QtWidgets/QTextEdit>
9#include <QtPrintSupport/QPrinter>
10#else
11#include <QtGui/QTextEdit>
12#include <QtGui/QPrinter>
13#endif
14
16
18
22
23#include <idoc/ITextDocument.h>
24
25
28 iqtgui::TGuiComponentBase<QTextEdit>,
29 imod::TSingleModelObserverBase<idoc::ITextDocument> >,
30 virtual public ibase::ICommandsProvider
31{
32 Q_OBJECT
33
34public:
38
39 I_BEGIN_COMPONENT(CTextEditorComp);
40 I_REGISTER_INTERFACE(imod::IModelEditor);
41 I_REGISTER_INTERFACE(imod::IObserver);
42 I_END_COMPONENT;
43
45
46 // reimplemented (ibase::ICommandsProvider)
47 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
48
49protected Q_SLOTS:
54
55protected:
56 // reimplemented (iqtgui::TGuiObserverWrap)
57 virtual void UpdateModel() const override;
58 virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
59
60 // reimplemented (iqtgui::CGuiComponentBase)
61 virtual void OnGuiCreated() override;
62 virtual void OnRetranslate() override;
63
64private:
65 iqtgui::CHierarchicalCommand m_rootCommand;
66 iqtgui::CHierarchicalCommand m_editorCommand;
67 iqtgui::CHierarchicalCommand m_lowercaseCommand;
68 iqtgui::CHierarchicalCommand m_uppercaseCommand;
69};
70
71
72
73
void OnToUppercase()
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
virtual void OnRetranslate() override
Called when non-GUI elements (like commands) should be retranslated.
void OnSelectionChanged()
virtual void UpdateModel() const override
Do update of the model to reflect the current contents of GUI.
iqtgui::TGuiObserverWrap< iqtgui::TGuiComponentBase< QTextEdit >, imod::TSingleModelObserverBase< idoc::ITextDocument > > BaseClass
void OnToLowercase()
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
Do update of the GUI to reflect the state of model.
void OnTextChanged()
Interface for a provider of the heriarchical commands.
Common interface for an model editor.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
Basic implementation for a single model observer with binding to concrete data object interface.
Implementation of hierarchical command based on QAction from Qt.
Base class for all Qt GUI componentes.
Join functionality of iqtgui::IGuiObject interface and imod::IObserver.
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface to define the hierarchical graph structures.