diff options
Diffstat (limited to 'Swift/Controllers/UIEvents')
32 files changed, 479 insertions, 380 deletions
diff --git a/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h b/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h index 93cad03..ac76ec4 100644 --- a/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h +++ b/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h @@ -4,21 +4,27 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <Swiften/JID/JID.h> #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class AcceptWhiteboardSessionUIEvent : public UIEvent { - typedef boost::shared_ptr<AcceptWhiteboardSessionUIEvent> ref; - public: - AcceptWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} - const JID& getContact() const {return jid_;} - private: - JID jid_; - }; + class AcceptWhiteboardSessionUIEvent : public UIEvent { + typedef std::shared_ptr<AcceptWhiteboardSessionUIEvent> ref; + public: + AcceptWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} + const JID& getContact() const {return jid_;} + private: + JID jid_; + }; } diff --git a/Swift/Controllers/UIEvents/AddContactUIEvent.h b/Swift/Controllers/UIEvents/AddContactUIEvent.h index 50a8761..df5bf36 100644 --- a/Swift/Controllers/UIEvents/AddContactUIEvent.h +++ b/Swift/Controllers/UIEvents/AddContactUIEvent.h @@ -1,36 +1,38 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <string> #include <set> +#include <string> + +#include <Swiften/JID/JID.h> -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class AddContactUIEvent : public UIEvent { - public: - AddContactUIEvent(const JID& jid, const std::string& name, const std::set<std::string>& groups) : jid_(jid), name_(name), groups_(groups) {} - - const std::string& getName() const { - return name_; - } - - const JID& getJID() const { - return jid_; - } - - const std::set<std::string>& getGroups() const { - return groups_; - } - - private: - JID jid_; - std::string name_; - std::set<std::string> groups_; - }; + class AddContactUIEvent : public UIEvent { + public: + AddContactUIEvent(const JID& jid, const std::string& name, const std::set<std::string>& groups) : jid_(jid), name_(name), groups_(groups) {} + + const std::string& getName() const { + return name_; + } + + const JID& getJID() const { + return jid_; + } + + const std::set<std::string>& getGroups() const { + return groups_; + } + + private: + JID jid_; + std::string name_; + std::set<std::string> groups_; + }; } diff --git a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h index 8523a78..e1d6744 100644 --- a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h @@ -1,23 +1,24 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> -#include "Swift/Controllers/UIEvents/UIEvent.h" -#include "Swiften/MUC/MUCBookmark.h" +#include <Swiften/MUC/MUCBookmark.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class AddMUCBookmarkUIEvent : public UIEvent { - public: - AddMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} - const MUCBookmark& getBookmark() { return bookmark; } + class AddMUCBookmarkUIEvent : public UIEvent { + public: + AddMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} + const MUCBookmark& getBookmark() { return bookmark; } - private: - MUCBookmark bookmark; - }; + private: + MUCBookmark bookmark; + }; } diff --git a/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h b/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h index f5c3b0e..1e9491f 100644 --- a/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h +++ b/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h @@ -4,21 +4,27 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <Swiften/JID/JID.h> #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class CancelWhiteboardSessionUIEvent : public UIEvent { - typedef boost::shared_ptr<CancelWhiteboardSessionUIEvent> ref; - public: - CancelWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} - const JID& getContact() const {return jid_;} - private: - JID jid_; - }; + class CancelWhiteboardSessionUIEvent : public UIEvent { + typedef std::shared_ptr<CancelWhiteboardSessionUIEvent> ref; + public: + CancelWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} + const JID& getContact() const {return jid_;} + private: + JID jid_; + }; } diff --git a/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h b/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h index 57e181d..e420bad 100644 --- a/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h @@ -4,23 +4,44 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once +#include <string> +#include <vector> + +#include <Swiften/JID/JID.h> + #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { class CreateImpromptuMUCUIEvent : public UIEvent { - public: - CreateImpromptuMUCUIEvent(const std::vector<JID>& jids, const JID& roomJID = JID(), const std::string reason = "") : jids_(jids), roomJID_(roomJID), reason_(reason) { } - - std::vector<JID> getJIDs() const { return jids_; } - JID getRoomJID() const { return roomJID_; } - std::string getReason() const { return reason_; } - private: - std::vector<JID> jids_; - JID roomJID_; - std::string reason_; + public: + /** + * @brief CreateImpromptuMUCUIEvent + * @param jids A vector of JIDs that are invited to the imprompto MUC. + * Useful when the event is used to recreate an old impromptu + * chat room. + * @param roomJID The full JID of the impromtu MUC. Useful when the event + * is used to recreate an old impromptu chat room. + * @param reason + */ + CreateImpromptuMUCUIEvent(const std::vector<JID>& jids, const JID& roomJID = JID(), const std::string reason = "") : jids_(jids), roomJID_(roomJID), reason_(reason) { } + + std::vector<JID> getJIDs() const { return jids_; } + JID getRoomJID() const { return roomJID_; } + std::string getReason() const { return reason_; } + + private: + std::vector<JID> jids_; + JID roomJID_; + std::string reason_; }; } diff --git a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h index 01c59a3..33f38f2 100644 --- a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h @@ -1,26 +1,27 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> -#include "Swift/Controllers/UIEvents/UIEvent.h" -#include "Swiften/MUC/MUCBookmark.h" +#include <Swiften/MUC/MUCBookmark.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class EditMUCBookmarkUIEvent : public UIEvent { - public: - EditMUCBookmarkUIEvent(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark) : oldBookmark(oldBookmark) , newBookmark(newBookmark) {} + class EditMUCBookmarkUIEvent : public UIEvent { + public: + EditMUCBookmarkUIEvent(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark) : oldBookmark(oldBookmark) , newBookmark(newBookmark) {} - const MUCBookmark& getOldBookmark() {return oldBookmark;} - const MUCBookmark& getNewBookmark() {return newBookmark;} + const MUCBookmark& getOldBookmark() {return oldBookmark;} + const MUCBookmark& getNewBookmark() {return newBookmark;} - private: - MUCBookmark oldBookmark; - MUCBookmark newBookmark; - }; + private: + MUCBookmark oldBookmark; + MUCBookmark newBookmark; + }; } diff --git a/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h b/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h index cb9d20b..e38eab8 100644 --- a/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h @@ -4,37 +4,44 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> -#include <Swift/Controllers/UIEvents/UIEvent.h> #include <Swiften/JID/JID.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { - class InviteToMUCUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<InviteToMUCUIEvent> ref; - - InviteToMUCUIEvent(const JID& room, const std::vector<JID>& JIDsToInvite, const std::string& reason) : room_(room), invite_(JIDsToInvite), reason_(reason) { - } - - const JID& getRoom() const { - return room_; - } - - const std::vector<JID> getInvites() const { - return invite_; - } - - const std::string getReason() const { - return reason_; - } - - private: - JID room_; - std::vector<JID> invite_; - std::string reason_; - }; + class InviteToMUCUIEvent : public UIEvent { + public: + typedef std::shared_ptr<InviteToMUCUIEvent> ref; + + InviteToMUCUIEvent(const JID& originator, const std::vector<JID>& JIDsToInvite, const std::string& reason) : originator_(originator), invite_(JIDsToInvite), reason_(reason) { + } + + const JID& getOriginator() const { + return originator_; + } + + const std::vector<JID> getInvites() const { + return invite_; + } + + const std::string getReason() const { + return reason_; + } + + private: + JID originator_; + std::vector<JID> invite_; + std::string reason_; + }; } diff --git a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h index a1f91f6..5d6df55 100644 --- a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h @@ -1,39 +1,40 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/optional.hpp> -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> +#include <boost/optional.hpp> + #include <Swiften/JID/JID.h> #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class JoinMUCUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<JoinMUCUIEvent> ref; - JoinMUCUIEvent(const JID& jid, const boost::optional<std::string>& password = boost::optional<std::string>(), const boost::optional<std::string>& nick = boost::optional<std::string>(), bool joinAutomaticallyInFuture = false, bool createAsReservedRoomIfNew = false, bool isImpromptu = false, bool isContinuation = false) : jid_(jid), nick_(nick), joinAutomatically_(joinAutomaticallyInFuture), createAsReservedRoomIfNew_(createAsReservedRoomIfNew), password_(password), isImpromptuMUC_(isImpromptu), isContinuation_(isContinuation) {} - const boost::optional<std::string>& getNick() const {return nick_;} - const JID& getJID() const {return jid_;} - bool getShouldJoinAutomatically() const {return joinAutomatically_;} - bool getCreateAsReservedRoomIfNew() const {return createAsReservedRoomIfNew_;} - const boost::optional<std::string>& getPassword() const {return password_;} - bool isImpromptu() const {return isImpromptuMUC_;} - bool isContinuation() const {return isContinuation_;} + class JoinMUCUIEvent : public UIEvent { + public: + typedef std::shared_ptr<JoinMUCUIEvent> ref; + JoinMUCUIEvent(const JID& jid, const boost::optional<std::string>& password = boost::optional<std::string>(), const boost::optional<std::string>& nick = boost::optional<std::string>(), bool joinAutomaticallyInFuture = false, bool createAsReservedRoomIfNew = false, bool isImpromptu = false, bool isContinuation = false) : jid_(jid), nick_(nick), joinAutomatically_(joinAutomaticallyInFuture), createAsReservedRoomIfNew_(createAsReservedRoomIfNew), password_(password), isImpromptuMUC_(isImpromptu), isContinuation_(isContinuation) {} + const boost::optional<std::string>& getNick() const {return nick_;} + const JID& getJID() const {return jid_;} + bool getShouldJoinAutomatically() const {return joinAutomatically_;} + bool getCreateAsReservedRoomIfNew() const {return createAsReservedRoomIfNew_;} + const boost::optional<std::string>& getPassword() const {return password_;} + bool isImpromptu() const {return isImpromptuMUC_;} + bool isContinuation() const {return isContinuation_;} - private: - JID jid_; - boost::optional<std::string> nick_; - bool joinAutomatically_; - bool createAsReservedRoomIfNew_; - boost::optional<std::string> password_; - bool isImpromptuMUC_; - bool isContinuation_; - }; + private: + JID jid_; + boost::optional<std::string> nick_; + bool joinAutomatically_; + bool createAsReservedRoomIfNew_; + boost::optional<std::string> password_; + bool isImpromptuMUC_; + bool isContinuation_; + }; } diff --git a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h index f253c2a..b73eda5 100644 --- a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h @@ -1,23 +1,24 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> -#include "Swift/Controllers/UIEvents/UIEvent.h" -#include "Swiften/MUC/MUCBookmark.h" +#include <Swiften/MUC/MUCBookmark.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RemoveMUCBookmarkUIEvent : public UIEvent { - public: - RemoveMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} - const MUCBookmark& getBookmark() { return bookmark; } + class RemoveMUCBookmarkUIEvent : public UIEvent { + public: + RemoveMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} + const MUCBookmark& getBookmark() { return bookmark; } - private: - MUCBookmark bookmark; - }; + private: + MUCBookmark bookmark; + }; } diff --git a/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h b/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h index 30c2c39..0f4a89d 100644 --- a/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h @@ -1,23 +1,24 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swiften/JID/JID.h" -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swiften/JID/JID.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { class RemoveRosterItemUIEvent : public UIEvent { - public: - RemoveRosterItemUIEvent(const JID& jid) : jid_(jid) {} - virtual ~RemoveRosterItemUIEvent() {} - JID getJID() {return jid_;} - private: - JID jid_; + public: + RemoveRosterItemUIEvent(const JID& jid) : jid_(jid) {} + virtual ~RemoveRosterItemUIEvent() {} + JID getJID() {return jid_;} + private: + JID jid_; }; diff --git a/Swift/Controllers/UIEvents/RenameGroupUIEvent.h b/Swift/Controllers/UIEvents/RenameGroupUIEvent.h index 13d2516..ea19efe 100644 --- a/Swift/Controllers/UIEvents/RenameGroupUIEvent.h +++ b/Swift/Controllers/UIEvents/RenameGroupUIEvent.h @@ -1,30 +1,31 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <Swift/Controllers/UIEvents/UIEvent.h> #include <string> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { - class RenameGroupUIEvent : public UIEvent { - public: - RenameGroupUIEvent(const std::string& group, const std::string& newName) : group(group), newName(newName) { - } + class RenameGroupUIEvent : public UIEvent { + public: + RenameGroupUIEvent(const std::string& group, const std::string& newName) : group(group), newName(newName) { + } - const std::string& getGroup() const { - return group; - } + const std::string& getGroup() const { + return group; + } - const std::string& getNewName() const { - return newName; - } + const std::string& getNewName() const { + return newName; + } - private: - std::string group; - std::string newName; - }; + private: + std::string group; + std::string newName; + }; } diff --git a/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h b/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h index b47575a..1a71cb4 100644 --- a/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h @@ -1,26 +1,27 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> -#include "Swift/Controllers/UIEvents/UIEvent.h" -#include "Swiften/MUC/MUCBookmark.h" +#include <Swiften/MUC/MUCBookmark.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RenameRosterItemUIEvent : public UIEvent { - public: - RenameRosterItemUIEvent(const JID& jid, const std::string& newName) : jid_(jid), newName_(newName) {} + class RenameRosterItemUIEvent : public UIEvent { + public: + RenameRosterItemUIEvent(const JID& jid, const std::string& newName) : jid_(jid), newName_(newName) {} - const JID& getJID() const {return jid_;} - const std::string& getNewName() const {return newName_;} + const JID& getJID() const {return jid_;} + const std::string& getNewName() const {return newName_;} - private: - JID jid_; - std::string newName_; - }; + private: + JID jid_; + std::string newName_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h b/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h index 284a1bd..f6fa1c7 100644 --- a/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h @@ -1,21 +1,20 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <Swift/Controllers/UIInterfaces/MainWindow.h> - #include <Swift/Controllers/UIEvents/UIEvent.h> +#include <Swift/Controllers/UIInterfaces/MainWindow.h> namespace Swift { - class RequestAdHocUIEvent : public UIEvent { - public: - RequestAdHocUIEvent(const DiscoItems::Item& command) : command_(command) {} - const DiscoItems::Item& getCommand() const {return command_;} - private: - DiscoItems::Item command_; - }; + class RequestAdHocUIEvent : public UIEvent { + public: + RequestAdHocUIEvent(const DiscoItems::Item& command) : command_(command) {} + const DiscoItems::Item& getCommand() const {return command_;} + private: + DiscoItems::Item command_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestAdHocWithJIDUIEvent.h b/Swift/Controllers/UIEvents/RequestAdHocWithJIDUIEvent.h index 2a01d47..6fe2342 100644 --- a/Swift/Controllers/UIEvents/RequestAdHocWithJIDUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestAdHocWithJIDUIEvent.h @@ -1,21 +1,25 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <string> + +#include <Swiften/JID/JID.h> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestAdHocWithJIDUIEvent : public UIEvent { - public: - RequestAdHocWithJIDUIEvent(const JID& jid, const std::string& node) : jid_(jid), node_(node) {} - JID getJID() const { return jid_; } - std::string getNode() const { return node_; } - private: - JID jid_; - std::string node_; - }; + class RequestAdHocWithJIDUIEvent : public UIEvent { + public: + RequestAdHocWithJIDUIEvent(const JID& jid, const std::string& node) : jid_(jid), node_(node) {} + JID getJID() const { return jid_; } + std::string getNode() const { return node_; } + private: + JID jid_; + std::string node_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h b/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h index ba821a7..474d155 100644 --- a/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h @@ -1,29 +1,30 @@ /* - * Copyright (c) 2010-2012 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swift/Controllers/UIEvents/UIEvent.h" #include <string> + #include <Swiften/JID/JID.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestAddUserDialogUIEvent : public UIEvent { + class RequestAddUserDialogUIEvent : public UIEvent { - public: - RequestAddUserDialogUIEvent(const JID& predefinedJID, const std::string& predefinedName) : preJID_(predefinedJID), preName_(predefinedName) {} - RequestAddUserDialogUIEvent() : preJID_(), preName_() {} + public: + RequestAddUserDialogUIEvent(const JID& predefinedJID, const std::string& predefinedName) : preJID_(predefinedJID), preName_(predefinedName) {} + RequestAddUserDialogUIEvent() : preJID_(), preName_() {} - const JID& getPredefinedJID() const { return preJID_; } - const std::string& getPredefinedName() const { return preName_; } + const JID& getPredefinedJID() const { return preJID_; } + const std::string& getPredefinedName() const { return preName_; } - private: - JID preJID_; - std::string preName_; + private: + JID preJID_; + std::string preName_; - }; + }; } diff --git a/Swift/Controllers/UIEvents/RequestChangeBlockStateUIEvent.h b/Swift/Controllers/UIEvents/RequestChangeBlockStateUIEvent.h index 9b7abcb..4dcf8be 100644 --- a/Swift/Controllers/UIEvents/RequestChangeBlockStateUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestChangeBlockStateUIEvent.h @@ -4,34 +4,40 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#pragma once +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ -#include <Swift/Controllers/UIEvents/UIEvent.h> +#pragma once #include <Swiften/JID/JID.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { class RequestChangeBlockStateUIEvent : public UIEvent { - public: - enum BlockState { - Blocked, - Unblocked - }; - - public: - RequestChangeBlockStateUIEvent(BlockState newState, const JID& contact) : state_(newState), contact_(contact) {} - - BlockState getBlockState() const { - return state_; - } - - JID getContact() const { - return contact_; - } - private: - BlockState state_; - JID contact_; + public: + enum BlockState { + Blocked, + Unblocked + }; + + public: + RequestChangeBlockStateUIEvent(BlockState newState, const JID& contact) : state_(newState), contact_(contact) {} + + BlockState getBlockState() const { + return state_; + } + + JID getContact() const { + return contact_; + } + private: + BlockState state_; + JID contact_; }; } diff --git a/Swift/Controllers/UIEvents/RequestChatUIEvent.h b/Swift/Controllers/UIEvents/RequestChatUIEvent.h index 9ed9863..4eca5d4 100644 --- a/Swift/Controllers/UIEvents/RequestChatUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestChatUIEvent.h @@ -1,21 +1,21 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swiften/JID/JID.h" +#include <Swiften/JID/JID.h> -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestChatUIEvent : public UIEvent { - public: - RequestChatUIEvent(const JID& contact) : contact_(contact) {} - JID getContact() {return contact_;} - private: - JID contact_; - }; + class RequestChatUIEvent : public UIEvent { + public: + RequestChatUIEvent(const JID& contact) : contact_(contact) {} + JID getContact() {return contact_;} + private: + JID contact_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestChatWithUserDialogUIEvent.h b/Swift/Controllers/UIEvents/RequestChatWithUserDialogUIEvent.h index 758dabc..08804f4 100644 --- a/Swift/Controllers/UIEvents/RequestChatWithUserDialogUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestChatWithUserDialogUIEvent.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestChatWithUserDialogUIEvent : public UIEvent { + class RequestChatWithUserDialogUIEvent : public UIEvent { - }; + }; } diff --git a/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h b/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h index ff67774..25a5e42 100644 --- a/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,21 +7,22 @@ #pragma once #include <Swiften/JID/JID.h> + #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestContactEditorUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<RequestContactEditorUIEvent> ref; + class RequestContactEditorUIEvent : public UIEvent { + public: + typedef std::shared_ptr<RequestContactEditorUIEvent> ref; - RequestContactEditorUIEvent(const JID& jid) : jid(jid) { - } + RequestContactEditorUIEvent(const JID& jid) : jid(jid) { + } - const JID& getJID() const { - return jid; - } + const JID& getJID() const { + return jid; + } - private: - JID jid; - }; + private: + JID jid; + }; } diff --git a/Swift/Controllers/UIEvents/RequestHighlightEditorUIEvent.h b/Swift/Controllers/UIEvents/RequestHighlightEditorUIEvent.h index 42e22a2..0bfa458 100644 --- a/Swift/Controllers/UIEvents/RequestHighlightEditorUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestHighlightEditorUIEvent.h @@ -10,7 +10,7 @@ namespace Swift { - class RequestHighlightEditorUIEvent : public UIEvent { - }; + class RequestHighlightEditorUIEvent : public UIEvent { + }; } diff --git a/Swift/Controllers/UIEvents/RequestHistoryUIEvent.h b/Swift/Controllers/UIEvents/RequestHistoryUIEvent.h index 025e91f..8282204 100644 --- a/Swift/Controllers/UIEvents/RequestHistoryUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestHistoryUIEvent.h @@ -9,6 +9,6 @@ #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestHistoryUIEvent : public UIEvent { - }; + class RequestHistoryUIEvent : public UIEvent { + }; } diff --git a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h index a6f8e7d..a8e4bb7 100644 --- a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h @@ -5,48 +5,59 @@ */ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> -#include <Swift/Controllers/UIEvents/UIEvent.h> #include <Swiften/JID/JID.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { - class RequestInviteToMUCUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<RequestInviteToMUCUIEvent> ref; - - enum ImpromptuMode { - Impromptu, - NotImpromptu - }; - - RequestInviteToMUCUIEvent(const JID& room, const std::vector<JID>& JIDsToInvite, ImpromptuMode impromptu) : room_(room), invite_(JIDsToInvite) { - isImpromptu_ = impromptu == Impromptu; - } - - const JID& getRoom() const { - return room_; - } - - const std::vector<JID> getInvites() const { - return invite_; - } - - bool isImpromptu() const { - return isImpromptu_; - } - - private: - JID room_; - std::vector<JID> invite_; - bool isImpromptu_; - }; + class RequestInviteToMUCUIEvent : public UIEvent { + public: + typedef std::shared_ptr<RequestInviteToMUCUIEvent> ref; + + enum ImpromptuMode { + Impromptu, + NotImpromptu + }; + + /** + * @brief RequestInviteToMUCUIEvent + * @param originator This can be a MUC JID if the user wants to invite + * people to an existing MUC, or a contact JID if this is the + * start of an impromptu group chat. + * @param JIDsToInvite This is a std::vector of JIDs which are prefilled + * in the invite dialog. + * @param impromptu This flag indicates whether it is a normal MUC invite + * or an impromptu MUC invite. + */ + RequestInviteToMUCUIEvent(const JID& originator, const std::vector<JID>& JIDsToInvite, ImpromptuMode impromptu) : originator_(originator), invite_(JIDsToInvite) { + isImpromptu_ = impromptu == Impromptu; + } + + const JID& getOriginator() const { + return originator_; + } + + const std::vector<JID> getInvites() const { + return invite_; + } + + bool isImpromptu() const { + return isImpromptu_; + } + + private: + JID originator_; + std::vector<JID> invite_; + bool isImpromptu_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h b/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h index b592187..5e94290 100644 --- a/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h @@ -1,30 +1,31 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> -#include <Swift/Controllers/UIEvents/UIEvent.h> #include <Swiften/JID/JID.h> +#include <Swift/Controllers/UIEvents/UIEvent.h> + namespace Swift { - class RequestJoinMUCUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<RequestJoinMUCUIEvent> ref; + class RequestJoinMUCUIEvent : public UIEvent { + public: + typedef std::shared_ptr<RequestJoinMUCUIEvent> ref; - RequestJoinMUCUIEvent(const JID& room = JID()) : room(room) { - } + RequestJoinMUCUIEvent(const JID& room = JID()) : room(room) { + } - const JID& getRoom() const { - return room; - } + const JID& getRoom() const { + return room; + } - private: - JID room; - }; + private: + JID room; + }; } diff --git a/Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h b/Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h index a9aedd5..1a02af4 100644 --- a/Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestProfileEditorUIEvent.h @@ -1,16 +1,16 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestProfileEditorUIEvent : public UIEvent { - public: - RequestProfileEditorUIEvent() {} - }; + class RequestProfileEditorUIEvent : public UIEvent { + public: + RequestProfileEditorUIEvent() {} + }; } diff --git a/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h b/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h index 5c44da7..9c2b01d 100644 --- a/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h @@ -4,18 +4,24 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include "Swiften/JID/JID.h" +#include <Swiften/JID/JID.h> -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestWhiteboardUIEvent : public UIEvent { - public: - RequestWhiteboardUIEvent(const JID& contact) : contact_(contact) {} - const JID& getContact() const {return contact_;} - private: - JID contact_; - }; + class RequestWhiteboardUIEvent : public UIEvent { + public: + RequestWhiteboardUIEvent(const JID& contact) : contact_(contact) {} + const JID& getContact() const {return contact_;} + private: + JID contact_; + }; } diff --git a/Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h b/Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h index 12b8deb..4d780be 100644 --- a/Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h @@ -1,14 +1,14 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class RequestXMLConsoleUIEvent : public UIEvent { - }; + class RequestXMLConsoleUIEvent : public UIEvent { + }; } diff --git a/Swift/Controllers/UIEvents/SendFileUIEvent.h b/Swift/Controllers/UIEvents/SendFileUIEvent.h index 3bfa69d..26e4940 100644 --- a/Swift/Controllers/UIEvents/SendFileUIEvent.h +++ b/Swift/Controllers/UIEvents/SendFileUIEvent.h @@ -4,31 +4,38 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include <string> #include <Swiften/JID/JID.h> + #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class SendFileUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<SendFileUIEvent> ref; - - SendFileUIEvent(const JID& jid, const std::string& filename) : jid(jid), filename(filename) { - } - - const JID& getJID() const { - return jid; - } - - const std::string& getFilename() const { - return filename; - } - - private: - JID jid; - std::string filename; - }; + class SendFileUIEvent : public UIEvent { + public: + typedef std::shared_ptr<SendFileUIEvent> ref; + + SendFileUIEvent(const JID& jid, const std::string& filename) : jid(jid), filename(filename) { + } + + const JID& getJID() const { + return jid; + } + + const std::string& getFilename() const { + return filename; + } + + private: + JID jid; + std::string filename; + }; } diff --git a/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h b/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h index 4a603ea..9b2f60f 100644 --- a/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h @@ -4,22 +4,29 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include <Swiften/JID/JID.h> + #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { class ShowProfileForRosterItemUIEvent : public UIEvent { - public: - typedef boost::shared_ptr<ShowProfileForRosterItemUIEvent> ref; - public: - ShowProfileForRosterItemUIEvent(const JID& jid) : jid_(jid) {} - virtual ~ShowProfileForRosterItemUIEvent() {} - JID getJID() const {return jid_;} - private: - JID jid_; + public: + typedef std::shared_ptr<ShowProfileForRosterItemUIEvent> ref; + public: + ShowProfileForRosterItemUIEvent(const JID& jid) : jid_(jid) {} + virtual ~ShowProfileForRosterItemUIEvent() {} + JID getJID() const {return jid_;} + private: + JID jid_; }; } diff --git a/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h b/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h index bb72d9b..a1b6efb 100644 --- a/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h +++ b/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h @@ -4,19 +4,25 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include "Swiften/JID/JID.h" +#include <Swiften/JID/JID.h> -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class ShowWhiteboardUIEvent : public UIEvent { - public: - ShowWhiteboardUIEvent(const JID& contact) : contact_(contact) {} - const JID& getContact() const {return contact_;} - private: - JID contact_; - }; + class ShowWhiteboardUIEvent : public UIEvent { + public: + ShowWhiteboardUIEvent(const JID& contact) : contact_(contact) {} + const JID& getContact() const {return contact_;} + private: + JID contact_; + }; } diff --git a/Swift/Controllers/UIEvents/UIEvent.cpp b/Swift/Controllers/UIEvents/UIEvent.cpp index 4827332..b1e870d 100644 --- a/Swift/Controllers/UIEvents/UIEvent.cpp +++ b/Swift/Controllers/UIEvents/UIEvent.cpp @@ -1,10 +1,10 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { UIEvent::~UIEvent() { diff --git a/Swift/Controllers/UIEvents/UIEvent.h b/Swift/Controllers/UIEvents/UIEvent.h index 548f356..5363a49 100644 --- a/Swift/Controllers/UIEvents/UIEvent.h +++ b/Swift/Controllers/UIEvents/UIEvent.h @@ -1,18 +1,18 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> namespace Swift { - class UIEvent { - public: - typedef boost::shared_ptr<UIEvent> ref; + class UIEvent { + public: + typedef std::shared_ptr<UIEvent> ref; - virtual ~UIEvent(); - }; + virtual ~UIEvent(); + }; } diff --git a/Swift/Controllers/UIEvents/UIEventStream.h b/Swift/Controllers/UIEvents/UIEventStream.h index 31a5f1c..e6e3f80 100644 --- a/Swift/Controllers/UIEvents/UIEventStream.h +++ b/Swift/Controllers/UIEvents/UIEventStream.h @@ -1,23 +1,24 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include "Swiften/Base/boost_bsignals.h" -#include <boost/shared_ptr.hpp> +#include <memory> -#include "Swift/Controllers/UIEvents/UIEvent.h" +#include <boost/signals2.hpp> + +#include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { - class UIEventStream { - public: - boost::signal<void (boost::shared_ptr<UIEvent>)> onUIEvent; + class UIEventStream { + public: + boost::signals2::signal<void (std::shared_ptr<UIEvent>)> onUIEvent; - void send(boost::shared_ptr<UIEvent> event) { - onUIEvent(event); - } - }; + void send(std::shared_ptr<UIEvent> event) { + onUIEvent(event); + } + }; } |