#pragma once
#include "cxx-qt-lib/qstring.h"
#include "cxx-qt-lib/qlist.h"
#include "cxx-qt-lib/qbytearray.h"
#include "cxx-qt-lib/qmap.h"
#include <QtCore/QObject>
#include "cxx-qt/connection.h"
#include "idescriptor_rust_codebase/src/service_manager.cxxqt.h"
#include "cxx-qt/thread.h"
#include <cstddef>
#include <cstdint>
#include <new>
#include <type_traits>
#include <utility>

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#endif // __clang__

namespace rust {
inline namespace cxxbridge1 {
// #include "rust/cxx.h"

#ifndef CXXBRIDGE1_RUST_BOX
#define CXXBRIDGE1_RUST_BOX
template <typename T>
class Box final {
public:
  using element_type = T;
  using const_pointer =
      typename std::add_pointer<typename std::add_const<T>::type>::type;
  using pointer = typename std::add_pointer<T>::type;

  Box() = delete;
  Box(Box &&) noexcept;
  ~Box() noexcept;

  explicit Box(const T &);
  explicit Box(T &&);

  Box &operator=(Box &&) & noexcept;

  const T *operator->() const noexcept;
  const T &operator*() const noexcept;
  T *operator->() noexcept;
  T &operator*() noexcept;

  template <typename... Fields>
  static Box in_place(Fields &&...);

  void swap(Box &) noexcept;

  static Box from_raw(T *) noexcept;

  T *into_raw() noexcept;

  /* Deprecated */ using value_type = element_type;

private:
  class uninit;
  class allocation;
  Box(uninit) noexcept;
  void drop() noexcept;

  friend void swap(Box &lhs, Box &rhs) noexcept { lhs.swap(rhs); }

  T *ptr;
};

template <typename T>
class Box<T>::uninit {};

template <typename T>
class Box<T>::allocation {
  static T *alloc() noexcept;
  static void dealloc(T *) noexcept;

public:
  allocation() noexcept : ptr(alloc()) {}
  ~allocation() noexcept {
    if (this->ptr) {
      dealloc(this->ptr);
    }
  }
  T *ptr;
};

template <typename T>
Box<T>::Box(Box &&other) noexcept : ptr(other.ptr) {
  other.ptr = nullptr;
}

template <typename T>
Box<T>::Box(const T &val) {
  allocation alloc;
  ::new (alloc.ptr) T(val);
  this->ptr = alloc.ptr;
  alloc.ptr = nullptr;
}

template <typename T>
Box<T>::Box(T &&val) {
  allocation alloc;
  ::new (alloc.ptr) T(std::move(val));
  this->ptr = alloc.ptr;
  alloc.ptr = nullptr;
}

template <typename T>
Box<T>::~Box() noexcept {
  if (this->ptr) {
    this->drop();
  }
}

template <typename T>
Box<T> &Box<T>::operator=(Box &&other) & noexcept {
  if (this->ptr) {
    this->drop();
  }
  this->ptr = other.ptr;
  other.ptr = nullptr;
  return *this;
}

template <typename T>
const T *Box<T>::operator->() const noexcept {
  return this->ptr;
}

template <typename T>
const T &Box<T>::operator*() const noexcept {
  return *this->ptr;
}

template <typename T>
T *Box<T>::operator->() noexcept {
  return this->ptr;
}

template <typename T>
T &Box<T>::operator*() noexcept {
  return *this->ptr;
}

template <typename T>
template <typename... Fields>
Box<T> Box<T>::in_place(Fields &&...fields) {
  allocation alloc;
  auto ptr = alloc.ptr;
  ::new (ptr) T{std::forward<Fields>(fields)...};
  alloc.ptr = nullptr;
  return from_raw(ptr);
}

template <typename T>
void Box<T>::swap(Box &rhs) noexcept {
  using std::swap;
  swap(this->ptr, rhs.ptr);
}

template <typename T>
Box<T> Box<T>::from_raw(T *raw) noexcept {
  Box box = uninit{};
  box.ptr = raw;
  return box;
}

template <typename T>
T *Box<T>::into_raw() noexcept {
  T *raw = this->ptr;
  this->ptr = nullptr;
  return raw;
}

template <typename T>
Box<T>::Box(uninit) noexcept {}
#endif // CXXBRIDGE1_RUST_BOX

#ifndef CXXBRIDGE1_RUST_FN
#define CXXBRIDGE1_RUST_FN
template <typename Signature>
class Fn;

template <typename Ret, typename... Args>
class Fn<Ret(Args...)> final {
public:
  Ret operator()(Args... args) const noexcept;
  Fn operator*() const noexcept;

private:
  Ret (*trampoline)(Args..., void *fn) noexcept;
  void *fn;
};

template <typename Ret, typename... Args>
Ret Fn<Ret(Args...)>::operator()(Args... args) const noexcept {
  return (*this->trampoline)(std::forward<Args>(args)..., this->fn);
}

template <typename Ret, typename... Args>
Fn<Ret(Args...)> Fn<Ret(Args...)>::operator*() const noexcept {
  return *this;
}
#endif // CXXBRIDGE1_RUST_FN

#ifndef CXXBRIDGE1_RUST_OPAQUE
#define CXXBRIDGE1_RUST_OPAQUE
class Opaque {
public:
  Opaque() = delete;
  Opaque(const Opaque &) = delete;
  ~Opaque() = delete;
};
#endif // CXXBRIDGE1_RUST_OPAQUE

#ifndef CXXBRIDGE1_IS_COMPLETE
#define CXXBRIDGE1_IS_COMPLETE
namespace detail {
namespace {
template <typename T, typename = std::size_t>
struct is_complete : std::false_type {};
template <typename T>
struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
} // namespace
} // namespace detail
#endif // CXXBRIDGE1_IS_COMPLETE

#ifndef CXXBRIDGE1_LAYOUT
#define CXXBRIDGE1_LAYOUT
class layout {
  template <typename T>
  friend std::size_t size_of();
  template <typename T>
  friend std::size_t align_of();
  template <typename T>
  static typename std::enable_if<std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_size_of() {
    return T::layout::size();
  }
  template <typename T>
  static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_size_of() {
    return sizeof(T);
  }
  template <typename T>
  static
      typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
      size_of() {
    return do_size_of<T>();
  }
  template <typename T>
  static typename std::enable_if<std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_align_of() {
    return T::layout::align();
  }
  template <typename T>
  static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
                                 std::size_t>::type
  do_align_of() {
    return alignof(T);
  }
  template <typename T>
  static
      typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
      align_of() {
    return do_align_of<T>();
  }
};

template <typename T>
std::size_t size_of() {
  return layout::size_of<T>();
}

template <typename T>
std::size_t align_of() {
  return layout::align_of<T>();
}
#endif // CXXBRIDGE1_LAYOUT
} // namespace cxxbridge1
} // namespace rust

