lbrycrd/src/qt/addressbookpage.h

78 lines
1.9 KiB
C
Raw Normal View History

2011-07-07 17:33:15 +02:00
#ifndef ADDRESSBOOKPAGE_H
#define ADDRESSBOOKPAGE_H
2011-05-08 22:23:31 +02:00
#include <QDialog>
2011-05-12 14:44:52 +02:00
namespace Ui {
2011-07-07 17:33:15 +02:00
class AddressBookPage;
2011-05-12 14:44:52 +02:00
}
class AddressTableModel;
2011-05-12 14:44:52 +02:00
2011-05-13 22:00:27 +02:00
QT_BEGIN_NAMESPACE
class QTableView;
class QItemSelection;
class QSortFilterProxyModel;
class QMenu;
class QModelIndex;
2011-05-13 22:00:27 +02:00
QT_END_NAMESPACE
2011-11-13 13:19:52 +01:00
/** Widget that shows a list of sending or receiving addresses.
*/
2011-07-07 17:33:15 +02:00
class AddressBookPage : public QDialog
2011-05-08 22:23:31 +02:00
{
Q_OBJECT
2011-05-12 14:44:52 +02:00
2011-05-08 22:23:31 +02:00
public:
enum Tabs {
2011-05-12 14:44:52 +02:00
SendingTab = 0,
ReceivingTab = 1
};
enum Mode {
2011-11-13 13:19:52 +01:00
ForSending, /**< Open address book to pick address for sending */
ForEditing /**< Open address book for editing */
};
2011-07-07 17:33:15 +02:00
explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
~AddressBookPage();
2011-05-08 22:23:31 +02:00
void setModel(AddressTableModel *model);
2011-05-13 22:00:27 +02:00
const QString &getReturnValue() const { return returnValue; }
2011-07-07 17:33:15 +02:00
public slots:
void done(int retval);
void exportClicked();
2011-07-07 17:33:15 +02:00
2011-05-12 14:44:52 +02:00
private:
2011-07-07 17:33:15 +02:00
Ui::AddressBookPage *ui;
AddressTableModel *model;
Mode mode;
2011-07-07 17:33:15 +02:00
Tabs tab;
2011-05-13 22:00:27 +02:00
QString returnValue;
QSortFilterProxyModel *proxyModel;
QMenu *contextMenu;
QAction *deleteAction;
QString newAddressToSelect;
2011-05-13 22:00:27 +02:00
2011-05-12 17:55:24 +02:00
private slots:
2011-05-13 22:00:27 +02:00
void on_deleteButton_clicked();
2011-05-12 17:55:24 +02:00
void on_newAddressButton_clicked();
/** Copy address of currently selected address entry to clipboard */
2011-05-12 17:55:24 +02:00
void on_copyToClipboard_clicked();
void on_signMessage_clicked();
void selectionChanged();
void on_showQRCode_clicked();
/** Spawn contextual menu (right mouse menu) for address book entry */
void contextualMenu(const QPoint &point);
/** Copy label of currently selected address entry to clipboard */
void onCopyLabelAction();
/** Edit currently selected address entry */
void onEditAction();
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int end);
2011-05-08 22:23:31 +02:00
};
#endif // ADDRESSBOOKDIALOG_H