messagingwidget.h 1.99 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 3 4
/*
    This file is part of Akonadi Contact.

    Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Laurent Montel's avatar
Laurent Montel committed
5
    Copyright (C) 2016-2017 Laurent Montel <laurent.montel@kdab.com>
Laurent Montel's avatar
Laurent Montel committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This library is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
    License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

#ifndef MESSAGINGWIDGET_H
#define MESSAGINGWIDGET_H

#include <QWidget>
Laurent Montel's avatar
Laurent Montel committed
27 28

#include <editor/im/imaddress.h>
29
#include "akonadicontact_private_export.h"
Laurent Montel's avatar
Laurent Montel committed
30 31 32
class QToolButton;
namespace Akonadi
{
33
class PreferredLineEditWidget;
Laurent Montel's avatar
Laurent Montel committed
34
class AkonadiContactComboBox;
35
class AKONADI_CONTACTS_TESTS_EXPORT MessagingWidget : public QWidget
Laurent Montel's avatar
Laurent Montel committed
36 37 38
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
39
    explicit MessagingWidget(QWidget *parent = nullptr);
Laurent Montel's avatar
Laurent Montel committed
40 41
    ~MessagingWidget();

Laurent Montel's avatar
Laurent Montel committed
42
    void updateAddRemoveButton(bool addButtonEnabled);
Laurent Montel's avatar
Laurent Montel committed
43 44
    IMAddress imAddress() const;
    void setIMAddress(const IMAddress &address);
45
    void setPreferred(bool b);
Laurent Montel's avatar
Laurent Montel committed
46
    void clearWidget();
Laurent Montel's avatar
Laurent Montel committed
47
Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
48 49
    void addWidget(MessagingWidget *);
    void removeWidget(MessagingWidget *);
50
    void preferredChanged(MessagingWidget *);
Laurent Montel's avatar
Laurent Montel committed
51 52

private Q_SLOTS:
Laurent Montel's avatar
Laurent Montel committed
53
    void slotAddMessaging();
Laurent Montel's avatar
Laurent Montel committed
54
    void slotRemoveMessaging();
55
    void slotPreferredChanged();
Laurent Montel's avatar
Laurent Montel committed
56
private:
57
    PreferredLineEditWidget *mMessagingEdit;
Laurent Montel's avatar
Laurent Montel committed
58 59
    QToolButton *mAddButton;
    QToolButton *mRemoveButton;
Laurent Montel's avatar
Laurent Montel committed
60
    Akonadi::AkonadiContactComboBox *mProtocolCombo;
Laurent Montel's avatar
Laurent Montel committed
61 62 63
};
}
#endif // MESSAGINGWIDGET_H