#if __cplusplus >= 201402L
#define CXX_DEFAULT_VALUE(value) = value
#else
#define CXX_DEFAULT_VALUE(value)
#endif

namespace CXX {
  using ServiceManager = ::CXX::ServiceManager;
  struct RServiceManager;
  namespace cxx_qt_ServiceManager {
    struct ServiceManagerCxxQtThreadQueuedFn;
    struct CxxQtConstructorArguments0;
    struct CxxQtConstructorBaseArguments0;
    struct CxxQtConstructorNewArguments0;
    struct CxxQtConstructorInitializeArguments0;
  }
}

namespace CXX {
#ifndef CXXBRIDGE1_STRUCT_CXX$RServiceManager
#define CXXBRIDGE1_STRUCT_CXX$RServiceManager
struct RServiceManager final : public ::rust::Opaque {
  ~RServiceManager() = delete;

private:
  friend ::rust::layout;
  struct layout {
    static ::std::size_t size() noexcept;
    static ::std::size_t align() noexcept;
  };
};
#endif // CXXBRIDGE1_STRUCT_CXX$RServiceManager

namespace cxx_qt_ServiceManager {
#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$ServiceManagerCxxQtThreadQueuedFn
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$ServiceManagerCxxQtThreadQueuedFn
struct ServiceManagerCxxQtThreadQueuedFn final : public ::rust::Opaque {
  ~ServiceManagerCxxQtThreadQueuedFn() = delete;

private:
  friend ::rust::layout;
  struct layout {
    static ::std::size_t size() noexcept;
    static ::std::size_t align() noexcept;
  };
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$ServiceManagerCxxQtThreadQueuedFn

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorBaseArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorBaseArguments0
struct CxxQtConstructorBaseArguments0 final {
  ::std::int8_t not_empty CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorBaseArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorNewArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorNewArguments0
struct CxxQtConstructorNewArguments0 final {
  ::QString arg0;
  ::std::uint32_t arg1 CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorNewArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorInitializeArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorInitializeArguments0
struct CxxQtConstructorInitializeArguments0 final {
  ::std::int8_t not_empty CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorInitializeArguments0

#ifndef CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorArguments0
#define CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorArguments0
struct CxxQtConstructorArguments0 final {
  ::CXX::cxx_qt_ServiceManager::CxxQtConstructorBaseArguments0 base;
  ::CXX::cxx_qt_ServiceManager::CxxQtConstructorNewArguments0 new_;
  ::CXX::cxx_qt_ServiceManager::CxxQtConstructorInitializeArguments0 initialize;

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_CXX$cxx_qt_ServiceManager$CxxQtConstructorArguments0
} // namespace cxx_qt_ServiceManager

namespace rust {
namespace cxxqtgen1 {
void drop_ServiceManager_signal_handler_cable_info_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlercable_info_retrieved handler) noexcept;

void call_ServiceManager_signal_handler_cable_info_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlercable_info_retrieved &handler, ::CXX::ServiceManager &self_value, ::QString info) noexcept;

void drop_ServiceManager_signal_handler_mobilegestalt_info_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlermobilegestalt_info_retrieved handler) noexcept;

void call_ServiceManager_signal_handler_mobilegestalt_info_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlermobilegestalt_info_retrieved &handler, ::CXX::ServiceManager &self_value, ::QMap_QString_QVariant info) noexcept;

void drop_ServiceManager_signal_handler_dev_image_mounted(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdev_image_mounted handler) noexcept;

void call_ServiceManager_signal_handler_dev_image_mounted(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdev_image_mounted &handler, ::CXX::ServiceManager &self_value, bool success, bool is_locked) noexcept;

void drop_ServiceManager_signal_handler_developer_mode_option_revealed(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdeveloper_mode_option_revealed handler) noexcept;

void call_ServiceManager_signal_handler_developer_mode_option_revealed(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdeveloper_mode_option_revealed &handler, ::CXX::ServiceManager &self_value, bool success) noexcept;

void drop_ServiceManager_signal_handler_mounted_image_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlermounted_image_retrieved handler) noexcept;

void call_ServiceManager_signal_handler_mounted_image_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlermounted_image_retrieved &handler, ::CXX::ServiceManager &self_value, bool success, bool is_locked, ::QByteArray sig, ::std::uint64_t sig_length) noexcept;

void drop_ServiceManager_signal_handler_installed_apps_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstalled_apps_retrieved handler) noexcept;

void call_ServiceManager_signal_handler_installed_apps_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstalled_apps_retrieved &handler, ::CXX::ServiceManager &self_value, ::QMap_QString_QVariant const &apps) noexcept;

