diff options
Diffstat (limited to 'Swift/Controllers/Chat/UserSearchController.h')
| -rw-r--r-- | Swift/Controllers/Chat/UserSearchController.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.h b/Swift/Controllers/Chat/UserSearchController.h index 3c45c04..0423a65 100644 --- a/Swift/Controllers/Chat/UserSearchController.h +++ b/Swift/Controllers/Chat/UserSearchController.h | |||
| @@ -1,29 +1,30 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2014 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #pragma once | 7 | #pragma once |
| 8 | 8 | ||
| 9 | #include <boost/shared_ptr.hpp> | ||
| 10 | |||
| 11 | #include <map> | 9 | #include <map> |
| 12 | #include <vector> | ||
| 13 | #include <string> | 10 | #include <string> |
| 11 | #include <vector> | ||
| 12 | |||
| 13 | #include <boost/shared_ptr.hpp> | ||
| 14 | 14 | ||
| 15 | #include <Swift/Controllers/Contact.h> | ||
| 16 | #include <Swiften/Base/boost_bsignals.h> | 15 | #include <Swiften/Base/boost_bsignals.h> |
| 17 | #include <Swiften/Elements/DiscoInfo.h> | 16 | #include <Swiften/Elements/DiscoInfo.h> |
| 18 | #include <Swiften/Elements/DiscoItems.h> | 17 | #include <Swiften/Elements/DiscoItems.h> |
| 19 | #include <Swiften/Elements/ErrorPayload.h> | 18 | #include <Swiften/Elements/ErrorPayload.h> |
| 20 | #include <Swiften/Elements/Presence.h> | 19 | #include <Swiften/Elements/Presence.h> |
| 21 | #include <Swiften/Elements/SearchPayload.h> | 20 | #include <Swiften/Elements/SearchPayload.h> |
| 22 | #include <Swiften/Elements/VCard.h> | 21 | #include <Swiften/Elements/VCard.h> |
| 23 | #include <Swiften/JID/JID.h> | 22 | #include <Swiften/JID/JID.h> |
| 24 | 23 | ||
| 24 | #include <Swift/Controllers/Contact.h> | ||
| 25 | |||
| 25 | namespace Swift { | 26 | namespace Swift { |
| 26 | class UIEventStream; | 27 | class UIEventStream; |
| 27 | class UIEvent; | 28 | class UIEvent; |
| 28 | class UserSearchWindow; | 29 | class UserSearchWindow; |
| 29 | class UserSearchWindowFactory; | 30 | class UserSearchWindowFactory; |
| @@ -32,10 +33,11 @@ namespace Swift { | |||
| 32 | class RosterController; | 33 | class RosterController; |
| 33 | class VCardManager; | 34 | class VCardManager; |
| 34 | class ContactSuggester; | 35 | class ContactSuggester; |
| 35 | class AvatarManager; | 36 | class AvatarManager; |
| 36 | class PresenceOracle; | 37 | class PresenceOracle; |
| 38 | class ProfileSettingsProvider; | ||
| 37 | 39 | ||
| 38 | class UserSearchResult { | 40 | class UserSearchResult { |
| 39 | public: | 41 | public: |
| 40 | UserSearchResult(const JID& jid, const std::map<std::string, std::string>& fields) : jid_(jid), fields_(fields) {} | 42 | UserSearchResult(const JID& jid, const std::map<std::string, std::string>& fields) : jid_(jid), fields_(fields) {} |
| 41 | const JID& getJID() const {return jid_;} | 43 | const JID& getJID() const {return jid_;} |
| @@ -46,11 +48,11 @@ namespace Swift { | |||
| 46 | }; | 48 | }; |
| 47 | 49 | ||
| 48 | class UserSearchController { | 50 | class UserSearchController { |
| 49 | public: | 51 | public: |
| 50 | enum Type {AddContact, StartChat, InviteToChat}; | 52 | enum Type {AddContact, StartChat, InviteToChat}; |
| 51 | UserSearchController(Type type, const JID& jid, UIEventStream* uiEventStream, VCardManager* vcardManager, UserSearchWindowFactory* userSearchWindowFactory, IQRouter* iqRouter, RosterController* rosterController, ContactSuggester* contactSuggester, AvatarManager* avatarManager, PresenceOracle* presenceOracle); | 53 | UserSearchController(Type type, const JID& jid, UIEventStream* uiEventStream, VCardManager* vcardManager, UserSearchWindowFactory* userSearchWindowFactory, IQRouter* iqRouter, RosterController* rosterController, ContactSuggester* contactSuggester, AvatarManager* avatarManager, PresenceOracle* presenceOracle, ProfileSettingsProvider* settings); |
| 52 | ~UserSearchController(); | 54 | ~UserSearchController(); |
| 53 | 55 | ||
| 54 | UserSearchWindow* getUserSearchWindow(); | 56 | UserSearchWindow* getUserSearchWindow(); |
| 55 | void setCanInitiateImpromptuMUC(bool supportsImpromptu); | 57 | void setCanInitiateImpromptuMUC(bool supportsImpromptu); |
| 56 | 58 | ||
| @@ -72,10 +74,13 @@ namespace Swift { | |||
| 72 | void handleJIDEditingFinished(const JID& jid); | 74 | void handleJIDEditingFinished(const JID& jid); |
| 73 | Contact::ref convertJIDtoContact(const JID& jid); | 75 | Contact::ref convertJIDtoContact(const JID& jid); |
| 74 | void endDiscoWalker(); | 76 | void endDiscoWalker(); |
| 75 | void initializeUserWindow(); | 77 | void initializeUserWindow(); |
| 76 | 78 | ||
| 79 | void loadSavedDirectories(); | ||
| 80 | void addToSavedDirectories(const JID& jid); | ||
| 81 | |||
| 77 | private: | 82 | private: |
| 78 | Type type_; | 83 | Type type_; |
| 79 | JID jid_; | 84 | JID jid_; |
| 80 | JID suggestionsJID_; | 85 | JID suggestionsJID_; |
| 81 | UIEventStream* uiEventStream_; | 86 | UIEventStream* uiEventStream_; |
| @@ -86,7 +91,9 @@ namespace Swift { | |||
| 86 | UserSearchWindow* window_; | 91 | UserSearchWindow* window_; |
| 87 | DiscoServiceWalker* discoWalker_; | 92 | DiscoServiceWalker* discoWalker_; |
| 88 | ContactSuggester* contactSuggester_; | 93 | ContactSuggester* contactSuggester_; |
| 89 | AvatarManager* avatarManager_; | 94 | AvatarManager* avatarManager_; |
| 90 | PresenceOracle* presenceOracle_; | 95 | PresenceOracle* presenceOracle_; |
| 96 | std::vector<JID> savedDirectories_; | ||
| 97 | ProfileSettingsProvider* settings_; | ||
| 91 | }; | 98 | }; |
| 92 | } | 99 | } |
Swift