rule_editing.h
Go to the documentation of this file.
1 #ifndef RULE_EDITING_H
2 #define RULE_EDITING_H
3 
4 #include <QDialog>
5 #include <QTimer>
6 #include <QSyntaxHighlighter>
7 #include <QTextCharFormat>
8 #include <QTextEdit>
10 
11 namespace Ui {
12 class RuleEditing;
13 }
14 
15 class XMLSyntaxHighlighter : public QSyntaxHighlighter
16 {
17  Q_OBJECT
18 public:
19  XMLSyntaxHighlighter(QObject * parent);
20  XMLSyntaxHighlighter(QTextDocument * parent);
21  XMLSyntaxHighlighter(QTextEdit * parent);
22 
23 protected:
24  virtual void highlightBlock(const QString & text);
25 
26 private:
27  void highlightByRegex(const QTextCharFormat & format,
28  const QRegExp & regex, const QString & text);
29  void setRegexes();
30  void setFormats();
31 
32 private:
33  QTextCharFormat _xmlKeywordFormat;
34  QTextCharFormat _xmlElementFormat;
35  QTextCharFormat _xmlAttributeFormat;
36  QTextCharFormat _xmlValueFormat;
37  QTextCharFormat _xmlCommentFormat;
38 
39  QList<QRegExp> _xmlKeywordRegexes;
42  QRegExp _xmlValueRegex;
44 };
45 
46 
47 class RuleEditing : public QDialog
48 {
49  Q_OBJECT
50 
51 public:
52  explicit RuleEditing(QWidget *parent = 0);
53  ~RuleEditing();
54 
55  static RosIntrospection::SubstitutionRuleMap getRenamingRules();
56 
57  static QString getRenamingXML();
58 
59 private slots:
60 
61  void on_pushButtonSave_pressed();
62 
63  void on_pushButtonReset_pressed();
64 
65  void on_timer();
66 
67  void on_pushButtonCancel_pressed();
68 
69 private:
70 
71  bool isValidXml();
72 
73  Ui::RuleEditing *ui;
74 
76  QTimer _timer;
77 
78 private slots:
79 
80  virtual void closeEvent(QCloseEvent *event) override;
81 
82 };
83 
84 #endif // RULE_EDITING_H
QList< QRegExp > _xmlKeywordRegexes
Definition: rule_editing.h:39
QRegExp _xmlAttributeRegex
Definition: rule_editing.h:41
QTextCharFormat _xmlCommentFormat
Definition: rule_editing.h:37
Ui::RuleEditing * ui
Definition: rule_editing.h:73
QTextCharFormat _xmlValueFormat
Definition: rule_editing.h:36
std::map< ROSType, std::vector< SubstitutionRule > > SubstitutionRuleMap
QTextCharFormat _xmlElementFormat
Definition: rule_editing.h:34
std::string format(const std::string &, const time_point< seconds > &, const femtoseconds &, const time_zone &)
QTextCharFormat _xmlKeywordFormat
Definition: rule_editing.h:33
XMLSyntaxHighlighter * _highlighter
Definition: rule_editing.h:75
QTimer _timer
Definition: rule_editing.h:76
QTextCharFormat _xmlAttributeFormat
Definition: rule_editing.h:35


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18