File indexing completed on 2024-04-14 15:48:42

0001 /* generated by rust_qt_binding_generator */
0002 #ifndef BINDINGS_H
0003 #define BINDINGS_H
0004 
0005 #include <QtCore/QObject>
0006 #include <QtCore/QAbstractItemModel>
0007 
0008 class Demo;
0009 class Fibonacci;
0010 class FibonacciList;
0011 class FileSystemTree;
0012 class Processes;
0013 class TimeSeries;
0014 
0015 class Demo : public QObject
0016 {
0017     Q_OBJECT
0018 public:
0019     class Private;
0020 private:
0021     Fibonacci* const m_fibonacci;
0022     FibonacciList* const m_fibonacciList;
0023     FileSystemTree* const m_fileSystemTree;
0024     Processes* const m_processes;
0025     TimeSeries* const m_timeSeries;
0026     Private * m_d;
0027     bool m_ownsPrivate;
0028     Q_PROPERTY(Fibonacci* fibonacci READ fibonacci NOTIFY fibonacciChanged FINAL)
0029     Q_PROPERTY(FibonacciList* fibonacciList READ fibonacciList NOTIFY fibonacciListChanged FINAL)
0030     Q_PROPERTY(FileSystemTree* fileSystemTree READ fileSystemTree NOTIFY fileSystemTreeChanged FINAL)
0031     Q_PROPERTY(Processes* processes READ processes NOTIFY processesChanged FINAL)
0032     Q_PROPERTY(TimeSeries* timeSeries READ timeSeries NOTIFY timeSeriesChanged FINAL)
0033     explicit Demo(bool owned, QObject *parent);
0034 public:
0035     explicit Demo(QObject *parent = nullptr);
0036     ~Demo();
0037     const Fibonacci* fibonacci() const;
0038     Fibonacci* fibonacci();
0039     const FibonacciList* fibonacciList() const;
0040     FibonacciList* fibonacciList();
0041     const FileSystemTree* fileSystemTree() const;
0042     FileSystemTree* fileSystemTree();
0043     const Processes* processes() const;
0044     Processes* processes();
0045     const TimeSeries* timeSeries() const;
0046     TimeSeries* timeSeries();
0047 Q_SIGNALS:
0048     void fibonacciChanged();
0049     void fibonacciListChanged();
0050     void fileSystemTreeChanged();
0051     void processesChanged();
0052     void timeSeriesChanged();
0053 };
0054 
0055 class Fibonacci : public QObject
0056 {
0057     Q_OBJECT
0058     friend class Demo;
0059 public:
0060     class Private;
0061 private:
0062     Private * m_d;
0063     bool m_ownsPrivate;
0064     Q_PROPERTY(quint32 input READ input WRITE setInput NOTIFY inputChanged FINAL)
0065     Q_PROPERTY(quint64 result READ result NOTIFY resultChanged FINAL)
0066     explicit Fibonacci(bool owned, QObject *parent);
0067 public:
0068     explicit Fibonacci(QObject *parent = nullptr);
0069     ~Fibonacci();
0070     quint32 input() const;
0071     void setInput(quint32 v);
0072     quint64 result() const;
0073 Q_SIGNALS:
0074     void inputChanged();
0075     void resultChanged();
0076 };
0077 
0078 class FibonacciList : public QAbstractItemModel
0079 {
0080     Q_OBJECT
0081     friend class Demo;
0082 public:
0083     class Private;
0084 private:
0085     Private * m_d;
0086     bool m_ownsPrivate;
0087     explicit FibonacciList(bool owned, QObject *parent);
0088 public:
0089     explicit FibonacciList(QObject *parent = nullptr);
0090     ~FibonacciList();
0091 
0092     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0093     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0094     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0095     QModelIndex parent(const QModelIndex &index) const override;
0096     bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
0097     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0098     bool canFetchMore(const QModelIndex &parent) const override;
0099     void fetchMore(const QModelIndex &parent) override;
0100     Qt::ItemFlags flags(const QModelIndex &index) const override;
0101     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0102     int role(const char* name) const;
0103     QHash<int, QByteArray> roleNames() const override;
0104     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0105     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
0106     Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0107     Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0108     Q_INVOKABLE quint64 fibonacciNumber(int row) const;
0109     Q_INVOKABLE quint64 row(int row) const;
0110 
0111 Q_SIGNALS:
0112     // new data is ready to be made available to the model with fetchMore()
0113     void newDataReady(const QModelIndex &parent) const;
0114 private:
0115     QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
0116     void initHeaderData();
0117     void updatePersistentIndexes();
0118 Q_SIGNALS:
0119 };
0120 
0121 class FileSystemTree : public QAbstractItemModel
0122 {
0123     Q_OBJECT
0124     friend class Demo;
0125 public:
0126     class Private;
0127 private:
0128     Private * m_d;
0129     bool m_ownsPrivate;
0130     Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged FINAL)
0131     explicit FileSystemTree(bool owned, QObject *parent);
0132 public:
0133     explicit FileSystemTree(QObject *parent = nullptr);
0134     ~FileSystemTree();
0135     QString path() const;
0136     void setPath(const QString& v);
0137 
0138     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0139     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0140     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0141     QModelIndex parent(const QModelIndex &index) const override;
0142     bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
0143     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0144     bool canFetchMore(const QModelIndex &parent) const override;
0145     void fetchMore(const QModelIndex &parent) override;
0146     Qt::ItemFlags flags(const QModelIndex &index) const override;
0147     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0148     int role(const char* name) const;
0149     QHash<int, QByteArray> roleNames() const override;
0150     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0151     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
0152     Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0153     Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0154     Q_INVOKABLE QByteArray fileIcon(const QModelIndex& index) const;
0155     Q_INVOKABLE QString fileName(const QModelIndex& index) const;
0156     Q_INVOKABLE QString filePath(const QModelIndex& index) const;
0157     Q_INVOKABLE qint32 filePermissions(const QModelIndex& index) const;
0158     Q_INVOKABLE QVariant fileSize(const QModelIndex& index) const;
0159     Q_INVOKABLE qint32 fileType(const QModelIndex& index) const;
0160 
0161 Q_SIGNALS:
0162     // new data is ready to be made available to the model with fetchMore()
0163     void newDataReady(const QModelIndex &parent) const;
0164 private:
0165     QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
0166     void initHeaderData();
0167     void updatePersistentIndexes();
0168 Q_SIGNALS:
0169     void pathChanged();
0170 };
0171 
0172 class Processes : public QAbstractItemModel
0173 {
0174     Q_OBJECT
0175     friend class Demo;
0176 public:
0177     class Private;
0178 private:
0179     Private * m_d;
0180     bool m_ownsPrivate;
0181     Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged FINAL)
0182     explicit Processes(bool owned, QObject *parent);
0183 public:
0184     explicit Processes(QObject *parent = nullptr);
0185     ~Processes();
0186     bool active() const;
0187     void setActive(bool v);
0188 
0189     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0190     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0191     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0192     QModelIndex parent(const QModelIndex &index) const override;
0193     bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
0194     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0195     bool canFetchMore(const QModelIndex &parent) const override;
0196     void fetchMore(const QModelIndex &parent) override;
0197     Qt::ItemFlags flags(const QModelIndex &index) const override;
0198     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0199     int role(const char* name) const;
0200     QHash<int, QByteArray> roleNames() const override;
0201     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0202     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
0203     Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0204     Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0205     Q_INVOKABLE QString cmd(const QModelIndex& index) const;
0206     Q_INVOKABLE quint8 cpuPercentage(const QModelIndex& index) const;
0207     Q_INVOKABLE float cpuUsage(const QModelIndex& index) const;
0208     Q_INVOKABLE quint64 memory(const QModelIndex& index) const;
0209     Q_INVOKABLE QString name(const QModelIndex& index) const;
0210     Q_INVOKABLE quint32 pid(const QModelIndex& index) const;
0211     Q_INVOKABLE quint32 uid(const QModelIndex& index) const;
0212 
0213 Q_SIGNALS:
0214     // new data is ready to be made available to the model with fetchMore()
0215     void newDataReady(const QModelIndex &parent) const;
0216 private:
0217     QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
0218     void initHeaderData();
0219     void updatePersistentIndexes();
0220 Q_SIGNALS:
0221     void activeChanged();
0222 };
0223 
0224 class TimeSeries : public QAbstractItemModel
0225 {
0226     Q_OBJECT
0227     friend class Demo;
0228 public:
0229     class Private;
0230 private:
0231     Private * m_d;
0232     bool m_ownsPrivate;
0233     explicit TimeSeries(bool owned, QObject *parent);
0234 public:
0235     explicit TimeSeries(QObject *parent = nullptr);
0236     ~TimeSeries();
0237 
0238     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0239     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0240     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0241     QModelIndex parent(const QModelIndex &index) const override;
0242     bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
0243     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0244     bool canFetchMore(const QModelIndex &parent) const override;
0245     void fetchMore(const QModelIndex &parent) override;
0246     Qt::ItemFlags flags(const QModelIndex &index) const override;
0247     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0248     int role(const char* name) const;
0249     QHash<int, QByteArray> roleNames() const override;
0250     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0251     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
0252     Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0253     Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0254     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
0255     Q_INVOKABLE float cos(int row) const;
0256     Q_INVOKABLE bool setCos(int row, float value);
0257     Q_INVOKABLE float sin(int row) const;
0258     Q_INVOKABLE bool setSin(int row, float value);
0259     Q_INVOKABLE float time(int row) const;
0260     Q_INVOKABLE bool setTime(int row, float value);
0261 
0262 Q_SIGNALS:
0263     // new data is ready to be made available to the model with fetchMore()
0264     void newDataReady(const QModelIndex &parent) const;
0265 private:
0266     QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
0267     void initHeaderData();
0268     void updatePersistentIndexes();
0269 Q_SIGNALS:
0270 };
0271 #endif // BINDINGS_H