File: dtextedit.h

package info (click to toggle)
dtkwidget 5.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 36,540 kB
  • sloc: cpp: 63,257; ansic: 132; python: 88; sh: 42; makefile: 13
file content (46 lines) | stat: -rw-r--r-- 1,074 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef DTEXTEDIT_H
#define DTEXTEDIT_H

#include <QTextEdit>

#include <dtkwidget_global.h>
#include <DObject>

QT_BEGIN_NAMESPACE
class QContextMenuEvent;
QT_END_NAMESPACE

DWIDGET_BEGIN_NAMESPACE
class DTextEditPrivate;
class DTextEdit : public QTextEdit, public DCORE_NAMESPACE::DObject
{
public:
    explicit DTextEdit(QWidget *parent = nullptr);
    explicit DTextEdit(const QString& text, QWidget* parent = nullptr);

public:
    bool speechToTextIsEnabled() const;
    void setSpeechToTextEnabled(bool enable);

    bool textToSpeechIsEnabled() const;
    void setTextToSpeechEnabled(bool enable);

    bool textToTranslateIsEnabled() const;
    void setTextToTranslateEnabled(bool enable);

protected:
    bool event(QEvent *e) override;
    void contextMenuEvent(QContextMenuEvent *e) override;
    virtual void keyPressEvent(QKeyEvent *e) override;

private:
    D_DECLARE_PRIVATE(DTextEdit)
};

DWIDGET_END_NAMESPACE

#endif // DTEXTEDIT_H