MarkdownEditor.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 #include <QWidget>
27 
28 namespace armarx::Ui
29 {
30  class MarkdownEditor;
31 }
32 
33 namespace armarx
34 {
35  /**
36  * @class MarkdownEditor
37  * @brief The MarkdownEditor is a widget that provides editing of raw text and viewing
38  * of processed markdown text to html.
39  * The widget has a view mode (default and read only) which displays to html converted markdown text
40  * like a internet browser and an edit mode that show the raw markdown text, which can be edited.
41  * The mode can be toggled with the Edit button.
42  * Raw markdown text can be inserted with the the setPlainText() function and retrieved
43  * with the toPlainText() function.
44  */
45  class MarkdownEditor : public QWidget
46  {
47  Q_OBJECT
48 
49  public:
50  explicit MarkdownEditor(QWidget* parent = 0);
51  ~MarkdownEditor() override;
52  QString toPlainText() const;
53  void setPlainText(const QString& plainText);
54  public slots:
55  void showMarkdown(const QString& rawString = "");
56  void toggleEditor(bool toggled);
57  void openSyntaxUrl();
58  private slots:
59  void __forwardTextChanged();
60  signals:
61  void textChanged();
62  private:
63  Ui::MarkdownEditor* ui;
64  QString plainText;
65  };
66 
67 
68 }
69 
armarx::Ui
Definition: GuiUseCaseSelector.h:33
armarx::MarkdownEditor::openSyntaxUrl
void openSyntaxUrl()
Definition: MarkdownEditor.cpp:115
armarx::MarkdownEditor::textChanged
void textChanged()
armarx::MarkdownEditor::MarkdownEditor
MarkdownEditor(QWidget *parent=0)
Definition: MarkdownEditor.cpp:36
armarx::MarkdownEditor::setPlainText
void setPlainText(const QString &plainText)
Definition: MarkdownEditor.cpp:65
armarx::MarkdownEditor::showMarkdown
void showMarkdown(const QString &rawString="")
Definition: MarkdownEditor.cpp:79
armarx::MarkdownEditor::toPlainText
QString toPlainText() const
Definition: MarkdownEditor.cpp:53
armarx::MarkdownEditor::toggleEditor
void toggleEditor(bool toggled)
Definition: MarkdownEditor.cpp:97
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::MarkdownEditor
The MarkdownEditor is a widget that provides editing of raw text and viewing of processed markdown te...
Definition: MarkdownEditor.h:45
armarx::MarkdownEditor::~MarkdownEditor
~MarkdownEditor() override
Definition: MarkdownEditor.cpp:48