PageRenderTime 89ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llviewermessage.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 256 lines | 165 code | 45 blank | 46 comment | 0 complexity | 69f4bc4e4255afd9d7332f06c232965d MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llviewermessage.h
  3. * @brief Message system callbacks for viewer.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLVIEWERMESSAGE_H
  27. #define LL_LLVIEWERMESSAGE_H
  28. #include "llassettype.h"
  29. #include "llinstantmessage.h"
  30. #include "llpointer.h"
  31. #include "lltransactiontypes.h"
  32. #include "lluuid.h"
  33. #include "message.h"
  34. #include "stdenums.h"
  35. #include "llnotifications.h"
  36. //
  37. // Forward declarations
  38. //
  39. class LLColor4;
  40. class LLInventoryObject;
  41. class LLInventoryItem;
  42. class LLMeanCollisionData;
  43. class LLMessageSystem;
  44. class LLVFS;
  45. class LLViewerObject;
  46. class LLViewerRegion;
  47. //
  48. // Prototypes
  49. //
  50. enum InventoryOfferResponse
  51. {
  52. IOR_ACCEPT,
  53. IOR_DECLINE,
  54. IOR_MUTE,
  55. IOR_SHOW
  56. };
  57. BOOL can_afford_transaction(S32 cost);
  58. void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE,
  59. S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null);
  60. void busy_message (LLMessageSystem* msg, LLUUID from_id);
  61. void process_logout_reply(LLMessageSystem* msg, void**);
  62. void process_layer_data(LLMessageSystem *mesgsys, void **user_data);
  63. void process_derez_ack(LLMessageSystem*, void**);
  64. void process_places_reply(LLMessageSystem* msg, void** data);
  65. void send_sound_trigger(const LLUUID& sound_id, F32 gain);
  66. void process_improved_im(LLMessageSystem *msg, void **user_data);
  67. void process_script_question(LLMessageSystem *msg, void **user_data);
  68. void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data);
  69. //void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data);
  70. void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE);
  71. void process_object_update(LLMessageSystem *mesgsys, void **user_data);
  72. void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data);
  73. void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data);
  74. void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data);
  75. void send_simulator_throttle_settings(const LLHost &host);
  76. void process_kill_object( LLMessageSystem *mesgsys, void **user_data);
  77. void process_time_synch( LLMessageSystem *mesgsys, void **user_data);
  78. void process_sound_trigger(LLMessageSystem *mesgsys, void **user_data);
  79. void process_preload_sound( LLMessageSystem *mesgsys, void **user_data);
  80. void process_attached_sound( LLMessageSystem *mesgsys, void **user_data);
  81. void process_attached_sound_gain_change( LLMessageSystem *mesgsys, void **user_data);
  82. void process_energy_statistics(LLMessageSystem *mesgsys, void **user_data);
  83. void process_health_message(LLMessageSystem *mesgsys, void **user_data);
  84. void process_sim_stats(LLMessageSystem *mesgsys, void **user_data);
  85. void process_shooter_agent_hit(LLMessageSystem* msg, void** user_data);
  86. void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data);
  87. void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data);
  88. void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data);
  89. void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data);
  90. void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data);
  91. void process_clear_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data);
  92. void process_name_value(LLMessageSystem *mesgsys, void **user_data);
  93. void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data);
  94. void process_kick_user(LLMessageSystem *msg, void** /*user_data*/);
  95. //void process_avatar_init_complete(LLMessageSystem *msg, void** /*user_data*/);
  96. void process_economy_data(LLMessageSystem *msg, void** /*user_data*/);
  97. void process_money_balance_reply(LLMessageSystem* msg_system, void**);
  98. void process_adjust_balance(LLMessageSystem* msg_system, void**);
  99. bool attempt_standard_notification(LLMessageSystem* msg);
  100. void process_alert_message(LLMessageSystem* msg, void**);
  101. void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data);
  102. void process_alert_core(const std::string& message, BOOL modal);
  103. // "Mean" or player-vs-player abuse
  104. typedef std::list<LLMeanCollisionData*> mean_collision_list_t;
  105. extern mean_collision_list_t gMeanCollisionList;
  106. void process_mean_collision_alert_message(LLMessageSystem* msg, void**);
  107. void process_frozen_message(LLMessageSystem* msg, void**);
  108. void process_derez_container(LLMessageSystem *msg, void**);
  109. void container_inventory_arrived(LLViewerObject* object,
  110. std::list<LLPointer<LLInventoryObject> >* inventory, //LLInventoryObject::object_list_t
  111. S32 serial_num,
  112. void* data);
  113. // agent movement
  114. void send_complete_agent_movement(const LLHost& sim_host);
  115. void process_agent_movement_complete(LLMessageSystem* msg, void**);
  116. void process_crossed_region(LLMessageSystem* msg, void**);
  117. void process_teleport_start(LLMessageSystem* msg, void**);
  118. void process_teleport_progress(LLMessageSystem* msg, void**);
  119. void process_teleport_failed(LLMessageSystem *msg,void**);
  120. void process_teleport_finish(LLMessageSystem *msg, void**);
  121. //void process_user_sim_location_reply(LLMessageSystem *msg,void**);
  122. void process_teleport_local(LLMessageSystem *msg,void**);
  123. void process_user_sim_location_reply(LLMessageSystem *msg,void**);
  124. void send_simple_im(const LLUUID& to_id,
  125. const std::string& message,
  126. EInstantMessage dialog = IM_NOTHING_SPECIAL,
  127. const LLUUID& id = LLUUID::null);
  128. void send_group_notice(const LLUUID& group_id,
  129. const std::string& subject,
  130. const std::string& message,
  131. const LLInventoryItem* item);
  132. void handle_lure(const LLUUID& invitee);
  133. void handle_lure(const uuid_vec_t& ids);
  134. // always from gAgent and
  135. // routes through the gAgent's current simulator
  136. void send_improved_im(const LLUUID& to_id,
  137. const std::string& name,
  138. const std::string& message,
  139. U8 offline = IM_ONLINE,
  140. EInstantMessage dialog = IM_NOTHING_SPECIAL,
  141. const LLUUID& id = LLUUID::null,
  142. U32 timestamp = NO_TIMESTAMP,
  143. const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET,
  144. S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE);
  145. void process_user_info_reply(LLMessageSystem* msg, void**);
  146. // method to format the time.
  147. std::string formatted_time(const time_t& the_time);
  148. void send_places_query(const LLUUID& query_id,
  149. const LLUUID& trans_id,
  150. const std::string& query_text,
  151. U32 query_flags,
  152. S32 category,
  153. const std::string& sim_name);
  154. void process_script_dialog(LLMessageSystem* msg, void**);
  155. void process_load_url(LLMessageSystem* msg, void**);
  156. void process_script_teleport_request(LLMessageSystem* msg, void**);
  157. void process_covenant_reply(LLMessageSystem* msg, void**);
  158. void onCovenantLoadComplete(LLVFS *vfs,
  159. const LLUUID& asset_uuid,
  160. LLAssetType::EType type,
  161. void* user_data, S32 status, LLExtStat ext_status);
  162. // calling cards
  163. void process_offer_callingcard(LLMessageSystem* msg, void**);
  164. void process_accept_callingcard(LLMessageSystem* msg, void**);
  165. void process_decline_callingcard(LLMessageSystem* msg, void**);
  166. // Message system exception prototypes
  167. void invalid_message_callback(LLMessageSystem*, void*, EMessageException);
  168. void process_initiate_download(LLMessageSystem* msg, void**);
  169. void start_new_inventory_observer();
  170. void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name);
  171. // Returns true if item is not in certain "quiet" folder which don't need UI
  172. // notification (e.g. trash, cof, lost-and-found) and agent is not AFK, false otherwise.
  173. // Returns false if item is not found.
  174. bool highlight_offered_object(const LLUUID& obj_id);
  175. void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid);
  176. void set_dad_inbox_object(const LLUUID& object_id);
  177. class LLOfferInfo : public LLNotificationResponderInterface
  178. {
  179. public:
  180. LLOfferInfo();
  181. LLOfferInfo(const LLSD& sd);
  182. LLOfferInfo(const LLOfferInfo& info);
  183. void forceResponse(InventoryOfferResponse response);
  184. EInstantMessage mIM;
  185. LLUUID mFromID;
  186. BOOL mFromGroup;
  187. BOOL mFromObject;
  188. LLUUID mTransactionID;
  189. LLUUID mFolderID;
  190. LLUUID mObjectID;
  191. LLAssetType::EType mType;
  192. std::string mFromName;
  193. std::string mDesc;
  194. LLHost mHost;
  195. bool mPersist;
  196. // LLNotificationResponderInterface implementation
  197. /*virtual*/ LLSD asLLSD();
  198. /*virtual*/ void fromLLSD(const LLSD& params);
  199. /*virtual*/ void handleRespond(const LLSD& notification, const LLSD& response);
  200. void send_auto_receive_response(void);
  201. // TODO - replace all references with handleRespond()
  202. bool inventory_offer_callback(const LLSD& notification, const LLSD& response);
  203. bool inventory_task_offer_callback(const LLSD& notification, const LLSD& response);
  204. private:
  205. void initRespondFunctionMap();
  206. typedef boost::function<bool (const LLSD&, const LLSD&)> respond_function_t;
  207. typedef std::map<std::string, respond_function_t> respond_function_map_t;
  208. respond_function_map_t mRespondFunctions;
  209. };
  210. void process_feature_disabled_message(LLMessageSystem* msg, void**);
  211. #endif