2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-12-26 19:56:06 +00:00
|
|
|
// Copyright (c) 2020-2021, The Monero Project.
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-06-27 12:51:15 +00:00
|
|
|
#ifndef FEATHER_CONTACTSWIDGET_H
|
|
|
|
#define FEATHER_CONTACTSWIDGET_H
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#include "model/AddressBookModel.h"
|
|
|
|
#include "model/AddressBookProxyModel.h"
|
2020-12-23 04:54:57 +00:00
|
|
|
#include "appcontext.h"
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ContactsWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ContactsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-05-18 15:59:18 +00:00
|
|
|
explicit ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
|
2020-12-23 04:54:57 +00:00
|
|
|
~ContactsWidget() override;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-05-23 14:58:18 +00:00
|
|
|
void setSearchbarVisible(bool visible);
|
|
|
|
void focusSearchbar();
|
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
public slots:
|
|
|
|
void copyAddress();
|
|
|
|
void copyName();
|
|
|
|
void payTo();
|
2020-12-23 04:54:57 +00:00
|
|
|
void newContact(QString address = "", QString name = "");
|
2020-10-07 10:36:04 +00:00
|
|
|
void deleteContact();
|
|
|
|
void setShowFullAddresses(bool show);
|
|
|
|
void setSearchFilter(const QString &filter);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void fillAddress(QString &address);
|
|
|
|
|
|
|
|
private slots:
|
2020-12-23 04:54:57 +00:00
|
|
|
void showHeaderMenu(const QPoint &position);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private:
|
2021-06-27 12:13:05 +00:00
|
|
|
QScopedPointer<Ui::ContactsWidget> ui;
|
2021-05-18 15:59:18 +00:00
|
|
|
QSharedPointer<AppContext> m_ctx;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
QAction *m_showFullAddressesAction;
|
|
|
|
QMenu *m_rowMenu;
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
QMenu *m_headerMenu;
|
|
|
|
AddressBookModel * m_model;
|
|
|
|
AddressBookProxyModel * m_proxyModel;
|
|
|
|
};
|
|
|
|
|
2021-06-27 12:51:15 +00:00
|
|
|
#endif // FEATHER_CONTACTSWIDGET_H
|