PageRenderTime 29ms CodeModel.GetById 2ms app.highlight 22ms RepoModel.GetById 2ms 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
  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
 27#ifndef LL_LLVIEWERMESSAGE_H
 28#define LL_LLVIEWERMESSAGE_H
 29
 30#include "llassettype.h"
 31#include "llinstantmessage.h"
 32#include "llpointer.h"
 33#include "lltransactiontypes.h"
 34#include "lluuid.h"
 35#include "message.h"
 36#include "stdenums.h"
 37#include "llnotifications.h"
 38
 39//
 40// Forward declarations
 41//
 42class LLColor4;
 43class LLInventoryObject;
 44class LLInventoryItem;
 45class LLMeanCollisionData;
 46class LLMessageSystem;
 47class LLVFS;
 48class LLViewerObject;
 49class LLViewerRegion;
 50
 51//
 52// Prototypes
 53//
 54
 55enum InventoryOfferResponse
 56{
 57	IOR_ACCEPT,
 58	IOR_DECLINE,
 59	IOR_MUTE,
 60	IOR_SHOW
 61};
 62
 63BOOL can_afford_transaction(S32 cost);
 64void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE,
 65				S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null);
 66void busy_message (LLMessageSystem* msg, LLUUID from_id);
 67
 68void process_logout_reply(LLMessageSystem* msg, void**);
 69void process_layer_data(LLMessageSystem *mesgsys, void **user_data);
 70void process_derez_ack(LLMessageSystem*, void**);
 71void process_places_reply(LLMessageSystem* msg, void** data);
 72void send_sound_trigger(const LLUUID& sound_id, F32 gain);
 73void process_improved_im(LLMessageSystem *msg, void **user_data);
 74void process_script_question(LLMessageSystem *msg, void **user_data);
 75void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data);
 76
 77//void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data);
 78void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE);
 79void process_object_update(LLMessageSystem *mesgsys, void **user_data);
 80void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data);
 81void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data);
 82void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_data);
 83
 84void send_simulator_throttle_settings(const LLHost &host);
 85void process_kill_object(	LLMessageSystem *mesgsys, void **user_data);
 86void process_time_synch(	LLMessageSystem *mesgsys, void **user_data);
 87void process_sound_trigger(LLMessageSystem *mesgsys, void **user_data);
 88void process_preload_sound(	LLMessageSystem *mesgsys, void **user_data);
 89void process_attached_sound(	LLMessageSystem *mesgsys, void **user_data);
 90void process_attached_sound_gain_change(	LLMessageSystem *mesgsys, void **user_data);
 91void process_energy_statistics(LLMessageSystem *mesgsys, void **user_data);
 92void process_health_message(LLMessageSystem *mesgsys, void **user_data);
 93void process_sim_stats(LLMessageSystem *mesgsys, void **user_data);
 94void process_shooter_agent_hit(LLMessageSystem* msg, void** user_data);
 95void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data);
 96void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data);
 97void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data);
 98void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data);
 99void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data);
