[tests] Add libFuzzer support.
[bitcoinplatinum.git] / src / qt / coincontroldialog.h
blob0b8162f8580e1062939718eef246f7c7fcd92fbc
1 // Copyright (c) 2011-2016 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.
5 #ifndef BITCOIN_QT_COINCONTROLDIALOG_H
6 #define BITCOIN_QT_COINCONTROLDIALOG_H
8 #include "amount.h"
10 #include <QAbstractButton>
11 #include <QAction>
12 #include <QDialog>
13 #include <QList>
14 #include <QMenu>
15 #include <QPoint>
16 #include <QString>
17 #include <QTreeWidgetItem>
19 class PlatformStyle;
20 class WalletModel;
22 class CCoinControl;
23 class CTxMemPool;
25 namespace Ui {
26 class CoinControlDialog;
29 #define ASYMP_UTF8 "\xE2\x89\x88"
31 class CCoinControlWidgetItem : public QTreeWidgetItem
33 public:
34 CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
35 CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
36 CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
38 bool operator<(const QTreeWidgetItem &other) const;
42 class CoinControlDialog : public QDialog
44 Q_OBJECT
46 public:
47 explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
48 ~CoinControlDialog();
50 void setModel(WalletModel *model);
52 // static because also called from sendcoinsdialog
53 static void updateLabels(WalletModel*, QDialog*);
55 static QList<CAmount> payAmounts;
56 static CCoinControl *coinControl;
57 static bool fSubtractFeeFromAmount;
59 private:
60 Ui::CoinControlDialog *ui;
61 WalletModel *model;
62 int sortColumn;
63 Qt::SortOrder sortOrder;
65 QMenu *contextMenu;
66 QTreeWidgetItem *contextMenuItem;
67 QAction *copyTransactionHashAction;
68 QAction *lockAction;
69 QAction *unlockAction;
71 const PlatformStyle *platformStyle;
73 void sortView(int, Qt::SortOrder);
74 void updateView();
76 enum
78 COLUMN_CHECKBOX = 0,
79 COLUMN_AMOUNT,
80 COLUMN_LABEL,
81 COLUMN_ADDRESS,
82 COLUMN_DATE,
83 COLUMN_CONFIRMATIONS,
84 COLUMN_TXHASH,
85 COLUMN_VOUT_INDEX,
87 friend class CCoinControlWidgetItem;
89 private Q_SLOTS:
90 void showMenu(const QPoint &);
91 void copyAmount();
92 void copyLabel();
93 void copyAddress();
94 void copyTransactionHash();
95 void lockCoin();
96 void unlockCoin();
97 void clipboardQuantity();
98 void clipboardAmount();
99 void clipboardFee();
100 void clipboardAfterFee();
101 void clipboardBytes();
102 void clipboardLowOutput();
103 void clipboardChange();
104 void radioTreeMode(bool);
105 void radioListMode(bool);
106 void viewItemChanged(QTreeWidgetItem*, int);
107 void headerSectionClicked(int);
108 void buttonBoxClicked(QAbstractButton*);
109 void buttonSelectAllClicked();
110 void updateLabelLocked();
113 #endif // BITCOIN_QT_COINCONTROLDIALOG_H