File indexing completed on 2023-11-26 08:16:46

0001 /*
0002  * Add contact dialog
0003  *
0004  * Copyright (C) 2011 David Edmundson <kde@davidedmundson.co.uk>
0005  * Copyright (C) 2012 George Kiagiadakis <kiagiadakis.george@gmail.com>
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with this library; if not, write to the Free Software
0019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0020  */
0021 
0022 #ifndef ADDCONTACTDIALOG_H
0023 #define ADDCONTACTDIALOG_H
0024 
0025 #include <QDialog>
0026 
0027 #include <TelepathyQt/Types>
0028 
0029 #include <KTp/ktpcommoninternals_export.h>
0030 
0031 namespace Tp {
0032     class PendingOperation;
0033 }
0034 
0035 namespace KTp
0036 {
0037 class KTPCOMMONINTERNALS_EXPORT AddContactDialog : public QDialog
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit AddContactDialog(const Tp::AccountManagerPtr &accountManager, QWidget *parent = nullptr);
0043     ~AddContactDialog() override;
0044 
0045     void accept() override;
0046 
0047 protected:
0048     void closeEvent(QCloseEvent *e) override;
0049 
0050 private Q_SLOTS:
0051     KTPCOMMONINTERNALS_NO_EXPORT void _k_onContactsForIdentifiersFinished(Tp::PendingOperation *op);
0052     KTPCOMMONINTERNALS_NO_EXPORT void _k_onRequestPresenceSubscriptionFinished(Tp::PendingOperation *op);
0053     KTPCOMMONINTERNALS_NO_EXPORT void _k_onAccountUpgraded(Tp::PendingOperation *op);
0054     void updateSubscriptionMessageVisibility();
0055 
0056 private:
0057     KTPCOMMONINTERNALS_NO_EXPORT void setInProgress(bool inProgress);
0058 
0059     struct Private;
0060     Private * const d;
0061 };
0062 }
0063 
0064 #endif // ADDCONTACTDIALOG_H