Commit 798f0130 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk

misc: expose enum class value to qml client

Change-Id: I03835c364640409c92942ad9a95d9133e5e07520
parent 8c254175
......@@ -517,7 +517,7 @@ ENDIF()
IF(NOT ${ENABLE_STATIC} MATCHES false)
message(STATUS "Configuring as static lib")
add_library( ringclient_static STATIC ${libringclient_LIB_SRCS} ${LIB_HEADER_MOC} )
add_library( ringclient_static STATIC ${libringclient_LIB_SRCS} ${libringclient_api_LIB_HDRS} ${LIB_HEADER_MOC} )
target_link_libraries(ringclient_static Qt5::Core)
target_link_libraries(ringclient_static Qt5::Gui)
target_link_libraries( ringclient_static
......
/****************************************************************************
* Copyright (C) 2017-2020 Savoir-faire Linux Inc. *
* Copyright (C) 2017-2020 Savoir-faire Linux Inc. *
* Author: Nicolas Jäger <nicolas.jager@savoirfairelinux.com> *
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> *
* *
......@@ -42,12 +42,19 @@ class PeerDiscoveryModel;
namespace account
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
enum class Type {
INVALID,
RING,
SIP
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Type)
#endif
#pragma push_macro("REGISTERED")
#undef REGISTERED
......@@ -60,6 +67,9 @@ enum class Status {
TRYING,
REGISTERED
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Status)
#endif
static inline account::Status
to_status(const QString& type)
......@@ -84,6 +94,9 @@ enum class KeyExchangeProtocol {
NONE,
SDES
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(KeyExchangeProtocol)
#endif
enum class TlsMethod {
DEFAULT,
......@@ -91,6 +104,9 @@ enum class TlsMethod {
TLSv1_1,
TLSv1_2
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(TlsMethod)
#endif
struct ConfProperties_t {
QString mailbox;
......@@ -201,6 +217,9 @@ enum class ExportOnRingStatus {
NETWORK_ERROR = 2,
INVALID
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(ExportOnRingStatus)
#endif
enum class RegisterNameStatus {
SUCCESS = 0,
......@@ -210,6 +229,9 @@ enum class RegisterNameStatus {
NETWORK_ERROR = 4,
INVALID
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(RegisterNameStatus)
#endif
enum class LookupStatus {
SUCCESS = 0,
......@@ -218,6 +240,9 @@ enum class LookupStatus {
ERROR = 3,
INVALID
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(LookupStatus)
#endif
struct Info
{
......
......@@ -36,6 +36,10 @@ namespace api
namespace call
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
enum class Status {
INVALID,
......@@ -52,6 +56,9 @@ enum class Status {
TERMINATING,
CONNECTED
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Status)
#endif
static inline QString
to_string(const call::Status& status)
......@@ -126,6 +133,9 @@ enum class Type {
DIALOG,
CONFERENCE
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Type)
#endif
enum class Layout {
GRID,
......
......@@ -40,6 +40,10 @@ class Database;
namespace api
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
namespace account { struct Info; }
namespace interaction { struct Info; }
......@@ -52,6 +56,9 @@ enum class ConferenceableItem {
CALL,
CONTACT
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(ConferenceableItem)
#endif
struct AccountConversation
{
......
......@@ -28,6 +28,10 @@
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
......@@ -41,6 +45,9 @@ enum class Status {
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)
......
......@@ -30,6 +30,10 @@ namespace api
namespace interaction
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
enum class Type {
INVALID,
......@@ -39,6 +43,9 @@ enum class Type {
DATA_TRANSFER,
COUNT__
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Type)
#endif
static inline const QString
to_string(const Type& type)
......@@ -93,6 +100,9 @@ enum class Status {
TRANSFER_FINISHED,
COUNT__
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Status)
#endif
static inline const QString
to_string(const Status& status)
......
/****************************************************************************
* Copyright (C) 2018-2020 Savoir-faire Linux Inc. *
* Copyright (C) 2018-2020 Savoir-faire Linux Inc. *
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> *
* *
* This library is free software; you can redistribute it and/or *
......@@ -45,6 +45,10 @@ namespace api
namespace video
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
constexpr static const char PREVIEW_RENDERER_ID[] = "local";
......@@ -71,13 +75,16 @@ struct Frame {
unsigned int width { 0 };
};
enum DeviceType
enum class DeviceType
{
CAMERA,
DISPLAY,
FILE,
INVALID
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(DeviceType)
#endif
/**
* This class describes the current rendered device
......@@ -85,7 +92,7 @@ enum DeviceType
struct RenderedDevice
{
QString name;
DeviceType type = INVALID;
DeviceType type = DeviceType::INVALID;
};
/**
......
......@@ -18,6 +18,7 @@
***************************************************************************/
#pragma once
#include <QObject>
#include <QString>
namespace lrc
......@@ -28,6 +29,10 @@ namespace api
namespace profile
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_NAMESPACE
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
#endif
enum class Type {
INVALID,
......@@ -37,6 +42,9 @@ enum class Type {
TEMPORARY,
COUNT__
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
Q_ENUM_NS(Type)
#endif
static inline const QString
to_string(const Type& type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment