Fabcoin Core  0.16.2
P2P Digital Currency
abifunctionfield.h
Go to the documentation of this file.
1 #ifndef ABIFUNCTIONFIELD_H
2 #define ABIFUNCTIONFIELD_H
3 
4 #include <QWidget>
5 #include <QStackedWidget>
6 #include <QComboBox>
7 #include <QLabel>
8 #include <QVector>
9 #include <contractabi.h>
10 
11 class PlatformStyle;
12 class ABIParamsField;
13 
17 class ABIFunctionField : public QWidget
18 {
19  Q_OBJECT
20  Q_ENUMS(FunctionType)
21 public:
26  {
30  };
31 
37  ABIFunctionField(const PlatformStyle *platformStyle, FunctionType type, QWidget *parent = 0);
38 
43  void setContractABI(ContractABI *contractABI);
44 
50  QStringList getParamValue(int paramID);
51 
56  QList<QStringList> getParamsValues();
57 
64  std::vector<std::vector<std::string>> getValuesVector();
65 
70  int getSelectedFunction() const;
71 
72  bool isValid();
73 
74 Q_SIGNALS:
75  void functionChanged();
76 
77 public Q_SLOTS:
79 
80 private:
85 
89  void clear();
90 
91 private:
93  QWidget *m_func;
94  QComboBox *m_comboBoxFunc;
95  QLabel* m_labelFunction;
96  QStackedWidget *m_paramsField;
97  QVector<int> m_abiFunctionList;
100 
101  // QWidget interface
102 protected:
103  void paintEvent(QPaintEvent *);
104 };
105 
106 #endif // ABIFUNCTIONFIELD_H
QLabel * m_labelFunction
const PlatformStyle * m_platformStyle
QStringList getParamValue(int paramID)
getParamValue Get the value of the parameter with the id from the currently selected function ...
ABIFunctionField(const PlatformStyle *platformStyle, FunctionType type, QWidget *parent=0)
ABIFunctionField Constructor.
QStackedWidget * m_paramsField
ContractABI * m_contractABI
QVector< int > m_abiFunctionList
std::vector< std::vector< std::string > > getValuesVector()
getValuesVector Get params values vector List of all parameters that can be sent to a function...
void setContractABI(ContractABI *contractABI)
setContractABI Set the contract ABI (list of functions from the contract)
QComboBox * m_comboBoxFunc
FunctionType
The FunctionType enum Function type to display.
FunctionType m_functionType
int getSelectedFunction() const
getSelectedFunction Get the ABI for the selected function from the contract
void updateABIFunctionField()
updateABIFunctionField Populate the GUI control with functions
The ABIParamsField class List of parameters for contract function.
The ABIFunctionField class ABI functions widget.
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
QList< QStringList > getParamsValues()
getParamsValues Get the values of the whole list of input parameters for the selected function ...
void clear()
clear Clear the GUI control
void paintEvent(QPaintEvent *)