Warning, file /sdk/lokalize/src/noteeditor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of Lokalize 0003 0004 SPDX-FileCopyrightText: 2009 Nick Shaforostoff <shafff@ukr.net> 0005 SPDX-FileCopyrightText: 2018-2019 Simon Depiets <sdepiets@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0008 */ 0009 0010 #ifndef NOTEEDITOR_H 0011 #define NOTEEDITOR_H 0012 0013 #include "note.h" 0014 0015 #include <QPlainTextEdit> 0016 class QStringListModel; 0017 class QLabel; 0018 class QTextBrowser; 0019 class QComboBox; 0020 class TextEdit; 0021 0022 int displayNotes(QTextBrowser* browser, const QVector< Note >& notes, int active = 0, bool multiple = true); 0023 QString escapeWithLinks(const QString& text);//defined in htmlhelpers.cpp 0024 0025 class NoteEditor: public QWidget 0026 { 0027 Q_OBJECT 0028 public: 0029 explicit NoteEditor(QWidget* parent); 0030 ~NoteEditor() {} 0031 0032 Note note(); 0033 void setNote(const Note&, int idx); 0034 int noteIndex() 0035 { 0036 return m_idx; 0037 } 0038 0039 void setNoteAuthors(const QStringList&); 0040 void setFromFieldVisible(bool); 0041 0042 Q_SIGNALS: 0043 void accepted(); 0044 void rejected(); 0045 0046 private: 0047 QComboBox* m_from; 0048 QLabel* m_fromLabel; 0049 QStringListModel* m_authors; 0050 TextEdit* m_edit; 0051 int m_idx; 0052 Note m_note; 0053 }; 0054 0055 0056 class TextEdit: public QPlainTextEdit 0057 { 0058 Q_OBJECT 0059 public: 0060 explicit TextEdit(QWidget* parent): QPlainTextEdit(parent) {} 0061 void keyPressEvent(QKeyEvent* e) override; 0062 Q_SIGNALS: 0063 void accepted(); 0064 void rejected(); 0065 }; 0066 0067 #endif