100void process_clear_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data);
101void process_name_value(LLMessageSystem *mesgsys, void **user_data);
102void process_remove_name_value(LLMessageSystem *mesgsys, void **user_data);
103void process_kick_user(LLMessageSystem *msg, void** /*user_data*/);
104//void process_avatar_init_complete(LLMessageSystem *msg, void** /*user_data*/);
105
106void process_economy_data(LLMessageSystem *msg, void** /*user_data*/);
107void process_money_balance_reply(LLMessageSystem* msg_system, void**);
108void process_adjust_balance(LLMessageSystem* msg_system, void**);
109
110bool attempt_standard_notification(LLMessageSystem* msg);
111void process_alert_message(LLMessageSystem* msg, void**);
112void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data);
113void process_alert_core(const std::string& message, BOOL modal);
114
115// "Mean" or player-vs-player abuse
116typedef std::list<LLMeanCollisionData*> mean_collision_list_t;
117extern mean_collision_list_t gMeanCollisionList;
118
119void process_mean_collision_alert_message(LLMessageSystem* msg, void**);
120
121void process_frozen_message(LLMessageSystem* msg, void**);
122
123void process_derez_container(LLMessageSystem *msg, void**);
124void container_inventory_arrived(LLViewerObject* object,
125								 std::list<LLPointer<LLInventoryObject> >* inventory, //LLInventoryObject::object_list_t
126								 S32 serial_num,
127								 void* data);
128
129// agent movement
130void send_complete_agent_movement(const LLHost& sim_host);
131void process_agent_movement_complete(LLMessageSystem* msg, void**);
132void process_crossed_region(LLMessageSystem* msg, void**);
133void process_teleport_start(LLMessageSystem* msg, void**);
134void process_teleport_progress(LLMessageSystem* msg, void**);
135void process_teleport_failed(LLMessageSystem *msg,void**);
136void process_teleport_finish(LLMessageSystem *msg, void**);
137
138//void process_user_sim_location_reply(LLMessageSystem *msg,void**);
139void process_teleport_local(LLMessageSystem *msg,void**);
140void process_user_sim_location_reply(LLMessageSystem *msg,void**);
141
142void send_simple_im(const LLUUID& to_id,
143					const std::string& message,
144					EInstantMessage dialog = IM_NOTHING_SPECIAL,
145					const LLUUID& id = LLUUID::null);
146
147void send_group_notice(const LLUUID& group_id,
148					   const std::string& subject,
149					   const std::string& message,
150					   const LLInventoryItem* item);
151
152void handle_lure(const LLUUID& invitee);
153void handle_lure(const uuid_vec_t& ids);
154
155// always from gAgent and 
156// routes through the gAgent's current simulator
157void send_improved_im(const LLUUID& to_id,
158					const std::string& name,
159					const std::string& message,
160					U8 offline = IM_ONLINE,
161					EInstantMessage dialog = IM_NOTHING_SPECIAL,
162					const LLUUID& id = LLUUID::null,
163					U32 timestamp = NO_TIMESTAMP, 
164					const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET,
165					S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE);
166
167void process_user_info_reply(LLMessageSystem* msg, void**);
168
169// method to format the time. 
170std::string formatted_time(const time_t& the_time);
171
172void send_places_query(const LLUUID& query_id,
173					   const LLUUID& trans_id,
174					   const std::string& query_text,
175					   U32 query_flags,
176					   S32 category, 
177					   const std::string& sim_name);
178void process_script_dialog(LLMessageSystem* msg, void**);
179void process_load_url(LLMessageSystem* msg, void**);
180void process_script_teleport_request(LLMessageSystem* msg, void**);
181void process_covenant_reply(LLMessageSystem* msg, void**);
182void onCovenantLoadComplete(LLVFS *vfs,
183							const LLUUID& asset_uuid,
184							LLAssetType::EType type,
185							void* user_data, S32 status, LLExtStat ext_status);
186
187// calling cards
188void process_offer_callingcard(LLMessageSystem* msg, void**);
189void process_accept_callingcard(LLMessageSystem* msg, void**);
190void process_decline_callingcard(LLMessageSystem* msg, void**);
191
192// Message system exception prototypes
193void invalid_message_callback(LLMessageSystem*, void*, EMessageException);
194
195void process_initiate_download(LLMessageSystem* msg, void**);
196void start_new_inventory_observer();
197void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name);
198
199// Returns true if item is not in certain "quiet" folder which don't need UI
200// notification (e.g. trash, cof, lost-and-found) and agent is not AFK, false otherwise.
201// Returns false if item is not found.
202bool highlight_offered_object(const LLUUID& obj_id);
203
204void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid);
205void set_dad_inbox_object(const LLUUID& object_id);
206
207
208class LLOfferInfo : public LLNotificationResponderInterface
209{
210public:
211	LLOfferInfo();
212	LLOfferInfo(const LLSD& sd);
213
214	LLOfferInfo(const LLOfferInfo& info);
215
216	void forceResponse(InventoryOfferResponse response);
217
218	EInstantMessage mIM;
219	LLUUID mFromID;
220	BOOL mFromGroup;
221	BOOL mFromObject;
222	LLUUID mTransactionID;
223	LLUUID mFolderID;
224	LLUUID mObjectID;
225	LLAssetType::EType mType;
226	std::string mFromName;
227	std::string mDesc;
228	LLHost mHost;
229	bool mPersist;
230
231	// LLNotificationResponderInterface implementation
232	/*virtual*/ LLSD asLLSD();
233	/*virtual*/ void fromLLSD(const LLSD& params);
234	/*virtual*/ void handleRespond(const LLSD& notification, const LLSD& response);
235
236	void send_auto_receive_response(void);
237
238	// TODO - replace all references with handleRespond()
239	bool inventory_offer_callback(const LLSD& notification, const LLSD& response);
240	bool inventory_task_offer_callback(const LLSD& notification, const LLSD& response);
241
242private:
243
244	void initRespondFunctionMap();
245
246	typedef boost::function<bool (const LLSD&, const LLSD&)> respond_function_t;
247	typedef std::map<std::string, respond_function_t> respond_function_map_t;
248
249	respond_function_map_t mRespondFunctions;
250};
251
252void process_feature_disabled_message(LLMessageSystem* msg, void**);
253
254#endif
255
256