CTextEditorGuiComp.h
Go to the documentation of this file.
1 #ifndef iqsci_CTextEditorGuiComp_included
2 #define iqsci_CTextEditorGuiComp_included
3 
4 
5 // ACF includes
7 
8 #include "idoc/ITextDocument.h"
9 
12 
13 #include "iqsci/CTextEditor.h"
14 
15 
16 namespace iqsci
17 {
18 
19 
22  iqtgui::TGuiComponentBase<CTextEditor>,
23  imod::TSingleModelObserverBase<idoc::ITextDocument> >,
24  virtual public ibase::ICommandsProvider
25 {
26  Q_OBJECT
27 
28 public:
32 
33  I_BEGIN_COMPONENT(CTextEditorGuiComp);
34  I_REGISTER_INTERFACE(ibase::ICommandsProvider);
35  I_REGISTER_INTERFACE(imod::IObserver);
36  I_ASSIGN(m_languageAttrPtr, "Language", "Use syntax highlighting for defined language", false, "Language");
37  I_ASSIGN(m_useFoldingAttrPtr, "UseFolding", "Use folding in the text document", false, true);
38  I_ASSIGN(m_readOnlyAttrPtr, "ReadOnly", "Document view is read only", false, false);
39  I_END_COMPONENT;
40 
41  // reimplemented (imod::IModelEditor)
42  virtual void UpdateModel() const;
43 
44  // reimplemented (iqtgui::TGuiObserverWrap)
45  virtual void UpdateGui(int updateFlags = 0);
46  virtual void OnGuiModelDetached();
47 
48  // reimplemented (ibase::ICommandsProvider)
49  virtual const ibase::IHierarchicalCommand* GetCommands() const;
50 
51 protected:
52  // reimplemented (iqtgui::CGuiComponentBase)
53  virtual void OnGuiCreated();
54  virtual void OnGuiRetranslate();
55 
56 protected Q_SLOTS:
57  virtual void OnTextChanged();
58 
59 private:
60  I_ATTR(bool, m_useFoldingAttrPtr);
61  I_ATTR(QString, m_languageAttrPtr);
62  I_ATTR(bool, m_readOnlyAttrPtr);
63 };
64 
65 
66 } // namespace iqsci
67 
68 
69 #endif // !iqsci_CTextEditorGuiComp_included
70 
71 
virtual void OnGuiModelDetached()
virtual void OnGuiRetranslate()
virtual const ibase::IHierarchicalCommand * GetCommands() const
virtual void OnTextChanged()
virtual void UpdateModel() const
virtual void OnGuiCreated()
virtual void UpdateGui(int updateFlags=0)
iqtgui::TGuiObserverWrap< iqtgui::TGuiComponentBase< CTextEditor >, imod::TSingleModelObserverBase< idoc::ITextDocument > > BaseClass

© 2007-2011 Witold Gantzke and Kirill Lepskiy