Messagelib

mailsourceviewtextbrowserwidget.h
1 /*
2  *
3  * This file is part of KMail, the KDE mail client.
4  *
5  * SPDX-FileCopyrightText: 2002-2003 Carsten Pfeiffer <[email protected]>
6  * SPDX-FileCopyrightText: 2003 Zack Rusin <[email protected]>
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 #pragma once
11 
12 #include <KSyntaxHighlighting/Repository>
13 #include <QPlainTextEdit>
14 #include <QSyntaxHighlighter>
15 namespace KPIMTextEdit
16 {
17 class SlideContainer;
18 class TextToSpeechWidget;
19 class TextToSpeechInterface;
20 }
21 
22 namespace MessageViewer
23 {
24 class FindBarSourceView;
25 
26 /**
27  * A tiny little class to use for displaying raw messages, textual
28  * attachments etc.
29  *
30  * Auto-deletes itself when closed.
31  *
32  * @author Carsten Pfeiffer <[email protected]>
33  */
34 class MailSourceViewTextBrowser;
35 
36 class MailSourceViewTextBrowserWidget : public QWidget
37 {
38  Q_OBJECT
39 public:
40  explicit MailSourceViewTextBrowserWidget(const QString &syntax, QWidget *parent = nullptr);
41 
42  void setText(const QString &text);
43  void setPlainText(const QString &text);
44  void setFixedFont();
45  Q_REQUIRED_RESULT MessageViewer::MailSourceViewTextBrowser *textBrowser() const;
46 
47 private:
48  void slotFind();
50  MailSourceViewTextBrowser *mTextBrowser = nullptr;
51  FindBarSourceView *mFindBar = nullptr;
52  KPIMTextEdit::SlideContainer *const mSliderContainer;
53  KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget;
54 };
55 
56 class MailSourceViewTextBrowser : public QPlainTextEdit
57 {
58  Q_OBJECT
59 public:
60  explicit MailSourceViewTextBrowser(KPIMTextEdit::TextToSpeechInterface *textToSpeechInterface, QWidget *parent = nullptr);
61 
62 protected:
63  void contextMenuEvent(QContextMenuEvent *event) override;
64 Q_SIGNALS:
65  void findText();
66 
67 private:
68  void slotSpeakText();
69  void slotSaveAs();
70  KPIMTextEdit::TextToSpeechInterface *mTextToSpeechInterface = nullptr;
71 };
72 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.