void drop_ServiceManager_signal_handler_app_icon_loaded(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerapp_icon_loaded handler) noexcept;

void call_ServiceManager_signal_handler_app_icon_loaded(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerapp_icon_loaded &handler, ::CXX::ServiceManager &self_value, ::QString bundle_id, ::QByteArray icon_data) noexcept;

void drop_ServiceManager_signal_handler_battery_info_updated(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerbattery_info_updated handler) noexcept;

void call_ServiceManager_signal_handler_battery_info_updated(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerbattery_info_updated &handler, ::CXX::ServiceManager &self_value, ::QString const &info) noexcept;

void drop_ServiceManager_signal_handler_disk_usage_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdisk_usage_retrieved handler) noexcept;

void call_ServiceManager_signal_handler_disk_usage_retrieved(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerdisk_usage_retrieved &handler, ::CXX::ServiceManager &self_value, bool success, ::std::uint64_t apps_usage, ::std::uint64_t gallery_usage) noexcept;

void drop_ServiceManager_signal_handler_install_ipa_init(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstall_ipa_init handler) noexcept;

void call_ServiceManager_signal_handler_install_ipa_init(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstall_ipa_init &handler, ::CXX::ServiceManager &self_value, bool started, ::QString state) noexcept;

void drop_ServiceManager_signal_handler_install_ipa_progress(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstall_ipa_progress handler) noexcept;

void call_ServiceManager_signal_handler_install_ipa_progress(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerinstall_ipa_progress &handler, ::CXX::ServiceManager &self_value, double progress, ::QString state) noexcept;

void drop_ServiceManager_signal_handler_enable_wifi_connections_result(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerenable_wifi_connections_result handler) noexcept;

void call_ServiceManager_signal_handler_enable_wifi_connections_result(::CXX::rust::cxxqtgen1::ServiceManagerCxxQtSignalHandlerenable_wifi_connections_result &handler, ::CXX::ServiceManager &self_value, bool success) noexcept;
} // namespace cxxqtgen1
} // namespace rust

namespace cxx_qt_ServiceManager {
::CXX::cxx_qt_ServiceManager::CxxQtConstructorArguments0 routeArguments0(::QString arg0, ::std::uint32_t arg1) noexcept;

::rust::Box<::CXX::RServiceManager> newRs0(::CXX::cxx_qt_ServiceManager::CxxQtConstructorNewArguments0 args) noexcept;

void initialize0(::CXX::ServiceManager &qobject, ::CXX::cxx_qt_ServiceManager::CxxQtConstructorInitializeArguments0 args) noexcept;
} // namespace cxx_qt_ServiceManager
} // namespace CXX

#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__
