Bitcoin Core  21.99.0
P2P Digital Currency
receivecoinsdialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_RECEIVECOINSDIALOG_H
6 #define BITCOIN_QT_RECEIVECOINSDIALOG_H
7 
8 #include <qt/guiutil.h>
9 
10 #include <QDialog>
11 #include <QHeaderView>
12 #include <QItemSelection>
13 #include <QKeyEvent>
14 #include <QMenu>
15 #include <QPoint>
16 #include <QVariant>
17 
18 class PlatformStyle;
19 class WalletModel;
20 
21 namespace Ui {
22  class ReceiveCoinsDialog;
23 }
24 
25 QT_BEGIN_NAMESPACE
26 class QModelIndex;
27 QT_END_NAMESPACE
28 
30 class ReceiveCoinsDialog : public QDialog
31 {
32  Q_OBJECT
33 
34 public:
35  enum ColumnWidths {
40  };
41 
42  explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
44 
45  void setModel(WalletModel *model);
46 
47 public Q_SLOTS:
48  void clear();
49  void reject() override;
50  void accept() override;
51 
52 private:
53  Ui::ReceiveCoinsDialog *ui;
55  QMenu *contextMenu;
56  QAction* copyLabelAction;
58  QAction* copyAmountAction;
60 
61  QModelIndex selectedRow();
62  void copyColumnToClipboard(int column);
63 
64 private Q_SLOTS:
68  void on_recentRequestsView_doubleClicked(const QModelIndex &index);
69  void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
70  void updateDisplayUnit();
71  void showMenu(const QPoint &point);
72  void copyURI();
73  void copyAddress();
74  void copyLabel();
75  void copyMessage();
76  void copyAmount();
77 };
78 
79 #endif // BITCOIN_QT_RECEIVECOINSDIALOG_H
ReceiveCoinsDialog::AMOUNT_MINIMUM_COLUMN_WIDTH
@ AMOUNT_MINIMUM_COLUMN_WIDTH
Definition: receivecoinsdialog.h:38
ReceiveCoinsDialog
Dialog for requesting payment of bitcoins.
Definition: receivecoinsdialog.h:30
ReceiveCoinsDialog::setModel
void setModel(WalletModel *model)
Definition: receivecoinsdialog.cpp:72
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
ReceiveCoinsDialog::ReceiveCoinsDialog
ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
Definition: receivecoinsdialog.cpp:25
ReceiveCoinsDialog::copyAmount
void copyAmount()
Definition: receivecoinsdialog.cpp:313
ReceiveCoinsDialog::MINIMUM_COLUMN_WIDTH
@ MINIMUM_COLUMN_WIDTH
Definition: receivecoinsdialog.h:39
ReceiveCoinsDialog::LABEL_COLUMN_WIDTH
@ LABEL_COLUMN_WIDTH
Definition: receivecoinsdialog.h:37
ReceiveCoinsDialog::ui
Ui::ReceiveCoinsDialog * ui
Definition: receivecoinsdialog.h:53
ReceiveCoinsDialog::on_receiveButton_clicked
void on_receiveButton_clicked()
Definition: receivecoinsdialog.cpp:139
ReceiveCoinsDialog::on_removeRequestButton_clicked
void on_removeRequestButton_clicked()
Definition: receivecoinsdialog.cpp:222
ReceiveCoinsDialog::model
WalletModel * model
Definition: receivecoinsdialog.h:54
ReceiveCoinsDialog::updateDisplayUnit
void updateDisplayUnit()
Definition: receivecoinsdialog.cpp:131
ReceiveCoinsDialog::copyMessage
void copyMessage()
Definition: receivecoinsdialog.cpp:307
ReceiveCoinsDialog::copyColumnToClipboard
void copyColumnToClipboard(int column)
Definition: receivecoinsdialog.cpp:247
ReceiveCoinsDialog::contextMenu
QMenu * contextMenu
Definition: receivecoinsdialog.h:55
ReceiveCoinsDialog::selectedRow
QModelIndex selectedRow()
Definition: receivecoinsdialog.cpp:234
ReceiveCoinsDialog::platformStyle
const PlatformStyle * platformStyle
Definition: receivecoinsdialog.h:59
guiutil.h
ReceiveCoinsDialog::on_recentRequestsView_doubleClicked
void on_recentRequestsView_doubleClicked(const QModelIndex &index)
Definition: receivecoinsdialog.cpp:193
ReceiveCoinsDialog::recentRequestsView_selectionChanged
void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition: receivecoinsdialog.cpp:203
ReceiveCoinsDialog::copyLabel
void copyLabel()
Definition: receivecoinsdialog.cpp:301
ReceiveCoinsDialog::~ReceiveCoinsDialog
~ReceiveCoinsDialog()
Definition: receivecoinsdialog.cpp:106
ReceiveCoinsDialog::showMenu
void showMenu(const QPoint &point)
Definition: receivecoinsdialog.cpp:257
ReceiveCoinsDialog::copyMessageAction
QAction * copyMessageAction
Definition: receivecoinsdialog.h:57
ReceiveCoinsDialog::DATE_COLUMN_WIDTH
@ DATE_COLUMN_WIDTH
Definition: receivecoinsdialog.h:36
ReceiveCoinsDialog::accept
void accept() override
Definition: receivecoinsdialog.cpp:126
Ui
Definition: addressbookpage.h:14
ReceiveCoinsDialog::reject
void reject() override
Definition: receivecoinsdialog.cpp:121
ReceiveCoinsDialog::copyLabelAction
QAction * copyLabelAction
Definition: receivecoinsdialog.h:56
ReceiveCoinsDialog::ColumnWidths
ColumnWidths
Definition: receivecoinsdialog.h:35
ReceiveCoinsDialog::clear
void clear()
Definition: receivecoinsdialog.cpp:113
ReceiveCoinsDialog::on_showRequestButton_clicked
void on_showRequestButton_clicked()
Definition: receivecoinsdialog.cpp:211
ReceiveCoinsDialog::copyURI
void copyURI()
Definition: receivecoinsdialog.cpp:275
PlatformStyle
Definition: platformstyle.h:13
ReceiveCoinsDialog::copyAmountAction
QAction * copyAmountAction
Definition: receivecoinsdialog.h:58
ReceiveCoinsDialog::copyAddress
void copyAddress()
Definition: receivecoinsdialog.cpp:288