You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sendcoinsentry.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright (c) 2011-2015 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_SENDCOINSENTRY_H
  5. #define STARWELS_QT_SENDCOINSENTRY_H
  6. #include "walletmodel.h"
  7. #include <QStackedWidget>
  8. class WalletModel;
  9. class PlatformStyle;
  10. namespace Ui {
  11. class SendCoinsEntry;
  12. }
  13. /**
  14. * A single entry in the dialog for sending starwelss.
  15. * Stacked widget, with different UIs for payment requests
  16. * with a strong payee identity.
  17. */
  18. class SendCoinsEntry : public QStackedWidget
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit SendCoinsEntry(const PlatformStyle *platformStyle, QWidget *parent = 0);
  23. ~SendCoinsEntry();
  24. void setModel(WalletModel *model);
  25. bool validate();
  26. SendCoinsRecipient getValue();
  27. /** Return whether the entry is still empty and unedited */
  28. bool isClear();
  29. void setValue(const SendCoinsRecipient &value);
  30. void setAddress(const QString &address);
  31. /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases
  32. * (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
  33. */
  34. QWidget *setupTabChain(QWidget *prev);
  35. void setFocus();
  36. public Q_SLOTS:
  37. void clear();
  38. Q_SIGNALS:
  39. void removeEntry(SendCoinsEntry *entry);
  40. void payAmountChanged();
  41. void subtractFeeFromAmountChanged();
  42. private Q_SLOTS:
  43. void deleteClicked();
  44. void on_payTo_textChanged(const QString &address);
  45. void on_addressBookButton_clicked();
  46. void on_pasteButton_clicked();
  47. void updateDisplayUnit();
  48. private:
  49. SendCoinsRecipient recipient;
  50. Ui::SendCoinsEntry *ui;
  51. WalletModel *model;
  52. const PlatformStyle *platformStyle;
  53. bool updateLabel(const QString &address);
  54. };
  55. #endif // STARWELS_QT_SENDCOINSENTRY_H