File indexing completed on 2024-04-28 04:55:38
0001 /* 0002 This file is part of Choqok, the KDE micro-blogging client 0003 0004 SPDX-FileCopyrightText: 2010-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef TWITTERAPITEXTEDIT_H 0010 #define TWITTERAPITEXTEDIT_H 0011 0012 #include <QCompleter> 0013 0014 #include "account.h" 0015 #include "choqoktextedit.h" 0016 #include "twitterapihelper_export.h" 0017 0018 class KJob; 0019 0020 class TWITTERAPIHELPER_EXPORT TwitterApiTextEdit : public Choqok::UI::TextEdit 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 explicit TwitterApiTextEdit(Choqok::Account *theAccount, QWidget *parent = nullptr); 0026 ~TwitterApiTextEdit(); 0027 0028 void setCompleter(QCompleter *c); 0029 QCompleter *completer() const; 0030 0031 protected: 0032 void keyPressEvent(QKeyEvent *e) override; 0033 void focusInEvent(QFocusEvent *e) override; 0034 0035 private Q_SLOTS: 0036 void insertCompletion(const QString &completion); 0037 0038 private: 0039 // QString textUnderCursor() const; 0040 0041 class Private; 0042 Private *const d; 0043 }; 0044 0045 #endif // TWITTERAPITEXTEDIT_H