Show webfinger if displayName is unknown for an author.
[larjonas-pumpa.git] / src / recipientedit.h
blob07ffe77b09c587609936ea47906a8a7df6e9f5d5
1 /*
2 Copyright 2013-2015 Mats Sjöberg
4 This file is part of the Pumpa programme.
6 Pumpa is free software: you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Pumpa is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Pumpa. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef RECIPIENT_EDIT_H
21 #define RECIPIENT_EDIT_H
23 #include <QLineEdit>
24 #include <QCompleter>
25 #include <QKeyEvent>
27 //------------------------------------------------------------------------------
29 class RecipientEdit : public QLineEdit {
30 Q_OBJECT
31 public:
32 RecipientEdit(QWidget* parent=0);
33 void setChoices(QStringList choices);
35 signals:
36 void ready();
38 protected slots:
39 void insertCompletion(QString completion);
41 protected:
42 virtual void keyPressEvent(QKeyEvent* event);
44 QPair<int, int> wordPosAtCursor();
46 void complete();
48 QStringList m_choices;
49 QCompleter* m_completer;
52 #endif