Messagelib

composerlineedit.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
3
4 Based on kmail/kmlineeditspell.h/cpp
5 SPDX-FileCopyrightText: 1997 Markus Wuebben <markus.wuebben@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#include "composerlineedit.h"
11#include <KCompletionBox>
12#include <QKeyEvent>
13
14#include "settings/messagecomposersettings.h"
15
16using namespace MessageComposer;
17
18ComposerLineEdit::ComposerLineEdit(bool useCompletion, QWidget *parent)
19 : PimCommon::AddresseeLineEdit(parent, useCompletion)
20{
21 allowSemicolonAsSeparator(MessageComposerSettings::allowSemicolonAsAddressSeparator());
22 setShowRecentAddresses(MessageComposerSettings::self()->showRecentAddressesInComposer());
23 setRecentAddressConfig(MessageComposerSettings::self()->config());
24 loadContacts();
25 setEnableBalooSearch(MessageComposerSettings::showBalooSearchInComposer());
26}
27
28ComposerLineEdit::~ComposerLineEdit() = default;
29
30//-----------------------------------------------------------------------------
31void ComposerLineEdit::keyPressEvent(QKeyEvent *e)
32{
33 if ((e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) && !completionBox()->isVisible()) {
34 Q_EMIT focusDown();
35 AddresseeLineEdit::keyPressEvent(e);
36 return;
37 } else if (e->key() == Qt::Key_Up) {
38 Q_EMIT focusUp();
39 return;
40 } else if (e->key() == Qt::Key_Down) {
41 Q_EMIT focusDown();
42 return;
43 }
44 AddresseeLineEdit::keyPressEvent(e);
45}
46
47#include "moc_composerlineedit.cpp"
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
int key() const const
Key_Enter
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.