File indexing completed on 2025-01-05 05:14:45

0001 #pragma once
0002 
0003 #include <QObject>
0004 
0005 #include <git2/cert.h>
0006 #include <git2/credential.h>
0007 
0008 namespace Git
0009 {
0010 
0011 namespace PushCallbacks
0012 {
0013 int git_helper_packbuilder_progress(int stage, uint32_t current, uint32_t total, void *payload);
0014 int git_helper_push_transfer_progress_cb(unsigned int current, unsigned int total, size_t bytes, void *payload);
0015 int git_helper_credential_acquire_cb(git_credential **out, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload);
0016 int git_helper_transport_certificate_check_cb(git_cert *cert, int valid, const char *host, void *payload);
0017 }
0018 
0019 class PushObserver : public QObject
0020 {
0021     Q_OBJECT
0022 public:
0023     PushObserver(QObject *parent = nullptr);
0024 
0025     Q_REQUIRED_RESULT unsigned int packProgressValue() const;
0026     void setPackProgressValue(unsigned int packProgressValue);
0027     Q_REQUIRED_RESULT unsigned int packProgressTotal() const;
0028     void setPackProgressTotal(unsigned int packProgressTotal);
0029     Q_REQUIRED_RESULT unsigned int transferProgressValue() const;
0030     void setTransferProgressValue(unsigned int transferProgressValue);
0031     Q_REQUIRED_RESULT unsigned int transferProgressTotal() const;
0032     void setTransferProgressTotal(unsigned int transferProgressTotal);
0033 
0034 signals:
0035     void packProgressValueChanged();
0036     void packProgressTotalChanged();
0037     void transferProgressValueChanged();
0038     void transferProgressTotalChanged();
0039 
0040 private:
0041     unsigned int mPackProgressValue;
0042     unsigned int mPackProgressTotal;
0043     unsigned int mTransferProgressValue;
0044     unsigned int mTransferProgressTotal;
0045     Q_PROPERTY(unsigned int packProgressValue READ packProgressValue WRITE setPackProgressValue NOTIFY packProgressValueChanged FINAL)
0046     Q_PROPERTY(unsigned int packProgressTotal READ packProgressTotal WRITE setPackProgressTotal NOTIFY packProgressTotalChanged FINAL)
0047     Q_PROPERTY(unsigned int transferProgressValue READ transferProgressValue WRITE setTransferProgressValue NOTIFY transferProgressValueChanged FINAL)
0048     Q_PROPERTY(unsigned int transferProgressTotal READ transferProgressTotal WRITE setTransferProgressTotal NOTIFY transferProgressTotalChanged FINAL)
0049 };
0050 
0051 }