Skip to content
Snippets Groups Projects
Select Git revision
  • 06c3ffa6cee0a62e713acafb7cd4b32df5d4da69
  • master default protected
  • beta/202506161038
  • stable/20250613.0
  • nightly/20250613.0
  • beta/202506101658
  • stable/20250610.0
  • nightly/20250610.0
  • beta/202506091027
  • beta/202506061543
  • nightly/20250605.0
  • beta/202506051039
  • beta/202506051002
  • beta/202506041611
  • beta/202506041335
  • beta/202505231812
  • stable/20250523.0
  • nightly/20250523.0
  • nightly/20250515.0
  • nightly/20250510.0
  • nightly/20250509.1
  • nightly/20250509.0
22 results

currentcall.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    currentcall.cpp 14.29 KiB
    /****************************************************************************
     *    Copyright (C) 2018-2020 Savoir-faire Linux Inc.                                  *
     *   Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>       *
     *                                                                          *
     *   This library is free software; you can redistribute it and/or          *
     *   modify it under the terms of the GNU Lesser General Public             *
     *   License as published by the Free Software Foundation; either           *
     *   version 2.1 of the License, or (at your option) any later version.     *
     *                                                                          *
     *   This library is distributed in the hope that it will be useful,        *
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
     *   Lesser General Public License for more details.                        *
     *                                                                          *
     *   You should have received a copy of the GNU General Public License      *
     *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
     ***************************************************************************/
    #pragma once
    
    // LRC
    #include "typedefs.h"
    
    // std
    #include <ctime>
    
    #include <QString>
    
    namespace lrc {
    namespace api {
    
    namespace datatransfer {
    #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    Q_NAMESPACE
    Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
    #endif
    
    enum class Status {
        on_connection, // outgoing tx: wait for connection/acceptance, incoming tx: wait for local acceptance
        on_progress,      // connected, data transfer progress reporting
        success,          // transfer finished with success, all data sent
        stop_by_peer,     // error: transfer terminated by peer
        stop_by_host,     // eror: transfer terminated by local host
        unjoinable_peer,  // error: (outgoing only) peer connection failed
        timeout_expired,  // error: (outgoing only) peer awaiting too long, close turn socket
        invalid_pathname, // error: (file transfer only) given file is not a valid
        unsupported,      // error: unable to do the transfer (generic error)
        INVALID
    };
    #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
    Q_ENUM_NS(Status)
    #endif
    
    static inline const QString
    to_string(const Status& status)
    {
        switch (status) {
        case Status::on_connection:
            return "on_connection";
        case Status::on_progress:
            return "on_progress";
        case Status::success:
            return "success";
        case Status::stop_by_peer:
            return "stop_by_peer";
        case Status::stop_by_host:
            return "stop_by_host";
        case Status::unjoinable_peer:
            return "unjoinable_peer";
        case Status::timeout_expired:
            return "timeout_expired";