PIVX Core  5.6.99
P2P Digital Currency
sendmultirow.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2021 The PIVX 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 PIVX_QT_SENDMULTIROW_H
6 #define PIVX_QT_SENDMULTIROW_H
7 
8 #include "amount.h"
9 #include "pwidget.h"
10 #include "walletmodel.h"
11 #include <QAction>
12 #include <QPushButton>
13 #include <QWidget>
14 
15 class WalletModel;
16 class SendCoinsRecipient;
17 
18 namespace Ui {
19 class SendMultiRow;
20 class QPushButton;
21 }
22 
23 class SendMultiRow : public PWidget
24 {
25  Q_OBJECT
26 
27 public:
28  explicit SendMultiRow(PIVXGUI* _window, PWidget *parent = nullptr);
29  ~SendMultiRow();
30 
31  void hideLabels();
32  void showLabels();
33  void setNumber(int number);
34  int getNumber();
35 
36  void loadWalletModel() override;
37  bool validate();
39  QString getAddress();
41  QString getMemo();
42 
44  bool isClear();
45  void setOnlyStakingAddressAccepted(bool onlyStakingAddress);
46 
47  void setAddress(const QString& address);
48  void setLabel(const QString& label);
49  void setAmount(const QString& amount);
50  void setAddressAndLabelOrDescription(const QString& address, const QString& message);
51  void setFocus();
53 
54  QRect getEditLineRect();
55  int getEditHeight();
56  int getEditWidth();
57  int getMenuBtnWidth();
58  bool getSubtractFeeFromAmount() const;
59 
60  // Return true if memo was set and false if it was cleared.
61  bool launchMemoDialog();
62 
63 public Q_SLOTS:
64  void clear();
65  void updateDisplayUnit();
66  void onMemoClicked();
67 
68 Q_SIGNALS:
69  void removeEntry(SendMultiRow* entry);
73  void onUriParsed(const SendCoinsRecipient& rcp);
74 
75 protected:
76  void resizeEvent(QResizeEvent *event) override;
77  virtual void enterEvent(QEvent *) override ;
78  virtual void leaveEvent(QEvent *) override ;
79 
80 private Q_SLOTS:
81  void amountChanged(const QString&);
82  bool addressChanged(const QString&, bool fOnlyValidate = false);
83  void deleteClicked();
84  //void on_payTo_textChanged(const QString& address);
85  //void on_addressBookButton_clicked();
86 
87 private:
88  Ui::SendMultiRow *ui{nullptr};
89  QPushButton *iconNumber{nullptr};
90  QAction *btnContact{nullptr};
91 
92  int displayUnit{0};
93  int number{0};
94  bool isExpanded{false};
96 
98 
99 };
100 
101 #endif // PIVX_QT_SENDMULTIROW_H
int64_t CAmount
Amount in PIV (Can be negative)
Definition: amount.h:13
PIVX GUI main class.
Definition: pivxgui.h:46
void message(const QString &title, const QString &body, unsigned int style, bool *ret=nullptr)
QAction * btnContact
Definition: sendmultirow.h:90
SendCoinsRecipient recipient
Definition: sendmultirow.h:97
bool onlyStakingAddressAccepted
Definition: sendmultirow.h:95
bool launchMemoDialog()
void updateDisplayUnit()
void deleteClicked()
void amountChanged(const QString &)
SendCoinsRecipient getValue()
QPushButton * iconNumber
Definition: sendmultirow.h:89
void loadWalletModel() override
void setLabel(const QString &label)
void resizeEvent(QResizeEvent *event) override
void removeEntry(SendMultiRow *entry)
bool addressChanged(const QString &, bool fOnlyValidate=false)
void toggleSubtractFeeFromAmount()
virtual void enterEvent(QEvent *) override
void setNumber(int number)
void onUriParsed(const SendCoinsRecipient &rcp)
bool getSubtractFeeFromAmount() const
QRect getEditLineRect()
Ui::SendMultiRow * ui
Definition: sendmultirow.h:88
QString getAddress()
void setAmount(const QString &amount)
void setAddressAndLabelOrDescription(const QString &address, const QString &message)
QString getMemo()
void onMenuClicked(SendMultiRow *entry)
void onValueChanged()
void onContactsClicked(SendMultiRow *entry)
virtual void leaveEvent(QEvent *) override
void setOnlyStakingAddressAccepted(bool onlyStakingAddress)
CAmount getAmountValue()
int getMenuBtnWidth()
bool isClear()
Return whether the entry is still empty and unedited.
SendMultiRow(PIVXGUI *_window, PWidget *parent=nullptr)
void setAddress(const QString &address)
void onMemoClicked()
Interface to PIVX wallet from Qt view code.
Definition: walletmodel.h:109