CTextEditor.h
Go to the documentation of this file.
1 #ifndef iqsci_CTextEditor_included
2 #define iqsci_CTextEditor_included
3 
4 
5 // ACF includes
6 #include "istd/TDelPtr.h"
7 
9 
11 
12 
13 // Project includes
14 #include "GeneratedFiles/iqsci/ui_CTextEditor.h"
15 
16 
17 class QsciScintilla;
18 class QsciLexer;
19 
20 
21 namespace iqsci
22 {
23 
24 
25 class CTextEditor: public QWidget, public Ui::CTextEditor, virtual public ibase::ICommandsProvider
26 {
27  Q_OBJECT
28 
29 public:
30  typedef QWidget BaseClass;
31 
32  CTextEditor(QWidget* parentWidget = NULL);
33 
34  virtual QString GetText() const;
35  virtual void SetText(const QString& text);
36 
37  virtual void OnRetranslate();
38 
39  // reimplemented (ibase::ICommandsProvider)
40  virtual const ibase::IHierarchicalCommand* GetCommands() const;
41 
42 public Q_SLOTS:
43  void SetFoldingEnabled(bool useFoldingEnabled);
44  void SetLineNumberEnabled(bool useFoldingEnabled);
45  void SetLanguage(const QString& language);
46  void SetReadOnly(bool readOnly = true);
47 
48 protected:
49  void RegisterLexers();
50 
51 protected Q_SLOTS:
52  virtual void OnSelectionChanged();
53  virtual void OnTextChanged();
54  virtual void OnToLowercase();
55  virtual void OnToUppercase();
56 
57 Q_SIGNALS:
58  void DataChanged();
59 
60 private:
61  typedef QMap<QString, QsciLexer*> LexerMap;
62 
63  LexerMap m_languages;
64 
65 private:
66  enum MenuFlags
67  {
68  MF_VIEW = 0x9977,
69  MF_EDIT
70  };
71 
72  iqtgui::CHierarchicalCommand m_rootCommand;
73  iqtgui::CHierarchicalCommand m_editorCommand;
74  iqtgui::CHierarchicalCommand m_viewCommand;
75  iqtgui::CHierarchicalCommand m_languageCommand;
76  iqtgui::CHierarchicalCommand m_lowercaseCommand;
77  iqtgui::CHierarchicalCommand m_uppercaseCommand;
78 
79  // view commands
80  iqtgui::CHierarchicalCommand m_useIdentGuideCommand;
81  iqtgui::CHierarchicalCommand m_useFoldingCommand;
82  iqtgui::CHierarchicalCommand m_showLineNumberCommand;
83 
84  QsciScintilla* m_scintilla;
85 };
86 
87 
88 } // namespace iqsci
89 
90 
91 #endif // !iqsci_CTextEditor_included
92 
93 
94 
virtual void OnRetranslate()
void SetFoldingEnabled(bool useFoldingEnabled)
CTextEditor(QWidget *parentWidget=NULL)
virtual void OnTextChanged()
virtual void SetText(const QString &text)
void SetReadOnly(bool readOnly=true)
void SetLineNumberEnabled(bool useFoldingEnabled)
void SetLanguage(const QString &language)
virtual QString GetText() const
virtual const ibase::IHierarchicalCommand * GetCommands() const
virtual void OnToUppercase()
virtual void OnToLowercase()
virtual void OnSelectionChanged()

© 2007-2011 Witold Gantzke and Kirill Lepskiy