feather/src/contactswidget.h

57 lines
1.3 KiB
C
Raw Normal View History

// SPDX-License-Identifier: BSD-3-Clause
2020-12-26 19:56:06 +00:00
// Copyright (c) 2020-2021, The Monero Project.
2021-06-27 12:51:15 +00:00
#ifndef FEATHER_CONTACTSWIDGET_H
#define FEATHER_CONTACTSWIDGET_H
#include "model/AddressBookModel.h"
#include "model/AddressBookProxyModel.h"
2020-12-23 04:54:57 +00:00
#include "appcontext.h"
#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;
2021-05-23 14:58:18 +00:00
void setSearchbarVisible(bool visible);
void focusSearchbar();
public slots:
void copyAddress();
void copyName();
void payTo();
2020-12-23 04:54:57 +00:00
void newContact(QString address = "", QString name = "");
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);
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;
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