From f8cd01b7d878c5118ad5911894afd54e227faf63 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 17 Mar 2023 17:01:46 +0100 Subject: [PATCH] Progress of 2023/03/17 --- linphone-app/CMakeLists.txt | 4 + linphone-app/src/app/App.cpp | 2 +- linphone-app/src/components/Components.hpp | 1 + .../components/chat-room/ChatRoomModel.cpp | 71 +-- .../components/chat-room/ChatRoomModel.hpp | 6 +- .../components/chat-room/ChatRoomModelGUI.cpp | 66 +-- .../components/chat-room/ChatRoomModelGUI.hpp | 8 +- .../conferenceInfo/ConferenceInfoModel.cpp | 37 +- .../conferenceInfo/ConferenceInfoModel.hpp | 68 +-- .../conferenceInfo/ConferenceInfoModelGUI.cpp | 106 ++++ .../conferenceInfo/ConferenceInfoModelGUI.hpp | 153 +++++ .../components/contact/ContactModelGUI.cpp | 48 ++ .../components/contact/ContactModelGUI.hpp | 70 +++ .../src/components/contact/VcardModel.cpp | 5 +- .../src/components/contact/VcardModel.hpp | 4 + .../src/components/contact/VcardModelGUI.cpp | 533 ++++++++++++++++++ .../src/components/contact/VcardModelGUI.hpp | 120 ++++ .../participant/ParticipantListModel.cpp | 8 +- .../participant/ParticipantListModel.hpp | 6 +- .../participant/ParticipantListModelGUI.cpp | 14 +- .../participant/ParticipantListModelGUI.hpp | 6 +- .../settings/AccountSettingsModel.cpp | 24 +- .../settings/AccountSettingsModelGUI.cpp | 24 +- .../src/components/settings/SettingsModel.cpp | 238 ++++---- .../components/settings/SettingsModelGUI.cpp | 238 ++++---- linphone-app/src/utils/CodeHelpersGUI.hpp | 17 +- .../ui/modules/Linphone/Contact/Contact.qml | 18 + 27 files changed, 1505 insertions(+), 390 deletions(-) create mode 100644 linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.cpp create mode 100644 linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.hpp create mode 100644 linphone-app/src/components/contact/ContactModelGUI.cpp create mode 100644 linphone-app/src/components/contact/ContactModelGUI.hpp create mode 100644 linphone-app/src/components/contact/VcardModelGUI.cpp create mode 100644 linphone-app/src/components/contact/VcardModelGUI.hpp diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index 16ebd2a00..850de6874 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -225,6 +225,7 @@ set(SOURCES src/components/conference/ConferenceModel.cpp src/components/conference/ConferenceProxyModel.cpp src/components/conferenceInfo/ConferenceInfoModel.cpp + src/components/conferenceInfo/ConferenceInfoModelGUI.cpp src/components/conferenceInfo/ConferenceInfoListModel.cpp src/components/conferenceInfo/ConferenceInfoProxyModel.cpp src/components/conferenceScheduler/ConferenceScheduler.cpp @@ -271,6 +272,7 @@ set(SOURCES src/components/other/units/Units.cpp src/components/participant/ParticipantModel.cpp src/components/participant/ParticipantListModel.cpp + src/components/participant/ParticipantListModelGUI.cpp src/components/participant/ParticipantProxyModel.cpp src/components/participant/ParticipantDeviceListener.cpp src/components/participant/ParticipantDeviceModel.cpp @@ -370,6 +372,7 @@ set(HEADERS src/components/conference/ConferenceModel.hpp src/components/conference/ConferenceProxyModel.hpp src/components/conferenceInfo/ConferenceInfoModel.hpp + src/components/conferenceInfo/ConferenceInfoModelGUI.hpp src/components/conferenceInfo/ConferenceInfoListModel.hpp src/components/conferenceInfo/ConferenceInfoProxyModel.hpp src/components/conferenceScheduler/ConferenceScheduler.hpp @@ -417,6 +420,7 @@ set(HEADERS src/components/other/units/Units.hpp src/components/participant/ParticipantModel.hpp src/components/participant/ParticipantListModel.hpp + src/components/participant/ParticipantListModelGUI.hpp src/components/participant/ParticipantProxyModel.hpp src/components/participant/ParticipantDeviceListener.hpp src/components/participant/ParticipantDeviceModel.hpp diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index b260b355e..39ac1e229 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -673,7 +673,7 @@ void App::registerTypes () { registerType("ChatRoomProxyModel"); registerType("ConferenceHelperModel"); registerType("ConferenceProxyModel"); - registerType("ConferenceInfoModel"); + registerType("ConferenceInfoModel"); registerType("ConferenceInfoProxyModel"); registerType("ContactsListProxyModel"); registerType("ContactsImporterListProxyModel"); diff --git a/linphone-app/src/components/Components.hpp b/linphone-app/src/components/Components.hpp index 552fb5a05..440792c26 100644 --- a/linphone-app/src/components/Components.hpp +++ b/linphone-app/src/components/Components.hpp @@ -37,6 +37,7 @@ #include "conference/ConferenceModel.hpp" #include "conference/ConferenceProxyModel.hpp" #include "conferenceInfo/ConferenceInfoModel.hpp" +#include "conferenceInfo/ConferenceInfoModelGUI.hpp" #include "conferenceInfo/ConferenceInfoProxyModel.hpp" #include "conferenceScheduler/ConferenceScheduler.hpp" #include "contact/ContactModel.hpp" diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 2db0de26e..f43987842 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -58,6 +58,7 @@ #include "components/settings/SettingsModel.hpp" #include "components/participant/ParticipantModel.hpp" #include "components/participant/ParticipantListModel.hpp" +#include "components/participant/ParticipantListModelGUI.hpp" #include "components/presence/Presence.hpp" #include "components/recorder/RecorderManager.hpp" #include "components/recorder/RecorderModel.hpp" @@ -392,8 +393,8 @@ int ChatRoomModel::getPresenceStatus() const { return -1; } -ParticipantListModel* ChatRoomModel::getParticipantListModel() const{ - return mParticipantListModel.get(); +ParticipantListModelGUI* ChatRoomModel::getParticipantListModel() const{ + return new ParticipantListModelGUI(mParticipantListModel); } std::list> ChatRoomModel::getParticipants(const bool& withMe) const{ @@ -1489,36 +1490,36 @@ void ChatRoomModel::onChatMessageParticipantImdnStateChanged(const std::shared_p // SYNC SLOTS //------------------------------------------------------------- -DECLARE_SYNC_BODY_SLOT_CONST(QString, getPeerAddress, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLocalAddress, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getFullPeerAddress, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getFullLocalAddress, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getConferenceAddress, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getSubject, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getUsername, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getAvatar, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getPresenceStatus, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(LinphoneEnums::ChatRoomState , getState, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isReadOnly, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isEphemeralEnabled, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(long, getEphemeralLifetime, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, canBeEphemeral, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, haveEncryption, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, markAsReadEnabled, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isSecure, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getSecurityLevel, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isGroupEnabled, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isConference, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isOneToOne, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isMeAdmin, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, canHandleParticipants, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getIsRemoteComposing, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isEntriesLoading, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isUpdating, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isNotificationsEnabled, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(ParticipantListModel*, getParticipantListModel, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QList, getComposers, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(ChatMessageModel*, getReply, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(QDateTime, getLastUpdateTime, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getUnreadMessagesCount, ChatRoomModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getMissedCallsCount, ChatRoomModel) \ No newline at end of file +DEFINE_SYNC_BODY_SLOT_CONST(QString, getPeerAddress, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLocalAddress, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getFullPeerAddress, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getFullLocalAddress, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getConferenceAddress, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getSubject, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getUsername, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getAvatar, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getPresenceStatus, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(LinphoneEnums::ChatRoomState , getState, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isReadOnly, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isEphemeralEnabled, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(long, getEphemeralLifetime, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, canBeEphemeral, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, haveEncryption, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, markAsReadEnabled, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isSecure, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getSecurityLevel, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isGroupEnabled, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isConference, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isOneToOne, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isMeAdmin, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, canHandleParticipants, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getIsRemoteComposing, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isEntriesLoading, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isUpdating, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isNotificationsEnabled, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(ParticipantListModelGUI*, getParticipantListModel, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QList, getComposers, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(ChatMessageModel*, getReply, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(QDateTime, getLastUpdateTime, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getUnreadMessagesCount, ChatRoomModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getMissedCallsCount, ChatRoomModel) \ No newline at end of file diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index 79f710afe..4704896b1 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -31,6 +31,8 @@ // Fetch all N messages of a ChatRoom. // ============================================================================= +#include "components/participant/ParticipantListModelGUI.hpp" + class CoreHandlers; class ParticipantModel; class ParticipantListModel; @@ -107,7 +109,7 @@ public: int getUnreadMessagesCount() const; int getMissedCallsCount() const; - ParticipantListModel* getParticipantListModel() const; + ParticipantListModelGUI* getParticipantListModel() const; std::list> getParticipants(const bool& withMe = true) const; std::shared_ptr getChatRoom(); QList getComposers() const; @@ -317,7 +319,7 @@ public slots: DECLARE_SYNC_SLOT_CONST(bool, isEntriesLoading) DECLARE_SYNC_SLOT_CONST(bool, isUpdating) DECLARE_SYNC_SLOT_CONST(bool, isNotificationsEnabled) - DECLARE_SYNC_SLOT_CONST(ParticipantListModel*, getParticipantListModel) + DECLARE_SYNC_SLOT_CONST(ParticipantListModelGUI*, getParticipantListModel) DECLARE_SYNC_SLOT_CONST(QList, getComposers) DECLARE_SYNC_SLOT_CONST(ChatMessageModel*, getReply) DECLARE_SYNC_SLOT_CONST(QDateTime, getLastUpdateTime) diff --git a/linphone-app/src/components/chat-room/ChatRoomModelGUI.cpp b/linphone-app/src/components/chat-room/ChatRoomModelGUI.cpp index 4f0566a0a..218459f41 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModelGUI.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModelGUI.cpp @@ -133,37 +133,37 @@ ChatRoomModelGUI::~ChatRoomModelGUI(){ } -DECLARE_GETTER(QString, getPeerAddress, ChatRoomModel) -DECLARE_GETTER(QString, getLocalAddress, ChatRoomModel) -DECLARE_GETTER(QString, getFullPeerAddress, ChatRoomModel) -DECLARE_GETTER(QString, getFullLocalAddress, ChatRoomModel) -DECLARE_GETTER(QString, getConferenceAddress, ChatRoomModel) -DECLARE_GETTER(QString, getSubject, ChatRoomModel) -DECLARE_GETTER(QString, getUsername, ChatRoomModel) -DECLARE_GETTER(QString, getAvatar, ChatRoomModel) -DECLARE_GETTER(int, getPresenceStatus, ChatRoomModel) -DECLARE_GETTER(LinphoneEnums::ChatRoomState , getState, ChatRoomModel) -DECLARE_GETTER(bool, isReadOnly, ChatRoomModel) -DECLARE_GETTER(bool, isEphemeralEnabled, ChatRoomModel) -DECLARE_GETTER(long, getEphemeralLifetime, ChatRoomModel) -DECLARE_GETTER(bool, canBeEphemeral, ChatRoomModel) -DECLARE_GETTER(bool, haveEncryption, ChatRoomModel) -DECLARE_GETTER(bool, markAsReadEnabled, ChatRoomModel) -DECLARE_GETTER(bool, isSecure, ChatRoomModel) -DECLARE_GETTER(int, getSecurityLevel, ChatRoomModel) -DECLARE_GETTER(bool, isGroupEnabled, ChatRoomModel) -DECLARE_GETTER(bool, isConference, ChatRoomModel) -DECLARE_GETTER(bool, isOneToOne, ChatRoomModel) -DECLARE_GETTER(bool, isMeAdmin, ChatRoomModel) -DECLARE_GETTER(bool, canHandleParticipants, ChatRoomModel) -DECLARE_GETTER(bool, getIsRemoteComposing, ChatRoomModel) -DECLARE_GETTER(bool, isEntriesLoading, ChatRoomModel) -DECLARE_GETTER(bool, isUpdating, ChatRoomModel) -DECLARE_GETTER(bool, isNotificationsEnabled, ChatRoomModel) -DECLARE_GETTER(ParticipantListModel*, getParticipantListModel, ChatRoomModel) -DECLARE_GETTER(QList, getComposers, ChatRoomModel) -DECLARE_GETTER(ChatMessageModel*, getReply, ChatRoomModel) -DECLARE_GETTER(QDateTime, getLastUpdateTime, ChatRoomModel) -DECLARE_GETTER(int, getUnreadMessagesCount, ChatRoomModel) -DECLARE_GETTER(int, getMissedCallsCount, ChatRoomModel) +DEFINE_GETTER(QString, getPeerAddress, ChatRoomModel) +DEFINE_GETTER(QString, getLocalAddress, ChatRoomModel) +DEFINE_GETTER(QString, getFullPeerAddress, ChatRoomModel) +DEFINE_GETTER(QString, getFullLocalAddress, ChatRoomModel) +DEFINE_GETTER(QString, getConferenceAddress, ChatRoomModel) +DEFINE_GETTER(QString, getSubject, ChatRoomModel) +DEFINE_GETTER(QString, getUsername, ChatRoomModel) +DEFINE_GETTER(QString, getAvatar, ChatRoomModel) +DEFINE_GETTER(int, getPresenceStatus, ChatRoomModel) +DEFINE_GETTER(LinphoneEnums::ChatRoomState , getState, ChatRoomModel) +DEFINE_GETTER(bool, isReadOnly, ChatRoomModel) +DEFINE_GETTER(bool, isEphemeralEnabled, ChatRoomModel) +DEFINE_GETTER(long, getEphemeralLifetime, ChatRoomModel) +DEFINE_GETTER(bool, canBeEphemeral, ChatRoomModel) +DEFINE_GETTER(bool, haveEncryption, ChatRoomModel) +DEFINE_GETTER(bool, markAsReadEnabled, ChatRoomModel) +DEFINE_GETTER(bool, isSecure, ChatRoomModel) +DEFINE_GETTER(int, getSecurityLevel, ChatRoomModel) +DEFINE_GETTER(bool, isGroupEnabled, ChatRoomModel) +DEFINE_GETTER(bool, isConference, ChatRoomModel) +DEFINE_GETTER(bool, isOneToOne, ChatRoomModel) +DEFINE_GETTER(bool, isMeAdmin, ChatRoomModel) +DEFINE_GETTER(bool, canHandleParticipants, ChatRoomModel) +DEFINE_GETTER(bool, getIsRemoteComposing, ChatRoomModel) +DEFINE_GETTER(bool, isEntriesLoading, ChatRoomModel) +DEFINE_GETTER(bool, isUpdating, ChatRoomModel) +DEFINE_GETTER(bool, isNotificationsEnabled, ChatRoomModel) +DEFINE_GETTER(ParticipantListModelGUI*, getParticipantListModel, ChatRoomModel) +DEFINE_GETTER(QList, getComposers, ChatRoomModel) +DEFINE_GETTER(ChatMessageModel*, getReply, ChatRoomModel) +DEFINE_GETTER(QDateTime, getLastUpdateTime, ChatRoomModel) +DEFINE_GETTER(int, getUnreadMessagesCount, ChatRoomModel) +DEFINE_GETTER(int, getMissedCallsCount, ChatRoomModel) diff --git a/linphone-app/src/components/chat-room/ChatRoomModelGUI.hpp b/linphone-app/src/components/chat-room/ChatRoomModelGUI.hpp index 7769e16cc..e5044a755 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModelGUI.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModelGUI.hpp @@ -33,7 +33,7 @@ // Fetch all N messages of a ChatRoom. // ============================================================================= -class ParticipantListModel; +class ParticipantListModelGUI; class ChatRoomModel; class ChatMessageModel; @@ -86,7 +86,7 @@ public: Q_PROPERTY(bool markAsReadEnabled READ markAsReadEnabled WRITE enableMarkAsRead NOTIFY markAsReadEnabledChanged) Q_PROPERTY(bool notificationsEnabled READ isNotificationsEnabled WRITE enableNotifications NOTIFY notificationsEnabledChanged) - Q_PROPERTY(ParticipantListModel* participants READ getParticipantListModel CONSTANT) + Q_PROPERTY(ParticipantListModelGUI* participants READ getParticipantListModel CONSTANT) Q_PROPERTY(ChatMessageModel * reply READ getReply WRITE setReply NOTIFY replyChanged) @@ -135,7 +135,7 @@ public: int getUnreadMessagesCount() const; int getMissedCallsCount() const; - ParticipantListModel* getParticipantListModel() const; + ParticipantListModelGUI* getParticipantListModel() const; QList getComposers() const; ChatMessageModel * getReply()const; @@ -237,7 +237,7 @@ signals: DECLARE_SYNC_SIGNAL(bool, isEntriesLoading) DECLARE_SYNC_SIGNAL(bool, isUpdating) DECLARE_SYNC_SIGNAL(bool, isNotificationsEnabled) - DECLARE_SYNC_SIGNAL(ParticipantListModel*, getParticipantListModel) + DECLARE_SYNC_SIGNAL(ParticipantListModelGUI*, getParticipantListModel) DECLARE_SYNC_SIGNAL(QList, getComposers) DECLARE_SYNC_SIGNAL(ChatMessageModel*, getReply) DECLARE_SYNC_SIGNAL(QDateTime, getLastUpdateTime) diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp index 31bd46a09..c34366e18 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp @@ -54,6 +54,7 @@ #include "components/settings/SettingsModel.hpp" #include "components/participant/ParticipantModel.hpp" #include "components/participant/ParticipantListModel.hpp" +#include "components/participant/ParticipantListModelGUI.hpp" #include "components/presence/Presence.hpp" #include "components/recorder/RecorderManager.hpp" #include "components/recorder/RecorderModel.hpp" @@ -108,6 +109,9 @@ ConferenceInfoModel::ConferenceInfoModel (QObject * parent) : QObject(parent){ connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::inviteModeChanged); connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::conferenceInfoStateChanged); connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::conferenceSchedulerStateChanged); + + + } // Callable from C++ @@ -276,9 +280,11 @@ void ConferenceInfoModel::setDescription(const QString& description){ emit descriptionChanged(); } -void ConferenceInfoModel::setParticipants(ParticipantListModel * participants){ - mConferenceInfo->setParticipants(participants->getParticipants()); - emit participantsChanged(); +void ConferenceInfoModel::setParticipants(ParticipantListModelGUI * participants){ + if(participants && mConferenceInfo){ + mConferenceInfo->setParticipants(participants->getParticipantListModel()->getParticipants()); + emit participantsChanged(); + } } void ConferenceInfoModel::setTimeZoneModel(TimeZoneModel * model){ @@ -383,3 +389,28 @@ void ConferenceInfoModel::onInvitationsSent(const std::list create(std::shared_ptr conferenceInfo); ConferenceInfoModel (QObject * parent = nullptr); ConferenceInfoModel (std::shared_ptr conferenceInfo, QObject * parent = nullptr); @@ -74,12 +60,12 @@ public: QString getUri() const; bool isScheduled() const; int getInviteMode() const; - Q_INVOKABLE QVariantList getParticipants() const; - Q_INVOKABLE QVariantList getAllParticipants() const; - Q_INVOKABLE int getParticipantCount()const; - Q_INVOKABLE int getAllParticipantCount()const; - Q_INVOKABLE TimeZoneModel* getTimeZoneModel() const; - Q_INVOKABLE QString getIcalendarString() const; + QVariantList getParticipants() const; + QVariantList getAllParticipants() const; + int getParticipantCount()const; + int getAllParticipantCount()const; + TimeZoneModel* getTimeZoneModel() const; + QString getIcalendarString() const; LinphoneEnums::ConferenceInfoState getConferenceInfoState() const; LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const; @@ -91,15 +77,15 @@ public: void setIsScheduled(const bool& on); void setInviteMode(const int& modes); - Q_INVOKABLE void setParticipants(ParticipantListModel * participants); - Q_INVOKABLE void setTimeZoneModel(TimeZoneModel * model); + void setParticipants(ParticipantListModelGUI * participantsGUI); + void setTimeZoneModel(TimeZoneModel * model); void setConferenceInfo(std::shared_ptr conferenceInfo); // Tools - Q_INVOKABLE void resetConferenceInfo();// Recreate a new conference info from factory - Q_INVOKABLE void createConference(const int& securityLevel); - Q_INVOKABLE void cancelConference(); - Q_INVOKABLE void deleteConferenceInfo();// Remove completly this conference info from DB + void resetConferenceInfo();// Recreate a new conference info from factory + void createConference(const int& securityLevel); + void cancelConference(); + void deleteConferenceInfo();// Remove completly this conference info from DB // SCHEDULER @@ -135,9 +121,27 @@ private: int mInviteMode = 0; bool mRemoveRequested = false;// true if user has request its deletion from DB linphone::ConferenceScheduler::State mLastConferenceSchedulerState = linphone::ConferenceScheduler::State::Idle;// Workaround for missing getter in scheduler. + +public slots: + DECLARE_SYNC_SLOT_CONST(QDateTime, getDateTimeUtc); + DECLARE_SYNC_SLOT_CONST(QDateTime, getDateTimeSystem); + DECLARE_SYNC_SLOT_CONST(int, getDuration); + DECLARE_SYNC_SLOT_CONST(QDateTime, getEndDateTime); + DECLARE_SYNC_SLOT_CONST(QString, getOrganizer); + DECLARE_SYNC_SLOT_CONST(QString, getSubject); + DECLARE_SYNC_SLOT_CONST(QString, getDescription); + DECLARE_SYNC_SLOT_CONST(QString, displayNamesToString); + DECLARE_SYNC_SLOT_CONST(QString, getUri); + DECLARE_SYNC_SLOT_CONST(bool, isScheduled); + DECLARE_SYNC_SLOT_CONST(int, getInviteMode); + DECLARE_SYNC_SLOT_CONST(int, getParticipantCount); + DECLARE_SYNC_SLOT_CONST(int, getAllParticipantCount); + DECLARE_SYNC_SLOT_CONST(TimeZoneModel*, getTimeZoneModel); + DECLARE_SYNC_SLOT_CONST(QVariantList, getParticipants); + DECLARE_SYNC_SLOT_CONST(QVariantList, getAllParticipants); + DECLARE_SYNC_SLOT_CONST(QString, getIcalendarString); + DECLARE_SYNC_SLOT_CONST(LinphoneEnums::ConferenceInfoState, getConferenceInfoState); + DECLARE_SYNC_SLOT_CONST(LinphoneEnums::ConferenceSchedulerState, getConferenceSchedulerState); }; -Q_DECLARE_METATYPE(QSharedPointer) -Q_DECLARE_METATYPE(ConferenceInfoModel*) - #endif diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.cpp new file mode 100644 index 000000000..b8297a151 --- /dev/null +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#include "ConferenceInfoModelGUI.hpp" +// ============================================================================= +ConferenceInfoModelGUI::ConferenceInfoModelGUI(QObject * parent) : QObject(parent){ + +} +ConferenceInfoModelGUI::ConferenceInfoModelGUI (ConferenceInfoModel * appModel, QObject * parent) : QObject(parent){ +// Signals + CONNECT_CORE_TO_GUI(timeZoneModelChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(dateTimeChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(durationChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(organizerChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(subjectChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(descriptionChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(participantsChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(uriChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(isScheduledChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(inviteModeChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(conferenceInfoStateChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(conferenceSchedulerStateChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(conferenceCreated, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(conferenceCreationFailed, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(conferenceInfoChanged, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(invitationsSent, ConferenceInfoModel); + CONNECT_CORE_TO_GUI(removed, ConferenceInfoModel); + +// Setters/tools + CONNECT_GUI_TO_CORE(setDateTime, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setDuration, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setSubject, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setOrganizer, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setDescription, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setIsScheduled, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setInviteMode, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setParticipants, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(setTimeZoneModel, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(resetConferenceInfo, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(createConference, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(cancelConference, ConferenceInfoModel); + CONNECT_GUI_TO_CORE(deleteConferenceInfo, ConferenceInfoModel); + + // Getters + CONNECT_SYNC_TO_SLOT(getDateTimeUtc, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getDateTimeSystem, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getDuration, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getEndDateTime, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getOrganizer, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getSubject, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getDescription, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(displayNamesToString, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getUri, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(isScheduled, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getInviteMode, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getParticipantCount, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getAllParticipantCount, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getTimeZoneModel, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getParticipants, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getAllParticipants, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getIcalendarString, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getConferenceInfoState, ConferenceInfoModel); + CONNECT_SYNC_TO_SLOT(getConferenceSchedulerState, ConferenceInfoModel); +} + +ConferenceInfoModelGUI::~ConferenceInfoModelGUI () { +} + + +DEFINE_GETTER(QDateTime, getDateTimeUtc, ConferenceInfoModel); +DEFINE_GETTER(QDateTime, getDateTimeSystem, ConferenceInfoModel); +DEFINE_GETTER(int, getDuration, ConferenceInfoModel); +DEFINE_GETTER(QDateTime, getEndDateTime, ConferenceInfoModel); +DEFINE_GETTER(QString, getOrganizer, ConferenceInfoModel); +DEFINE_GETTER(QString, getSubject, ConferenceInfoModel); +DEFINE_GETTER(QString, getDescription, ConferenceInfoModel); +DEFINE_GETTER(QString, displayNamesToString, ConferenceInfoModel); +DEFINE_GETTER(QString, getUri, ConferenceInfoModel); +DEFINE_GETTER(bool, isScheduled, ConferenceInfoModel); +DEFINE_GETTER(int, getInviteMode, ConferenceInfoModel); +DEFINE_GETTER(int, getParticipantCount, ConferenceInfoModel); +DEFINE_GETTER(int, getAllParticipantCount, ConferenceInfoModel); +DEFINE_GETTER(TimeZoneModel*, getTimeZoneModel, ConferenceInfoModel); +DEFINE_GETTER(QVariantList, getParticipants, ConferenceInfoModel); +DEFINE_GETTER(QVariantList, getAllParticipants, ConferenceInfoModel); +DEFINE_GETTER(QString, getIcalendarString, ConferenceInfoModel); +DEFINE_GETTER(LinphoneEnums::ConferenceInfoState, getConferenceInfoState, ConferenceInfoModel); +DEFINE_GETTER(LinphoneEnums::ConferenceSchedulerState, getConferenceSchedulerState, ConferenceInfoModel); + diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.hpp new file mode 100644 index 000000000..d77eae3eb --- /dev/null +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModelGUI.hpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2023 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#ifndef CONFERENCE_INFO_MODEL_GUI_H_ +#define CONFERENCE_INFO_MODEL_GUI_H_ + +#include +#include +#include +#include +#include + +#include "utils/LinphoneEnums.hpp" +#include "ConferenceInfoModel.hpp" + +#include "utils/CodeHelpersGUI.hpp" +#include "components/other/timeZone/TimeZoneModel.hpp" // Note : didn't used by SDK, should be ok to used from GUI + +#include "components/participant/ParticipantListModelGUI.hpp" + +class ConferenceScheduler; + +class ConferenceInfoModelGUI : public QObject { + Q_OBJECT + +public: + Q_PROPERTY(TimeZoneModel * timeZoneModel READ getTimeZoneModel WRITE setTimeZoneModel NOTIFY timeZoneModelChanged) + Q_PROPERTY(QDateTime dateTime READ getDateTimeSystem WRITE setDateTime NOTIFY dateTimeChanged) + Q_PROPERTY(QDateTime dateTimeUtc READ getDateTimeUtc NOTIFY dateTimeChanged) + Q_PROPERTY(int duration READ getDuration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(QDateTime endDateTime READ getEndDateTime NOTIFY dateTimeChanged) + Q_PROPERTY(QString organizer READ getOrganizer WRITE setOrganizer NOTIFY organizerChanged) + Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged) + Q_PROPERTY(QString description READ getDescription WRITE setDescription NOTIFY descriptionChanged) + Q_PROPERTY(QString displayNamesToString READ displayNamesToString NOTIFY participantsChanged) + Q_PROPERTY(QString uri READ getUri NOTIFY uriChanged) + Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged) + Q_PROPERTY(int inviteMode READ getInviteMode WRITE setInviteMode NOTIFY inviteModeChanged) + Q_PROPERTY(int participantCount READ getParticipantCount NOTIFY participantsChanged) + Q_PROPERTY(int allParticipantCount READ getAllParticipantCount NOTIFY participantsChanged) + Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged) + Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState conferenceSchedulerState READ getConferenceSchedulerState NOTIFY conferenceSchedulerStateChanged) + + ConferenceInfoModelGUI(QObject * parent = nullptr); + ConferenceInfoModelGUI (ConferenceInfoModel * appModel, QObject * parent = nullptr); + ~ConferenceInfoModelGUI (); +//------------------------------- + + QDateTime getDateTimeUtc() const; + QDateTime getDateTimeSystem() const; + int getDuration() const; + QDateTime getEndDateTime() const; + QString getOrganizer() const; + QString getSubject() const; + QString getDescription() const; + Q_INVOKABLE QString displayNamesToString()const; + QString getUri() const; + bool isScheduled() const; + int getInviteMode() const; + + Q_INVOKABLE int getParticipantCount()const; + Q_INVOKABLE int getAllParticipantCount()const; + Q_INVOKABLE TimeZoneModel* getTimeZoneModel() const; + + Q_INVOKABLE QVariantList getParticipants() const; + Q_INVOKABLE QVariantList getAllParticipants() const; + Q_INVOKABLE QString getIcalendarString() const; + + LinphoneEnums::ConferenceInfoState getConferenceInfoState() const; + LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const; + +signals: + + void setDateTime(const QDateTime& dateTime); + void setDuration(const int& duration); + void setSubject(const QString& subject); + void setOrganizer(const QString& organizerAddress); + void setDescription(const QString& description); + void setIsScheduled(const bool& on); + void setInviteMode(const int& modes); + + Q_INVOKABLE void setParticipants(ParticipantListModelGUI * participants); + Q_INVOKABLE void setTimeZoneModel(TimeZoneModel * model); + +// Tools + Q_INVOKABLE void resetConferenceInfo();// Recreate a new conference info from factory + Q_INVOKABLE void createConference(const int& securityLevel); + Q_INVOKABLE void cancelConference(); + Q_INVOKABLE void deleteConferenceInfo();// Remove completly this conference info from DB + + + void timeZoneModelChanged(); + void dateTimeChanged(); + void durationChanged(); + void organizerChanged(); + void subjectChanged(); + void descriptionChanged(); + void participantsChanged(); + void uriChanged(); + void isScheduledChanged(); + void inviteModeChanged(); + void conferenceInfoStateChanged(); + void conferenceSchedulerStateChanged(); + + void conferenceCreated(); + void conferenceCreationFailed(); + void conferenceInfoChanged(); + void invitationsSent(); + void removed(bool byUser); + +// Sync + DECLARE_SYNC_SIGNAL(QDateTime, getDateTimeUtc) + DECLARE_SYNC_SIGNAL(QDateTime, getDateTimeSystem) + DECLARE_SYNC_SIGNAL(int, getDuration) + DECLARE_SYNC_SIGNAL(QDateTime, getEndDateTime) + DECLARE_SYNC_SIGNAL(QString, getOrganizer) + DECLARE_SYNC_SIGNAL(QString, getSubject) + DECLARE_SYNC_SIGNAL(QString, getDescription) + DECLARE_SYNC_SIGNAL(QString, displayNamesToString) + DECLARE_SYNC_SIGNAL(QString, getUri) + DECLARE_SYNC_SIGNAL(QString, getIcalendarString); + DECLARE_SYNC_SIGNAL(bool, isScheduled) + DECLARE_SYNC_SIGNAL(int, getInviteMode) + DECLARE_SYNC_SIGNAL(QVariantList, getParticipants); + DECLARE_SYNC_SIGNAL(QVariantList, getAllParticipants); + DECLARE_SYNC_SIGNAL(LinphoneEnums::ConferenceInfoState, getConferenceInfoState) + DECLARE_SYNC_SIGNAL(LinphoneEnums::ConferenceSchedulerState, getConferenceSchedulerState) + DECLARE_SYNC_SIGNAL(int, getParticipantCount) + DECLARE_SYNC_SIGNAL(int, getAllParticipantCount) + DECLARE_SYNC_SIGNAL(TimeZoneModel*, getTimeZoneModel) + +}; + +Q_DECLARE_METATYPE(ConferenceInfoModelGUI*) + +#endif diff --git a/linphone-app/src/components/contact/ContactModelGUI.cpp b/linphone-app/src/components/contact/ContactModelGUI.cpp new file mode 100644 index 000000000..f117aaa0e --- /dev/null +++ b/linphone-app/src/components/contact/ContactModelGUI.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#include + +#include "app/App.hpp" + +#include "ContactModelGUI.hpp" +#include "ContactModel.hpp" +#include "VcardModel.hpp" + +// ============================================================================= + +using namespace std; + +ContactModelGUI::ContactModelGUI (ContactModel * appModel, QObject * parent) : QObject(parent) { +// Signals + CONNECT_CORE_TO_GUI(contactUpdated, ContactModel); + CONNECT_CORE_TO_GUI(presenceStatusChanged, ContactModel); + CONNECT_CORE_TO_GUI(presenceLevelChanged, ContactModel); + CONNECT_CORE_TO_GUI(sipAddressAdded, ContactModel); + CONNECT_CORE_TO_GUI(sipAddressRemoved, ContactModel); + +// Setters/tools + CONNECT_GUI_TO_CORE(setDefaultAccount, ContactModel); + +} + + +ContactModelGUI::~ContactModelGUI(){ +} diff --git a/linphone-app/src/components/contact/ContactModelGUI.hpp b/linphone-app/src/components/contact/ContactModelGUI.hpp new file mode 100644 index 000000000..e30a6db8f --- /dev/null +++ b/linphone-app/src/components/contact/ContactModelGUI.hpp @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#ifndef CONTACT_MODEL_GUI_H_ +#define CONTACT_MODEL_GUI_H_ + +#include "components/presence/Presence.hpp" +#include "utils/LinphoneEnums.hpp" + +#include + +#include "utils/CodeHelpersGUI.hpp" +// ============================================================================= + +class ContactModel; +class VcardModelGUI; + +class ContactModelGUI : public QObject { + Q_OBJECT + + Q_PROPERTY(Presence::PresenceStatus presenceStatus READ getPresenceStatus NOTIFY presenceStatusChanged) + Q_PROPERTY(Presence::PresenceLevel presenceLevel READ getPresenceLevel NOTIFY presenceLevelChanged) + Q_PROPERTY(VcardModelGUI * vcard READ getVcardModel WRITE setVcardModel NOTIFY contactUpdated) + +public: + ContactModelGUI (ContactModel * appModel, QObject * parent = nullptr); + virtual ~ContactModelGUI(); + + VcardModelGUI *getVcardModel () const; + void setVcardModel (VcardModelGUI *vcardModel); + + Q_INVOKABLE VcardModelGUI *cloneVcardModel () const; + Presence::PresenceLevel getPresenceLevel () const; + Q_INVOKABLE bool hasCapability(const LinphoneEnums::FriendCapability& capability); + +signals: + void contactUpdated (); + void presenceStatusChanged (Presence::PresenceStatus status); + void presenceLevelChanged (Presence::PresenceLevel level); + void sipAddressAdded (const QString &sipAddress); + void sipAddressRemoved (const QString &sipAddress); + +// Sync + DECLARE_SYNC_SIGNAL(Presence::PresenceLevel, getPresenceLevel) + +private: + Presence::PresenceStatus getPresenceStatus () const; + +}; + +Q_DECLARE_METATYPE(ContactModelGUI *); + +#endif // CONTACT_MODEL_GUI_H_ diff --git a/linphone-app/src/components/contact/VcardModel.cpp b/linphone-app/src/components/contact/VcardModel.cpp index f807d756e..dffef6453 100644 --- a/linphone-app/src/components/contact/VcardModel.cpp +++ b/linphone-app/src/components/contact/VcardModel.cpp @@ -98,7 +98,10 @@ VcardModel::VcardModel (shared_ptr vcard, bool isReadOnly) : QO mIsReadOnly = isReadOnly; } -VcardModel::~VcardModel () { + +DEFINE_THREADED_DESCTRUCTOR(VcardModel) + +void VcardModel::destruction(){ if (!mIsReadOnly) { qInfo() << QStringLiteral("Destroy detached vcard:") << this; if (!mAvatarIsReadOnly) diff --git a/linphone-app/src/components/contact/VcardModel.hpp b/linphone-app/src/components/contact/VcardModel.hpp index b4828ee38..3f4e66fda 100644 --- a/linphone-app/src/components/contact/VcardModel.hpp +++ b/linphone-app/src/components/contact/VcardModel.hpp @@ -25,6 +25,7 @@ #include +#include "utils/CodeHelpersGUI.hpp" // ============================================================================= namespace linphone { @@ -102,8 +103,11 @@ public: QString encode(const QString& data)const;// Convert '\n', ',', '\' to "\n", "\,", "\\" QString decode(const QString& data)const;// Convert "\n", "\,", "\\" to '\n', ',', '\' + void destruction(); signals: void vcardUpdated (); + void requestDestruction(); + DECLARE_THREADED_DESTRUCTOR_SIGNAL() // --------------------------------------------------------------------------- diff --git a/linphone-app/src/components/contact/VcardModelGUI.cpp b/linphone-app/src/components/contact/VcardModelGUI.cpp new file mode 100644 index 000000000..785941a33 --- /dev/null +++ b/linphone-app/src/components/contact/VcardModelGUI.cpp @@ -0,0 +1,533 @@ +/* + * Copyright (c) 2010-2020 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#include +#include +#include +#include + +#include "app/App.hpp" +#include "app/paths/Paths.hpp" +#include "app/providers/AvatarProvider.hpp" +#include "components/core/CoreManager.hpp" +#include "components/sip-addresses/SipAddressesModel.hpp" +#include "utils/Utils.hpp" +#include "utils/Constants.hpp" + +#include "VcardModel.hpp" + +// ============================================================================= + +using namespace std; + +#define CHECK_VCARD_IS_WRITABLE(VCARD) Q_ASSERT(VCARD->mIsReadOnly == false) + +template +static inline shared_ptr findBelCardValue (const list> &list, const string &value) { + auto it = find_if(list.cbegin(), list.cend(), [&value](const shared_ptr &entry) { + return value == entry->getValue(); + }); + return it != list.cend() ? *it : nullptr; +} + +template +static inline shared_ptr findBelCardValue (const list> &list, const QString &value) { + return findBelCardValue(list, value.toStdString()); +} + +static inline bool isLinphoneDesktopPhoto (const shared_ptr &photo) { + return !photo->getValue().compare(0, sizeof(Constants::VcardScheme) - 1, Constants::VcardScheme); +} + +static shared_ptr findBelcardPhoto (const shared_ptr &belcard) { + const list> &photos = belcard->getPhotos(); + auto it = find_if(photos.cbegin(), photos.cend(), isLinphoneDesktopPhoto); + if (it != photos.cend()) + return *it; + + return nullptr; +} + +static void removeBelcardPhoto (const shared_ptr &belcard, bool cleanPathsOnly = false) { + list> photos; + for (const auto photo : belcard->getPhotos()) { + if (isLinphoneDesktopPhoto(photo)) + photos.push_back(photo); + } + + for (const auto photo : photos) { + QString imagePath( + QString::fromStdString( + Paths::getAvatarsDirPath() + photo->getValue().substr(sizeof(Constants::VcardScheme) - 1) + ) + ); + + if (!cleanPathsOnly) { + if (!QFile::remove(imagePath)) + qWarning() << QStringLiteral("Unable to remove `%1`.").arg(imagePath); + else + qInfo() << QStringLiteral("Remove `%1`.").arg(imagePath); + } + + belcard->removePhoto(photo); + } +} + +// ----------------------------------------------------------------------------- + +VcardModelGUI::VcardModelGUI (VcardModel * appModel, bool isReadOnly) : QObject(nullptr) { + appModel->setParent(this); + mVcardModel = appModel; + mIsReadOnly = isReadOnly; +} + +VcardModel::~VcardModel () { + + + if(mVcardModel->parent() == this){ + + } + if (!mIsReadOnly) { + qInfo() << QStringLiteral("Destroy detached vcard:") << this; + if (!mAvatarIsReadOnly) + removeBelcardPhoto(mVcard->getVcard()); + } else + qInfo() << QStringLiteral("Destroy attached vcard:") << this; +} + +// ----------------------------------------------------------------------------- + +QString VcardModel::getAvatar () const { + // Find desktop avatar. + shared_ptr photo = findBelcardPhoto(mVcard->getVcard()); + + // No path found. + if (!photo) + return QString(""); + + // Returns right path. + return QStringLiteral("image://%1/%2").arg(AvatarProvider::ProviderId).arg( + QString::fromStdString(photo->getValue().substr(sizeof(Constants::VcardScheme) - 1)) + ); +} + +static inline QString getFileIdFromAppPath (const QString &path) { + const static QString appPrefix = QStringLiteral("image://%1/").arg(AvatarProvider::ProviderId); + return path.mid(appPrefix.length()); +} + +bool VcardModel::setAvatar (const QString &path) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + QString fileId; + QFile file; + + // 1. Try to copy photo in avatars folder if it's a right path file and + // not an application path like `image:`. + if (!path.isEmpty()) { + if (path.startsWith("image:")) + fileId = getFileIdFromAppPath(path); + else { + file.setFileName(path); + + if (!file.exists() || QImageReader::imageFormat(path).size() == 0) + return false; + + QFileInfo info(file); + QString uuid = QUuid::createUuid().toString(); + fileId = QStringLiteral("%1.%2") + .arg(uuid.mid(1, uuid.length() - 2)) // Remove `{}`. + .arg(info.suffix()); + + QString dest = QString::fromStdString(Paths::getAvatarsDirPath()) + fileId; + + if (!file.copy(dest)) + return false; + + qInfo() << QStringLiteral("Update avatar of `%1`. (path=%2)").arg(getUsername()).arg(dest); + } + } + + // 2. Remove oldest photo. + removeBelcardPhoto(belcard, mAvatarIsReadOnly); + mAvatarIsReadOnly = false; + + // 3. Update new photo. + if (!path.isEmpty()) { + shared_ptr photo = belcard::BelCardGeneric::create(); + photo->setValue(Constants::VcardScheme + fileId.toStdString()); + + if (!belcard->addPhoto(photo)) { + file.remove(); + return false; + } + } + + emit vcardUpdated(); + + return true; +} + +// ----------------------------------------------------------------------------- + +QString VcardModel::getUsername () const { + return decode(QString::fromStdString(mVcard->getFullName()));// Is in UTF8 +} + +void VcardModel::setUsername (const QString &username) { + CHECK_VCARD_IS_WRITABLE(this); + + if (username.length() == 0 || username == getUsername()) + return; + + mVcard->setFullName(encode(username).toStdString()); + emit vcardUpdated(); +} + +// ----------------------------------------------------------------------------- + +static inline shared_ptr getOrCreateBelCardAddress (shared_ptr belcard) { + list> addresses = belcard->getAddresses(); + shared_ptr address; + + if (addresses.empty()) { + address = belcard::BelCardGeneric::create(); + if (!belcard->addAddress(address)) + qWarning() << "Unable to create a new address on vcard."; + } else + address = addresses.front(); + + return address; +} + +QVariantMap VcardModel::getAddress () const { + list> addresses = mVcard->getVcard()->getAddresses(); + QVariantMap map; + + if (addresses.empty()) + return map; + + shared_ptr address = addresses.front(); + map["street"] = QString::fromStdString(address->getStreet()); + map["locality"] = QString::fromStdString(address->getLocality()); + map["postalCode"] = QString::fromStdString(address->getPostalCode()); + map["country"] = QString::fromStdString(address->getCountry()); + + return map; +} + +void VcardModel::setStreet (const QString &street) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr address = getOrCreateBelCardAddress(mVcard->getVcard()); + address->setStreet(street.toStdString()); + emit vcardUpdated(); +} + +void VcardModel::setLocality (const QString &locality) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr address = getOrCreateBelCardAddress(mVcard->getVcard()); + address->setLocality(locality.toStdString()); + emit vcardUpdated(); +} + +void VcardModel::setPostalCode (const QString &postalCode) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr address = getOrCreateBelCardAddress(mVcard->getVcard()); + address->setPostalCode(postalCode.toStdString()); + emit vcardUpdated(); +} + +void VcardModel::setCountry (const QString &country) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr address = getOrCreateBelCardAddress(mVcard->getVcard()); + address->setCountry(country.toStdString()); + emit vcardUpdated(); +} + +// ----------------------------------------------------------------------------- + +QVariantList VcardModel::getSipAddresses () const { + QVariantList list; + if(mVcard->getVcard()){ + shared_ptr core = CoreManager::getInstance()->getCore(); + for (const auto &address : mVcard->getVcard()->getImpp()) { + string value = address->getValue(); + shared_ptr linphoneAddress = core->createAddress(value); + + if (linphoneAddress) + list << Utils::coreStringToAppString(linphoneAddress->asStringUriOnly()); + else + qWarning() << QStringLiteral("Unable to parse sip address: `%1`") + .arg(QString::fromStdString(value)); + } + + } + return list; +} + +bool VcardModel::addSipAddress (const QString &sipAddress) { + CHECK_VCARD_IS_WRITABLE(this); + + string interpretedSipAddress = SipAddressesModel::interpretSipAddress(sipAddress).toStdString(); + if (interpretedSipAddress.empty()) + return false; + + // Add sip address in belcard. + shared_ptr belcard = mVcard->getVcard(); + if (findBelCardValue(belcard->getImpp(), interpretedSipAddress)) + return false; + + shared_ptr value = belcard::BelCardGeneric::create(); + value->setValue(interpretedSipAddress); + + if (!belcard->addImpp(value)) { + qWarning() << QStringLiteral("Unable to add sip address on vcard: `%1`.").arg(sipAddress); + return false; + } + + qInfo() << QStringLiteral("Add new sip address on vcard: `%1` from `%2`.").arg(QString::fromStdString(interpretedSipAddress)).arg(sipAddress); + + emit vcardUpdated(); + return true; +} + +void VcardModel::removeSipAddress (const QString &sipAddress) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + list> addresses = belcard->getImpp(); + shared_ptr value = findBelCardValue( + addresses, SipAddressesModel::interpretSipAddress(sipAddress).toStdString() + ); + + if (!value) { + qWarning() << QStringLiteral("Unable to remove sip address on vcard: `%1`.").arg(sipAddress); + return; + } + + if (addresses.size() == 1) { + qWarning() << QStringLiteral("Unable to remove the only existing sip address on vcard: `%1`.") + .arg(sipAddress); + return; + } + + qInfo() << QStringLiteral("Remove sip address on vcard: `%1`.").arg(sipAddress); + belcard->removeImpp(value); + + emit vcardUpdated(); +} + +bool VcardModel::updateSipAddress (const QString &oldSipAddress, const QString &sipAddress) { + bool soFarSoGood = addSipAddress(sipAddress); + removeSipAddress(oldSipAddress); // Remove after. Avoid `Unable to remove the only sip address...` error. + return soFarSoGood; +} + +// ----------------------------------------------------------------------------- + +QVariantList VcardModel::getCompanies () const { + QVariantList list; + + for (const auto &company : mVcard->getVcard()->getRoles()) + list.append(QString::fromStdString(company->getValue())); + + return list; +} + +bool VcardModel::addCompany (const QString &company) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + if (findBelCardValue(belcard->getRoles(), company)) + return false; + + shared_ptr value = belcard::BelCardGeneric::create(); + value->setValue(company.toStdString()); + + if (!belcard->addRole(value)) { + qWarning() << QStringLiteral("Unable to add company on vcard: `%1`.").arg(company); + return false; + } + + qInfo() << QStringLiteral("Add new company on vcard: `%1`.").arg(company); + + emit vcardUpdated(); + return true; +} + +void VcardModel::removeCompany (const QString &company) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + shared_ptr value = findBelCardValue(belcard->getRoles(), company); + + if (!value) { + qWarning() << QStringLiteral("Unable to remove company on vcard: `%1`.").arg(company); + return; + } + + qInfo() << QStringLiteral("Remove company on vcard: `%1`.").arg(company); + belcard->removeRole(value); + + emit vcardUpdated(); +} + +bool VcardModel::updateCompany (const QString &oldCompany, const QString &company) { + removeCompany(oldCompany); + return addCompany(company); +} + +// ----------------------------------------------------------------------------- + +QVariantList VcardModel::getEmails () const { + QVariantList list; + + for (const auto &email : mVcard->getVcard()->getEmails()) + list.append(QString::fromStdString(email->getValue())); + + return list; +} + +bool VcardModel::addEmail (const QString &email) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + if (findBelCardValue(belcard->getEmails(), email)) + return false; + + shared_ptr value = belcard::BelCardGeneric::create(); + value->setValue(email.toStdString()); + + if (!belcard->addEmail(value)) { + qWarning() << QStringLiteral("Unable to add email on vcard: `%1`.").arg(email); + return false; + } + + qInfo() << QStringLiteral("Add new email on vcard: `%1`.").arg(email); + + emit vcardUpdated(); + + return true; +} + +void VcardModel::removeEmail (const QString &email) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + shared_ptr value = findBelCardValue(belcard->getEmails(), email); + + if (!value) { + qWarning() << QStringLiteral("Unable to remove email on vcard: `%1`.").arg(email); + return; + } + + qInfo() << QStringLiteral("Remove email on vcard: `%1`.").arg(email); + belcard->removeEmail(value); + + emit vcardUpdated(); +} + +bool VcardModel::updateEmail (const QString &oldEmail, const QString &email) { + removeEmail(oldEmail); + return addEmail(email); +} + +// ----------------------------------------------------------------------------- + +QVariantList VcardModel::getUrls () const { + QVariantList list; + + for (const auto &url : mVcard->getVcard()->getURLs()) + list.append(QString::fromStdString(url->getValue())); + + return list; +} + +bool VcardModel::addUrl (QString url) { + CHECK_VCARD_IS_WRITABLE(this); + QUrl urlParser(url); + if( urlParser.scheme() == ""){ + url = "https://"+url; + } + shared_ptr belcard = mVcard->getVcard(); + if (findBelCardValue(belcard->getURLs(), url)) + return false; + + shared_ptr value = belcard::BelCardGeneric::create(); + value->setValue(url.toStdString()); + + if (!belcard->addURL(value)) { + qWarning() << QStringLiteral("Unable to add url on vcard: `%1`.").arg(url); + return false; + } + + qInfo() << QStringLiteral("Add new url on vcard: `%1`.").arg(url); + + emit vcardUpdated(); + + return true; +} + +void VcardModel::removeUrl (const QString &url) { + CHECK_VCARD_IS_WRITABLE(this); + + shared_ptr belcard = mVcard->getVcard(); + shared_ptr value = findBelCardValue(belcard->getURLs(), url); + + if (!value) { + qWarning() << QStringLiteral("Unable to remove url on vcard: `%1`.").arg(url); + return; + } + + qInfo() << QStringLiteral("Remove url on vcard: `%1`.").arg(url); + belcard->removeURL(value); + + emit vcardUpdated(); +} + +bool VcardModel::updateUrl (const QString &oldUrl, const QString &url) { + removeUrl(oldUrl); + return addUrl(url); +} + +QString VcardModel::encode(const QString& data)const{// Convert '\n', ',', '\' to "\n", "\,", "\\" + QString encoded; + for(int i = 0 ; i < data.length() ; ++i){ + if(data[i] == ',') + encoded += "\\,"; + else if(data[i] == '\\') + encoded += "\\\\"; + else if(data[i] == '\n') + encoded += "\\n"; + else + encoded += data[i]; + } + return encoded; +} +QString VcardModel::decode(const QString& data)const{// Convert "\n", "\,", "\\" to '\n', ',', '\' + QString decoded = data; + decoded.replace("\\,", ",").replace("\\\\", "\\").replace("\\n", "\n"); + return decoded; +} diff --git a/linphone-app/src/components/contact/VcardModelGUI.hpp b/linphone-app/src/components/contact/VcardModelGUI.hpp new file mode 100644 index 000000000..44daa3c00 --- /dev/null +++ b/linphone-app/src/components/contact/VcardModelGUI.hpp @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of linphone-desktop + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 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 . + */ + +#ifndef VCARD_MODEL_GUI_H_ +#define VCARD_MODEL_GUI_H_ + +#include + +#include + +#include "utils/CodeHelpersGUI.hpp" + +// ============================================================================= + +namespace linphone { + class Vcard; +} +class VcardModel; + +class VcardModelGUI : public QObject { + Q_OBJECT + + Q_PROPERTY(QString username READ getUsername WRITE setUsername NOTIFY vcardUpdated); + Q_PROPERTY(QString avatar READ getAvatar WRITE setAvatar NOTIFY vcardUpdated); + Q_PROPERTY(QVariantMap address READ getAddress NOTIFY vcardUpdated); + //Q_PROPERTY(QString sipAddress + Q_PROPERTY(QVariantList sipAddresses READ getSipAddresses NOTIFY vcardUpdated); + Q_PROPERTY(QVariantList companies READ getCompanies NOTIFY vcardUpdated); + Q_PROPERTY(QVariantList emails READ getEmails NOTIFY vcardUpdated); + Q_PROPERTY(QVariantList urls READ getUrls NOTIFY vcardUpdated); + + // --------------------------------------------------------------------------- + +public: + VcardModelGUI (VcardModel* model, bool isReadOnly = true); + + ~VcardModelGUI (); + + // --------------------------------------------------------------------------- + + bool getIsReadOnly () const { + return mIsReadOnly; + } + + // --------------------------------------------------------------------------- + + QString getAvatar () const; + bool setAvatar (const QString &path); + + QString getUsername () const; + void setUsername (const QString &username); + + // --------------------------------------------------------------------------- + + QVariantList getSipAddresses () const; + QVariantMap getAddress () const; + QVariantList getEmails () const; + QVariantList getCompanies () const; + QVariantList getUrls () const; + + // --------------------------------------------------------------------------- + + Q_INVOKABLE bool addSipAddress (const QString &sipAddress); + Q_INVOKABLE void removeSipAddress (const QString &sipAddress); + Q_INVOKABLE bool updateSipAddress (const QString &oldSipAddress, const QString &sipAddress); + + Q_INVOKABLE bool addCompany (const QString &company); + Q_INVOKABLE void removeCompany (const QString &company); + Q_INVOKABLE bool updateCompany (const QString &oldCompany, const QString &company); + + Q_INVOKABLE bool addEmail (const QString &email); + Q_INVOKABLE void removeEmail (const QString &email); + Q_INVOKABLE bool updateEmail (const QString &oldEmail, const QString &email); + + Q_INVOKABLE bool addUrl (QString url); + Q_INVOKABLE void removeUrl (const QString &url); + Q_INVOKABLE bool updateUrl (const QString &oldUrl, const QString &url); + + Q_INVOKABLE void setStreet (const QString &street); + Q_INVOKABLE void setLocality (const QString &locality); + Q_INVOKABLE void setPostalCode (const QString &postalCode); + Q_INVOKABLE void setCountry (const QString &country); + + // --------------------------------------------------------------------------- + + QString encode(const QString& data)const;// Convert '\n', ',', '\' to "\n", "\,", "\\" + QString decode(const QString& data)const;// Convert "\n", "\,", "\\" to '\n', ',', '\' + +signals: + void vcardUpdated (); + + // --------------------------------------------------------------------------- + +private: + bool mIsReadOnly = true; + bool mAvatarIsReadOnly = true; + + VcardModel * mVcardModel = nullptr; +}; + +Q_DECLARE_METATYPE(VcardModel *); + +#endif // VCARD_MODEL_H_ diff --git a/linphone-app/src/components/participant/ParticipantListModel.cpp b/linphone-app/src/components/participant/ParticipantListModel.cpp index 61886f646..a8b5f887b 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantListModel.cpp @@ -356,7 +356,7 @@ void ParticipantListModel::onStateChanged(){ // SYNC SLOTS //------------------------------------------------------------- -DECLARE_SYNC_BODY_SLOT_CONST(ChatRoomModelGUI*, getChatRoomModelGUI, ParticipantListModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, addressesToString, ParticipantListModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, displayNamesToString, ParticipantListModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, usernamesToString, ParticipantListModel) +DEFINE_SYNC_BODY_SLOT_CONST(ChatRoomModelGUI*, getChatRoomModelGUI, ParticipantListModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, addressesToString, ParticipantListModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, displayNamesToString, ParticipantListModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, usernamesToString, ParticipantListModel) diff --git a/linphone-app/src/components/participant/ParticipantListModel.hpp b/linphone-app/src/components/participant/ParticipantListModel.hpp index 975ac43c8..85a5f0ab3 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.hpp +++ b/linphone-app/src/components/participant/ParticipantListModel.hpp @@ -57,9 +57,9 @@ public: ConferenceModel* getConferenceModel() const; std::list> getParticipants()const; - Q_INVOKABLE QString addressesToString()const; - Q_INVOKABLE QString displayNamesToString()const; - Q_INVOKABLE QString usernamesToString()const; + QString addressesToString()const; + QString displayNamesToString()const; + QString usernamesToString()const; bool contains(const QString& address) const; diff --git a/linphone-app/src/components/participant/ParticipantListModelGUI.cpp b/linphone-app/src/components/participant/ParticipantListModelGUI.cpp index 3074a3ba9..c935ef72b 100644 --- a/linphone-app/src/components/participant/ParticipantListModelGUI.cpp +++ b/linphone-app/src/components/participant/ParticipantListModelGUI.cpp @@ -28,7 +28,8 @@ // ============================================================================= ParticipantListModelGUI::ParticipantListModelGUI(QSharedPointer participantListModel, QObject * parent) : ProxyListModel(parent){ - auto appModel = participantListModel.get(); + mParticipantListModel = participantListModel; + auto appModel = mParticipantListModel.get(); // signals CONNECT_CORE_TO_GUI(securityLevelChanged, ParticipantListModel); CONNECT_CORE_TO_GUI(deviceSecurityLevelChanged, ParticipantListModel); @@ -47,9 +48,12 @@ ParticipantListModelGUI::ParticipantListModelGUI(QSharedPointer ParticipantListModelGUI::getParticipantListModel()const{ + return mParticipantListModel; +} -DECLARE_GETTER(ChatRoomModelGUI*, getChatRoomModelGUI, ParticipantListModel) -DECLARE_GETTER(QString, addressesToString, ParticipantListModel) -DECLARE_GETTER(QString, displayNamesToString, ParticipantListModel) -DECLARE_GETTER(QString, usernamesToString, ParticipantListModel) +DEFINE_GETTER(ChatRoomModelGUI*, getChatRoomModelGUI, ParticipantListModel) +DEFINE_GETTER(QString, addressesToString, ParticipantListModel) +DEFINE_GETTER(QString, displayNamesToString, ParticipantListModel) +DEFINE_GETTER(QString, usernamesToString, ParticipantListModel) diff --git a/linphone-app/src/components/participant/ParticipantListModelGUI.hpp b/linphone-app/src/components/participant/ParticipantListModelGUI.hpp index 8a4b9abcc..12a41266b 100644 --- a/linphone-app/src/components/participant/ParticipantListModelGUI.hpp +++ b/linphone-app/src/components/participant/ParticipantListModelGUI.hpp @@ -23,12 +23,12 @@ #include #include "components/participant/ParticipantModel.hpp" -#include "components/chat-room/ChatRoomModel.hpp" #include "app/proxyModel/ProxyListModel.hpp" #include "utils/CodeHelpersGUI.hpp" class ConferenceModel; +class ParticipantListModel; #include "components/chat-room/ChatRoomModelGUI.hpp" @@ -55,6 +55,10 @@ public: Q_INVOKABLE QString addressesToString()const; Q_INVOKABLE QString displayNamesToString()const; Q_INVOKABLE QString usernamesToString()const; + + QSharedPointer getParticipantListModel()const; + + QSharedPointer mParticipantListModel; signals: Q_INVOKABLE void remove (ParticipantModel *importer); diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 32e3e2d08..5a4d24a0e 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -575,14 +575,14 @@ void AccountSettingsModel::handleRegistrationStateChanged ( // SYNC SLOTS //------------------------------------------------------------- -DECLARE_SYNC_BODY_SLOT_CONST(QString, getUsedSipAddressAsStringUriOnly, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getUsedSipAddressAsString, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getUsedSipAddressAsStringUriOnly, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getUsedSipAddressAsString, AccountSettingsModel) void AccountSettingsModel::getAccountDescriptionSlot(QVariantMap* result, const std::shared_ptr &account) const{ *result = getAccountDescription(account); } -DECLARE_SYNC_BODY_SLOT_CONST(QString, getConferenceUri, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getVideoConferenceUri, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLimeServerUrl, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getConferenceUri, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getVideoConferenceUri, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLimeServerUrl, AccountSettingsModel) void AccountSettingsModel::addOrUpdateAccountSlot (bool * result, const std::shared_ptr &account, const QVariantMap &data){ *result = addOrUpdateAccount(account, data); } @@ -592,10 +592,10 @@ void AccountSettingsModel::addOrUpdateAccountSlot (bool * result, const QVariant void AccountSettingsModel::createAccountSlot(std::shared_ptr * result, const QString& assistantFile){ *result = createAccount(assistantFile); } -DECLARE_SYNC_BODY_SLOT_CONST(QString, getPrimaryUsername, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getPrimaryDisplayName, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getPrimarySipAddress, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getUsername, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getDefaultAccountDomain, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QVariantList, getAccounts, AccountSettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(RegistrationState, getRegistrationState, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getPrimaryUsername, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getPrimaryDisplayName, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getPrimarySipAddress, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getUsername, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getDefaultAccountDomain, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QVariantList, getAccounts, AccountSettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(RegistrationState, getRegistrationState, AccountSettingsModel) diff --git a/linphone-app/src/components/settings/AccountSettingsModelGUI.cpp b/linphone-app/src/components/settings/AccountSettingsModelGUI.cpp index 5ffe08137..f6e0188fe 100644 --- a/linphone-app/src/components/settings/AccountSettingsModelGUI.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModelGUI.cpp @@ -79,16 +79,16 @@ AccountSettingsModelGUI::AccountSettingsModelGUI(QObject * parent) : QObject(par AccountSettingsModelGUI::~AccountSettingsModelGUI(){ } -DECLARE_GETTER(QString, getUsedSipAddressAsStringUriOnly, AccountSettingsModel) -DECLARE_GETTER(QString, getUsedSipAddressAsString, AccountSettingsModel) +DEFINE_GETTER(QString, getUsedSipAddressAsStringUriOnly, AccountSettingsModel) +DEFINE_GETTER(QString, getUsedSipAddressAsString, AccountSettingsModel) QVariantMap AccountSettingsModelGUI::getAccountDescription(const std::shared_ptr &account){ QVariantMap result; emit getAccountDescriptionSync(&result, account); return result; } -DECLARE_GETTER(QString, getConferenceUri, AccountSettingsModel) -DECLARE_GETTER(QString, getVideoConferenceUri, AccountSettingsModel) -DECLARE_GETTER(QString, getLimeServerUrl, AccountSettingsModel) +DEFINE_GETTER(QString, getConferenceUri, AccountSettingsModel) +DEFINE_GETTER(QString, getVideoConferenceUri, AccountSettingsModel) +DEFINE_GETTER(QString, getLimeServerUrl, AccountSettingsModel) bool AccountSettingsModelGUI::addOrUpdateAccount(const std::shared_ptr &account, const QVariantMap &data){ bool result; emit addOrUpdateAccountSync(&result, account, data); @@ -104,13 +104,13 @@ std::shared_ptr AccountSettingsModelGUI::createAccount(const emit createAccountSync(&result, assistantFile); return result; } -DECLARE_GETTER(QString, getPrimaryUsername, AccountSettingsModel) -DECLARE_GETTER(QString, getPrimaryDisplayName, AccountSettingsModel) -DECLARE_GETTER(QString, getPrimarySipAddress, AccountSettingsModel) -DECLARE_GETTER(QString, getUsername, AccountSettingsModel) -DECLARE_GETTER(QString, getDefaultAccountDomain, AccountSettingsModel) -DECLARE_GETTER(QVariantList, getAccounts, AccountSettingsModel) -DECLARE_GETTER_ENUM(RegistrationState, getRegistrationState, AccountSettingsModel) +DEFINE_GETTER(QString, getPrimaryUsername, AccountSettingsModel) +DEFINE_GETTER(QString, getPrimaryDisplayName, AccountSettingsModel) +DEFINE_GETTER(QString, getPrimarySipAddress, AccountSettingsModel) +DEFINE_GETTER(QString, getUsername, AccountSettingsModel) +DEFINE_GETTER(QString, getDefaultAccountDomain, AccountSettingsModel) +DEFINE_GETTER(QVariantList, getAccounts, AccountSettingsModel) +DEFINE_GETTER_ENUM(RegistrationState, getRegistrationState, AccountSettingsModel) /* bool SettingsModelGUI::isCheckForUpdateAvailable(){ diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 3f5e25a02..0711a3874 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -1905,122 +1905,122 @@ std::string SettingsModel::getEntryFullName(const std::string& section, const st //------------------------------------------------------------- -DECLARE_SYNC_BODY_SLOT_CONST(bool, getCreateAppSipAccountEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getFetchRemoteConfigurationEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getUseAppSipAccountEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getUseOtherSipAccountEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getAssistantSupportsPhoneNumbers, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, useWebview, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getAssistantRegistrationUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getAssistantLoginUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getAssistantLogoutUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isCguAccepted, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getDeviceName, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(float, getMicVolume, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(float, getPlaybackGain, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(float, getCaptureGain, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getCaptureGraphRunning, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QStringList, getCaptureDevices, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QStringList, getPlaybackDevices, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getCaptureDevice, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getPlaybackDevice, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getRingerDevice, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getRingPath, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getEchoCancellationEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowAudioCodecs, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QStringList, getVideoDevices, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getVideoDevice, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getVideoPreset, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getVideoFramerate, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QVariantList, getSupportedVideoDefinitions, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QVariantMap, getVideoDefinition, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QVariantMap, getCurrentPreviewVideoDefinition, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getVideoSupported, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowVideoCodecs, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(CameraMode, getGridCameraMode, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(CameraMode, getActiveSpeakerCameraMode, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(CameraMode, getCallCameraMode, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(LinphoneEnums::ConferenceLayout, getVideoConferenceLayout, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getAutoAnswerStatus, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getAutoAnswerVideoStatus, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getAutoAnswerDelay, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowTelKeypadAutomatically, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getKeepCallsWindowInBackground, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getOutgoingCallsEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getCallRecorderEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getAutomaticallyRecordCalls, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getAutoDownloadMaxSize, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getCallPauseEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getMuteMicrophoneEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getStandardChatEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getSecureChatEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getHideEmptyChatRooms, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getWaitRegistrationForCall, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getIncallScreenshotEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getGroupChatEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getConferenceEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getVideoConferenceEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getChatNotificationsEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getChatNotificationSoundEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getChatNotificationSoundPath, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getFileTransferUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getLimeIsSupported, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QVariantList, getSupportedMediaEncryptions, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(MediaEncryption, getMediaEncryption, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, mandatoryMediaEncryptionEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getPostQuantumAvailable, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getLimeState, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getContactsEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowNetworkSettings, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getUseSipInfoForDtmfs, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getUseRfc2833ForDtmfs, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getIpv6Enabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getDownloadBandwidth, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getUploadBandwidth, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getAdaptiveRateControlEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getTcpPort, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getUdpPort, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QList, getAudioPortRange, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QList, getVideoPortRange, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getIceEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getTurnEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getStunServer, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getTurnUser, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getTurnPassword, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getDscpSip, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getDscpAudio, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getDscpVideo, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getRlsUriEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, tunnelAvailable, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(TunnelModel *, getTunnel, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QFont, getTextMessageFont, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getTextMessageFontSize, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QFont, getEmojiFont, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(int, getEmojiFontSize, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getSavedScreenshotsFolder, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getSavedCallsFolder, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getDownloadFolder, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getRemoteProvisioning, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isQRCodeAvailable, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getFlexiAPIUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getExitOnClose, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isCheckForUpdateEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT(QString, getVersionCheckUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(VersionCheckType, getVersionCheckType, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, haveVersionNightlyUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowLocalSipAccount, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowStartChatButton, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getShowStartVideoCallButton, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isMipmapEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, useMinimalTimelineFilter, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLogText, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLogsFolder, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLogsUploadUrl, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getLogsEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(QString, getLogsEmail, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getVfsEncrypted, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isLdapAvailable, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isOAuth2Available, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, isDeveloperSettingsAvailable, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getDeveloperSettingsEnabled, SettingsModel) -DECLARE_SYNC_BODY_SLOT_CONST(bool, getIsInCall, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getCreateAppSipAccountEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getFetchRemoteConfigurationEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getUseAppSipAccountEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getUseOtherSipAccountEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getAssistantSupportsPhoneNumbers, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, useWebview, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getAssistantRegistrationUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getAssistantLoginUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getAssistantLogoutUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isCguAccepted, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getDeviceName, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(float, getMicVolume, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(float, getPlaybackGain, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(float, getCaptureGain, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getCaptureGraphRunning, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QStringList, getCaptureDevices, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QStringList, getPlaybackDevices, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getCaptureDevice, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getPlaybackDevice, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getRingerDevice, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getRingPath, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getEchoCancellationEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowAudioCodecs, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QStringList, getVideoDevices, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getVideoDevice, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getVideoPreset, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getVideoFramerate, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QVariantList, getSupportedVideoDefinitions, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QVariantMap, getVideoDefinition, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QVariantMap, getCurrentPreviewVideoDefinition, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getVideoSupported, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowVideoCodecs, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(CameraMode, getGridCameraMode, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(CameraMode, getActiveSpeakerCameraMode, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(CameraMode, getCallCameraMode, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(LinphoneEnums::ConferenceLayout, getVideoConferenceLayout, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getAutoAnswerStatus, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getAutoAnswerVideoStatus, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getAutoAnswerDelay, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowTelKeypadAutomatically, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getKeepCallsWindowInBackground, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getOutgoingCallsEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getCallRecorderEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getAutomaticallyRecordCalls, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getAutoDownloadMaxSize, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getCallPauseEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getMuteMicrophoneEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getStandardChatEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getSecureChatEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getHideEmptyChatRooms, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getWaitRegistrationForCall, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getIncallScreenshotEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getGroupChatEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getConferenceEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getVideoConferenceEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getChatNotificationsEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getChatNotificationSoundEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getChatNotificationSoundPath, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getFileTransferUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getLimeIsSupported, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QVariantList, getSupportedMediaEncryptions, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(MediaEncryption, getMediaEncryption, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, mandatoryMediaEncryptionEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getPostQuantumAvailable, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getLimeState, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getContactsEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowNetworkSettings, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getUseSipInfoForDtmfs, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getUseRfc2833ForDtmfs, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getIpv6Enabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getDownloadBandwidth, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getUploadBandwidth, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getAdaptiveRateControlEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getTcpPort, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getUdpPort, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QList, getAudioPortRange, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QList, getVideoPortRange, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getIceEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getTurnEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getStunServer, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getTurnUser, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getTurnPassword, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getDscpSip, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getDscpAudio, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getDscpVideo, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getRlsUriEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, tunnelAvailable, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(TunnelModel *, getTunnel, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QFont, getTextMessageFont, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getTextMessageFontSize, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QFont, getEmojiFont, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(int, getEmojiFontSize, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getSavedScreenshotsFolder, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getSavedCallsFolder, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getDownloadFolder, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getRemoteProvisioning, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isQRCodeAvailable, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getFlexiAPIUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getExitOnClose, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isCheckForUpdateEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT(QString, getVersionCheckUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(VersionCheckType, getVersionCheckType, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, haveVersionNightlyUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowLocalSipAccount, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowStartChatButton, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getShowStartVideoCallButton, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isMipmapEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, useMinimalTimelineFilter, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLogText, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLogsFolder, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLogsUploadUrl, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getLogsEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(QString, getLogsEmail, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getVfsEncrypted, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isLdapAvailable, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isOAuth2Available, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, isDeveloperSettingsAvailable, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getDeveloperSettingsEnabled, SettingsModel) +DEFINE_SYNC_BODY_SLOT_CONST(bool, getIsInCall, SettingsModel) diff --git a/linphone-app/src/components/settings/SettingsModelGUI.cpp b/linphone-app/src/components/settings/SettingsModelGUI.cpp index e9bcf2598..187d20406 100644 --- a/linphone-app/src/components/settings/SettingsModelGUI.cpp +++ b/linphone-app/src/components/settings/SettingsModelGUI.cpp @@ -365,125 +365,125 @@ SettingsModelGUI::SettingsModelGUI(QObject * parent) : QObject(parent){ SettingsModelGUI::~SettingsModelGUI(){ } -DECLARE_GETTER(bool, getCreateAppSipAccountEnabled, SettingsModel) -DECLARE_GETTER(bool, getFetchRemoteConfigurationEnabled, SettingsModel) -DECLARE_GETTER(bool, getUseAppSipAccountEnabled, SettingsModel) -DECLARE_GETTER(bool, getUseOtherSipAccountEnabled, SettingsModel) -DECLARE_GETTER(bool, getAssistantSupportsPhoneNumbers, SettingsModel) -DECLARE_GETTER(bool, useWebview, SettingsModel) -DECLARE_GETTER(QString, getAssistantRegistrationUrl, SettingsModel) -DECLARE_GETTER(QString, getAssistantLoginUrl, SettingsModel) -DECLARE_GETTER(QString, getAssistantLogoutUrl, SettingsModel) -DECLARE_GETTER(bool, isCguAccepted, SettingsModel) -DECLARE_GETTER(QString, getDeviceName, SettingsModel) -DECLARE_GETTER(float, getMicVolume, SettingsModel) -DECLARE_GETTER(float, getPlaybackGain, SettingsModel) -DECLARE_GETTER(float, getCaptureGain, SettingsModel) -DECLARE_GETTER(bool, getCaptureGraphRunning, SettingsModel) -DECLARE_GETTER(QStringList, getCaptureDevices, SettingsModel) -DECLARE_GETTER(QStringList, getPlaybackDevices, SettingsModel) -DECLARE_GETTER(QString, getCaptureDevice, SettingsModel) -DECLARE_GETTER(QString, getPlaybackDevice, SettingsModel) -DECLARE_GETTER(QString, getRingerDevice, SettingsModel) -DECLARE_GETTER(QString, getRingPath, SettingsModel) -DECLARE_GETTER(bool, getEchoCancellationEnabled, SettingsModel) -DECLARE_GETTER(bool, getShowAudioCodecs, SettingsModel) -DECLARE_GETTER(QStringList, getVideoDevices, SettingsModel) -DECLARE_GETTER(QString, getVideoDevice, SettingsModel) -DECLARE_GETTER(QString, getVideoPreset, SettingsModel) -DECLARE_GETTER(int, getVideoFramerate, SettingsModel) -DECLARE_GETTER(QVariantList, getSupportedVideoDefinitions, SettingsModel) -DECLARE_GETTER(QVariantMap, getVideoDefinition, SettingsModel) -DECLARE_GETTER(QVariantMap, getCurrentPreviewVideoDefinition, SettingsModel) -DECLARE_GETTER(bool, getVideoSupported, SettingsModel) -DECLARE_GETTER(bool, getShowVideoCodecs, SettingsModel) -DECLARE_GETTER_ENUM(CameraMode, getGridCameraMode, SettingsModel) -DECLARE_GETTER_ENUM(CameraMode, getActiveSpeakerCameraMode, SettingsModel) -DECLARE_GETTER_ENUM(CameraMode, getCallCameraMode, SettingsModel) -DECLARE_GETTER(LinphoneEnums::ConferenceLayout, getVideoConferenceLayout, SettingsModel) -DECLARE_GETTER(bool, getAutoAnswerStatus, SettingsModel) -DECLARE_GETTER(bool, getAutoAnswerVideoStatus, SettingsModel) -DECLARE_GETTER(int, getAutoAnswerDelay, SettingsModel) -DECLARE_GETTER(bool, getShowTelKeypadAutomatically, SettingsModel) -DECLARE_GETTER(bool, getKeepCallsWindowInBackground, SettingsModel) -DECLARE_GETTER(bool, getOutgoingCallsEnabled, SettingsModel) -DECLARE_GETTER(bool, getCallRecorderEnabled, SettingsModel) -DECLARE_GETTER(bool, getAutomaticallyRecordCalls, SettingsModel) -DECLARE_GETTER(int, getAutoDownloadMaxSize, SettingsModel) -DECLARE_GETTER(bool, getCallPauseEnabled, SettingsModel) -DECLARE_GETTER(bool, getMuteMicrophoneEnabled, SettingsModel) -DECLARE_GETTER(bool, getStandardChatEnabled, SettingsModel) -DECLARE_GETTER(bool, getSecureChatEnabled, SettingsModel) -DECLARE_GETTER(bool, getHideEmptyChatRooms, SettingsModel) -DECLARE_GETTER(bool, getWaitRegistrationForCall, SettingsModel) -DECLARE_GETTER(bool, getIncallScreenshotEnabled, SettingsModel) -DECLARE_GETTER(bool, getGroupChatEnabled, SettingsModel) -DECLARE_GETTER(bool, getConferenceEnabled, SettingsModel) -DECLARE_GETTER(bool, getVideoConferenceEnabled, SettingsModel) -DECLARE_GETTER(bool, getChatNotificationsEnabled, SettingsModel) -DECLARE_GETTER(bool, getChatNotificationSoundEnabled, SettingsModel) -DECLARE_GETTER(QString, getChatNotificationSoundPath, SettingsModel) -DECLARE_GETTER(QString, getFileTransferUrl, SettingsModel) -DECLARE_GETTER(bool, getLimeIsSupported, SettingsModel) -DECLARE_GETTER(QVariantList, getSupportedMediaEncryptions, SettingsModel) -DECLARE_GETTER_ENUM(MediaEncryption, getMediaEncryption, SettingsModel) -DECLARE_GETTER(bool, mandatoryMediaEncryptionEnabled, SettingsModel) -DECLARE_GETTER(bool, getPostQuantumAvailable, SettingsModel) -DECLARE_GETTER(bool, getLimeState, SettingsModel) -DECLARE_GETTER(bool, getContactsEnabled, SettingsModel) -DECLARE_GETTER(bool, getShowNetworkSettings, SettingsModel) -DECLARE_GETTER(bool, getUseSipInfoForDtmfs, SettingsModel) -DECLARE_GETTER(bool, getUseRfc2833ForDtmfs, SettingsModel) -DECLARE_GETTER(bool, getIpv6Enabled, SettingsModel) -DECLARE_GETTER(int, getDownloadBandwidth, SettingsModel) -DECLARE_GETTER(int, getUploadBandwidth, SettingsModel) -DECLARE_GETTER(bool, getAdaptiveRateControlEnabled, SettingsModel) -DECLARE_GETTER(int, getTcpPort, SettingsModel) -DECLARE_GETTER(int, getUdpPort, SettingsModel) -DECLARE_GETTER(QList, getAudioPortRange, SettingsModel) -DECLARE_GETTER(QList, getVideoPortRange, SettingsModel) -DECLARE_GETTER(bool, getIceEnabled, SettingsModel) -DECLARE_GETTER(bool, getTurnEnabled, SettingsModel) -DECLARE_GETTER(QString, getStunServer, SettingsModel) -DECLARE_GETTER(QString, getTurnUser, SettingsModel) -DECLARE_GETTER(QString, getTurnPassword, SettingsModel) -DECLARE_GETTER(int, getDscpSip, SettingsModel) -DECLARE_GETTER(int, getDscpAudio, SettingsModel) -DECLARE_GETTER(int, getDscpVideo, SettingsModel) -DECLARE_GETTER(bool, getRlsUriEnabled, SettingsModel) -DECLARE_GETTER(bool, tunnelAvailable, SettingsModel) -DECLARE_GETTER(TunnelModel *, getTunnel, SettingsModel) -DECLARE_GETTER(QFont, getTextMessageFont, SettingsModel) -DECLARE_GETTER(int, getTextMessageFontSize, SettingsModel) -DECLARE_GETTER(QFont, getEmojiFont, SettingsModel) -DECLARE_GETTER(int, getEmojiFontSize, SettingsModel) -DECLARE_GETTER(QString, getSavedScreenshotsFolder, SettingsModel) -DECLARE_GETTER(QString, getSavedCallsFolder, SettingsModel) -DECLARE_GETTER(QString, getDownloadFolder, SettingsModel) -DECLARE_GETTER(QString, getRemoteProvisioning, SettingsModel) -DECLARE_GETTER(bool, isQRCodeAvailable, SettingsModel) -DECLARE_GETTER(QString, getFlexiAPIUrl, SettingsModel) -DECLARE_GETTER(bool, getExitOnClose, SettingsModel) -DECLARE_GETTER(bool, isCheckForUpdateEnabled, SettingsModel) -DECLARE_GETTER(QString, getVersionCheckUrl, SettingsModel) -DECLARE_GETTER_ENUM(VersionCheckType, getVersionCheckType, SettingsModel) -DECLARE_GETTER(bool, haveVersionNightlyUrl, SettingsModel) -DECLARE_GETTER(bool, getShowLocalSipAccount, SettingsModel) -DECLARE_GETTER(bool, getShowStartChatButton, SettingsModel) -DECLARE_GETTER(bool, getShowStartVideoCallButton, SettingsModel) -DECLARE_GETTER(bool, isMipmapEnabled, SettingsModel) -DECLARE_GETTER(bool, useMinimalTimelineFilter, SettingsModel) -DECLARE_GETTER(QString, getLogText, SettingsModel) -DECLARE_GETTER(QString, getLogsFolder, SettingsModel) -DECLARE_GETTER(QString, getLogsUploadUrl, SettingsModel) -DECLARE_GETTER(bool, getLogsEnabled, SettingsModel) -DECLARE_GETTER(QString, getLogsEmail, SettingsModel) -DECLARE_GETTER(bool, getVfsEncrypted, SettingsModel) -DECLARE_GETTER(bool, isLdapAvailable, SettingsModel) -DECLARE_GETTER(bool, isOAuth2Available, SettingsModel) -DECLARE_GETTER(bool, isDeveloperSettingsAvailable, SettingsModel) -DECLARE_GETTER(bool, getDeveloperSettingsEnabled, SettingsModel) -DECLARE_GETTER(bool, getIsInCall, SettingsModel) +DEFINE_GETTER(bool, getCreateAppSipAccountEnabled, SettingsModel) +DEFINE_GETTER(bool, getFetchRemoteConfigurationEnabled, SettingsModel) +DEFINE_GETTER(bool, getUseAppSipAccountEnabled, SettingsModel) +DEFINE_GETTER(bool, getUseOtherSipAccountEnabled, SettingsModel) +DEFINE_GETTER(bool, getAssistantSupportsPhoneNumbers, SettingsModel) +DEFINE_GETTER(bool, useWebview, SettingsModel) +DEFINE_GETTER(QString, getAssistantRegistrationUrl, SettingsModel) +DEFINE_GETTER(QString, getAssistantLoginUrl, SettingsModel) +DEFINE_GETTER(QString, getAssistantLogoutUrl, SettingsModel) +DEFINE_GETTER(bool, isCguAccepted, SettingsModel) +DEFINE_GETTER(QString, getDeviceName, SettingsModel) +DEFINE_GETTER(float, getMicVolume, SettingsModel) +DEFINE_GETTER(float, getPlaybackGain, SettingsModel) +DEFINE_GETTER(float, getCaptureGain, SettingsModel) +DEFINE_GETTER(bool, getCaptureGraphRunning, SettingsModel) +DEFINE_GETTER(QStringList, getCaptureDevices, SettingsModel) +DEFINE_GETTER(QStringList, getPlaybackDevices, SettingsModel) +DEFINE_GETTER(QString, getCaptureDevice, SettingsModel) +DEFINE_GETTER(QString, getPlaybackDevice, SettingsModel) +DEFINE_GETTER(QString, getRingerDevice, SettingsModel) +DEFINE_GETTER(QString, getRingPath, SettingsModel) +DEFINE_GETTER(bool, getEchoCancellationEnabled, SettingsModel) +DEFINE_GETTER(bool, getShowAudioCodecs, SettingsModel) +DEFINE_GETTER(QStringList, getVideoDevices, SettingsModel) +DEFINE_GETTER(QString, getVideoDevice, SettingsModel) +DEFINE_GETTER(QString, getVideoPreset, SettingsModel) +DEFINE_GETTER(int, getVideoFramerate, SettingsModel) +DEFINE_GETTER(QVariantList, getSupportedVideoDefinitions, SettingsModel) +DEFINE_GETTER(QVariantMap, getVideoDefinition, SettingsModel) +DEFINE_GETTER(QVariantMap, getCurrentPreviewVideoDefinition, SettingsModel) +DEFINE_GETTER(bool, getVideoSupported, SettingsModel) +DEFINE_GETTER(bool, getShowVideoCodecs, SettingsModel) +DEFINE_GETTER_ENUM(CameraMode, getGridCameraMode, SettingsModel) +DEFINE_GETTER_ENUM(CameraMode, getActiveSpeakerCameraMode, SettingsModel) +DEFINE_GETTER_ENUM(CameraMode, getCallCameraMode, SettingsModel) +DEFINE_GETTER(LinphoneEnums::ConferenceLayout, getVideoConferenceLayout, SettingsModel) +DEFINE_GETTER(bool, getAutoAnswerStatus, SettingsModel) +DEFINE_GETTER(bool, getAutoAnswerVideoStatus, SettingsModel) +DEFINE_GETTER(int, getAutoAnswerDelay, SettingsModel) +DEFINE_GETTER(bool, getShowTelKeypadAutomatically, SettingsModel) +DEFINE_GETTER(bool, getKeepCallsWindowInBackground, SettingsModel) +DEFINE_GETTER(bool, getOutgoingCallsEnabled, SettingsModel) +DEFINE_GETTER(bool, getCallRecorderEnabled, SettingsModel) +DEFINE_GETTER(bool, getAutomaticallyRecordCalls, SettingsModel) +DEFINE_GETTER(int, getAutoDownloadMaxSize, SettingsModel) +DEFINE_GETTER(bool, getCallPauseEnabled, SettingsModel) +DEFINE_GETTER(bool, getMuteMicrophoneEnabled, SettingsModel) +DEFINE_GETTER(bool, getStandardChatEnabled, SettingsModel) +DEFINE_GETTER(bool, getSecureChatEnabled, SettingsModel) +DEFINE_GETTER(bool, getHideEmptyChatRooms, SettingsModel) +DEFINE_GETTER(bool, getWaitRegistrationForCall, SettingsModel) +DEFINE_GETTER(bool, getIncallScreenshotEnabled, SettingsModel) +DEFINE_GETTER(bool, getGroupChatEnabled, SettingsModel) +DEFINE_GETTER(bool, getConferenceEnabled, SettingsModel) +DEFINE_GETTER(bool, getVideoConferenceEnabled, SettingsModel) +DEFINE_GETTER(bool, getChatNotificationsEnabled, SettingsModel) +DEFINE_GETTER(bool, getChatNotificationSoundEnabled, SettingsModel) +DEFINE_GETTER(QString, getChatNotificationSoundPath, SettingsModel) +DEFINE_GETTER(QString, getFileTransferUrl, SettingsModel) +DEFINE_GETTER(bool, getLimeIsSupported, SettingsModel) +DEFINE_GETTER(QVariantList, getSupportedMediaEncryptions, SettingsModel) +DEFINE_GETTER_ENUM(MediaEncryption, getMediaEncryption, SettingsModel) +DEFINE_GETTER(bool, mandatoryMediaEncryptionEnabled, SettingsModel) +DEFINE_GETTER(bool, getPostQuantumAvailable, SettingsModel) +DEFINE_GETTER(bool, getLimeState, SettingsModel) +DEFINE_GETTER(bool, getContactsEnabled, SettingsModel) +DEFINE_GETTER(bool, getShowNetworkSettings, SettingsModel) +DEFINE_GETTER(bool, getUseSipInfoForDtmfs, SettingsModel) +DEFINE_GETTER(bool, getUseRfc2833ForDtmfs, SettingsModel) +DEFINE_GETTER(bool, getIpv6Enabled, SettingsModel) +DEFINE_GETTER(int, getDownloadBandwidth, SettingsModel) +DEFINE_GETTER(int, getUploadBandwidth, SettingsModel) +DEFINE_GETTER(bool, getAdaptiveRateControlEnabled, SettingsModel) +DEFINE_GETTER(int, getTcpPort, SettingsModel) +DEFINE_GETTER(int, getUdpPort, SettingsModel) +DEFINE_GETTER(QList, getAudioPortRange, SettingsModel) +DEFINE_GETTER(QList, getVideoPortRange, SettingsModel) +DEFINE_GETTER(bool, getIceEnabled, SettingsModel) +DEFINE_GETTER(bool, getTurnEnabled, SettingsModel) +DEFINE_GETTER(QString, getStunServer, SettingsModel) +DEFINE_GETTER(QString, getTurnUser, SettingsModel) +DEFINE_GETTER(QString, getTurnPassword, SettingsModel) +DEFINE_GETTER(int, getDscpSip, SettingsModel) +DEFINE_GETTER(int, getDscpAudio, SettingsModel) +DEFINE_GETTER(int, getDscpVideo, SettingsModel) +DEFINE_GETTER(bool, getRlsUriEnabled, SettingsModel) +DEFINE_GETTER(bool, tunnelAvailable, SettingsModel) +DEFINE_GETTER(TunnelModel *, getTunnel, SettingsModel) +DEFINE_GETTER(QFont, getTextMessageFont, SettingsModel) +DEFINE_GETTER(int, getTextMessageFontSize, SettingsModel) +DEFINE_GETTER(QFont, getEmojiFont, SettingsModel) +DEFINE_GETTER(int, getEmojiFontSize, SettingsModel) +DEFINE_GETTER(QString, getSavedScreenshotsFolder, SettingsModel) +DEFINE_GETTER(QString, getSavedCallsFolder, SettingsModel) +DEFINE_GETTER(QString, getDownloadFolder, SettingsModel) +DEFINE_GETTER(QString, getRemoteProvisioning, SettingsModel) +DEFINE_GETTER(bool, isQRCodeAvailable, SettingsModel) +DEFINE_GETTER(QString, getFlexiAPIUrl, SettingsModel) +DEFINE_GETTER(bool, getExitOnClose, SettingsModel) +DEFINE_GETTER(bool, isCheckForUpdateEnabled, SettingsModel) +DEFINE_GETTER(QString, getVersionCheckUrl, SettingsModel) +DEFINE_GETTER_ENUM(VersionCheckType, getVersionCheckType, SettingsModel) +DEFINE_GETTER(bool, haveVersionNightlyUrl, SettingsModel) +DEFINE_GETTER(bool, getShowLocalSipAccount, SettingsModel) +DEFINE_GETTER(bool, getShowStartChatButton, SettingsModel) +DEFINE_GETTER(bool, getShowStartVideoCallButton, SettingsModel) +DEFINE_GETTER(bool, isMipmapEnabled, SettingsModel) +DEFINE_GETTER(bool, useMinimalTimelineFilter, SettingsModel) +DEFINE_GETTER(QString, getLogText, SettingsModel) +DEFINE_GETTER(QString, getLogsFolder, SettingsModel) +DEFINE_GETTER(QString, getLogsUploadUrl, SettingsModel) +DEFINE_GETTER(bool, getLogsEnabled, SettingsModel) +DEFINE_GETTER(QString, getLogsEmail, SettingsModel) +DEFINE_GETTER(bool, getVfsEncrypted, SettingsModel) +DEFINE_GETTER(bool, isLdapAvailable, SettingsModel) +DEFINE_GETTER(bool, isOAuth2Available, SettingsModel) +DEFINE_GETTER(bool, isDeveloperSettingsAvailable, SettingsModel) +DEFINE_GETTER(bool, getDeveloperSettingsEnabled, SettingsModel) +DEFINE_GETTER(bool, getIsInCall, SettingsModel) bool SettingsModelGUI::isCheckForUpdateAvailable(){ return SettingsModel::isCheckForUpdateAvailable(); diff --git a/linphone-app/src/utils/CodeHelpersGUI.hpp b/linphone-app/src/utils/CodeHelpersGUI.hpp index 650273739..599d2ae2c 100644 --- a/linphone-app/src/utils/CodeHelpersGUI.hpp +++ b/linphone-app/src/utils/CodeHelpersGUI.hpp @@ -24,16 +24,25 @@ // Use them in .hpp #define DECLARE_SYNC_SLOT_CONST(RETURN_TYPE, FUNCTION_NAME) void FUNCTION_NAME ## Slot(RETURN_TYPE* result) const; #define DECLARE_SYNC_SLOT(RETURN_TYPE, FUNCTION_NAME) void FUNCTION_NAME ## Slot(RETURN_TYPE* result); +#define DECLARE_THREADED_DESTRUCTOR_SIGNAL() void requestDestructionSync(); // Use them in .cpp -#define DECLARE_SYNC_BODY_SLOT_CONST(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ +#define DEFINE_SYNC_BODY_SLOT_CONST(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ void ROOT_CLASS::FUNCTION_NAME ## Slot(RETURN_TYPE * result) const{\ *result = FUNCTION_NAME();\ } -#define DECLARE_SYNC_BODY_SLOT(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ +#define DEFINE_SYNC_BODY_SLOT(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ void ROOT_CLASS::FUNCTION_NAME ## Slot(RETURN_TYPE * result){\ *result = FUNCTION_NAME();\ } +#define DEFINE_THREADED_DESCTRUCTOR(thisClass) thisClass::~thisClass () {\ + if( thread() == QApplication::instance()->thread()){\ + connect(this, &thisClass::requestDestructionSync, this, &thisClass::destruction, Qt::BlockingQueuedConnection);\ + emit requestDestructionSync();\ + }else{\ + destruction();\ + }\ +} // Use them in GUI.hpp #define DECLARE_SYNC_SIGNAL(RETURN_TYPE, FUNCTION_NAME) RETURN_TYPE FUNCTION_NAME ## Sync(RETURN_TYPE* result) const; @@ -56,13 +65,13 @@ connect(this, &ROOT_CLASS ## GUI::FUNCTION_NAME ## Sync, appModel, &ROOT_CLASS::FUNCTION_NAME ## Slot, Qt::BlockingQueuedConnection) // Use them in GUI.cpp -#define DECLARE_GETTER(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ +#define DEFINE_GETTER(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ RETURN_TYPE ROOT_CLASS ## GUI::FUNCTION_NAME() const{\ RETURN_TYPE result;\ emit FUNCTION_NAME ## Sync(&result);\ return result;\ } -#define DECLARE_GETTER_ENUM(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ +#define DEFINE_GETTER_ENUM(RETURN_TYPE, FUNCTION_NAME, ROOT_CLASS) \ ROOT_CLASS ## GUI::RETURN_TYPE ROOT_CLASS ## GUI::FUNCTION_NAME() const{\ ROOT_CLASS::RETURN_TYPE result;\ emit FUNCTION_NAME ## Sync(&result);\ diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index 87458c9c8..a9605c7b6 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -8,6 +8,8 @@ import Common 1.0 import UtilsCpp 1.0 +import 'qrc:/ui/scripts/Utils/utils.js' as Utils + // ============================================================================= Rectangle { @@ -46,6 +48,8 @@ Rectangle { color: 'transparent' // No color by default. height: ContactStyle.height + //Component.onCompleted: console.log(Utils.printObject(entry)) + RowLayout { anchors { fill: parent @@ -133,6 +137,20 @@ Rectangle { ? entry.participants.addressesToString : '' : '' + Component.onCompleted: + entry && item.showSubtitle + ? console.log("A:"+item.subtitle) + ? item.subtitle + : (entry.isOneToOne == undefined || entry.isOneToOne) && (entry.haveEncryption == undefined || !entry.haveEncryption) + ? item.organizer + ? console.log("B:"+item.organizer) + : console.log("C" +(entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '')) + : entry.participants + ? console.log("D:"+entry.participants.addressesToString) + : console.log("E") + : console.log("F") + + //console.log(entry + " : " +item.subject + " / " +entry.participants.addressesToString) } ContactMessageCounter {