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
28namespace armarx::Ui
29{
30 class MarkdownEditor;
31}
32
33namespace 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:
62
63 private:
64 Ui::MarkdownEditor* ui;
65 QString plainText;
66 };
67
68
69} // namespace armarx
MarkdownEditor(QWidget *parent=0)
void showMarkdown(const QString &rawString="")
QString toPlainText() const
void toggleEditor(bool toggled)
void setPlainText(const QString &plainText)
This file offers overloads of toIce() and fromIce() functions for STL container types.