diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llimview.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llimview.h')
-rw-r--r-- | linden/indra/newview/llimview.h | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/linden/indra/newview/llimview.h b/linden/indra/newview/llimview.h new file mode 100644 index 0000000..00b052f --- /dev/null +++ b/linden/indra/newview/llimview.h | |||
@@ -0,0 +1,169 @@ | |||
1 | /** | ||
2 | * @file llimview.h | ||
3 | * @brief Container for Instant Messaging | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLIMVIEW_H | ||
29 | #define LL_LLIMVIEW_H | ||
30 | |||
31 | #include "llfloater.h" | ||
32 | #include "llinstantmessage.h" | ||
33 | #include "lluuid.h" | ||
34 | |||
35 | class LLFloaterNewIM; | ||
36 | class LLUUID; | ||
37 | class LLFloaterIMPanel; | ||
38 | class LLFriendObserver; | ||
39 | class LLFloaterIM; | ||
40 | |||
41 | class LLIMView : public LLView | ||
42 | { | ||
43 | public: | ||
44 | LLIMView(const std::string& name, const LLRect& rect); | ||
45 | ~LLIMView(); | ||
46 | |||
47 | virtual EWidgetType getWidgetType() const; | ||
48 | virtual LLString getWidgetTag() const; | ||
49 | |||
50 | // Add a message to a session. The session can keyed to sesion id | ||
51 | // or agent id. | ||
52 | void addMessage(const LLUUID& session_id, const LLUUID& target_id, | ||
53 | const char* from, const char* msg, | ||
54 | const char* session_name = NULL, | ||
55 | EInstantMessage dialog = IM_NOTHING_SPECIAL, | ||
56 | U32 parent_estate_id = 0, | ||
57 | const LLUUID& region_id = LLUUID::null, | ||
58 | const LLVector3& position = LLVector3::zero); | ||
59 | |||
60 | // This method returns TRUE if the local viewer has a session | ||
61 | // currently open keyed to the uuid. The uuid can be keyed by | ||
62 | // either session id or agent id. | ||
63 | BOOL isIMSessionOpen(const LLUUID& uuid); | ||
64 | |||
65 | // This adds a session to the talk view. The name is the local | ||
66 | // name of the session, dialog specifies the type of | ||
67 | // session. Since sessions can be keyed off of first recipient or | ||
68 | // initiator, the session can be matched against the id | ||
69 | // provided. If the session exists, it is brought forward. This | ||
70 | // method accepts a group id or an agent id. Specifying id = NULL | ||
71 | // results in an im session to everyone. Returns the uuid of the | ||
72 | // session. | ||
73 | LLUUID addSession(const std::string& name, | ||
74 | EInstantMessage dialog, | ||
75 | const LLUUID& other_participant_id); | ||
76 | |||
77 | // Adds a session using the given session_id. If the session already exists | ||
78 | // the dialog type is assumed correct. Returns the uuid of the session. | ||
79 | LLUUID addSession(const std::string& name, | ||
80 | EInstantMessage dialog, | ||
81 | const LLUUID& session_id, | ||
82 | const LLDynamicArray<LLUUID>& ids); | ||
83 | |||
84 | // This removes the panel referenced by the uuid, and then | ||
85 | // restores internal consistency. The internal pointer is not | ||
86 | // deleted. | ||
87 | void removeSession(const LLUUID& session_id); | ||
88 | |||
89 | void processIMTypingStart(const LLIMInfo* im_info); | ||
90 | void processIMTypingStop(const LLIMInfo* im_info); | ||
91 | |||
92 | // Rebuild stuff | ||
93 | void refresh(); | ||
94 | |||
95 | void notifyNewIM(); | ||
96 | |||
97 | // IM received that you haven't seen yet | ||
98 | BOOL getIMReceived() const; | ||
99 | |||
100 | void setFloaterOpen(BOOL open); | ||
101 | BOOL getFloaterOpen(); | ||
102 | |||
103 | LLFloaterIM * getFloater() { return mTalkFloater; } | ||
104 | |||
105 | // close any sessions which are not available in the newimpanel. | ||
106 | void pruneSessions(); | ||
107 | |||
108 | // This method is used to go through all active sessions and | ||
109 | // disable all of them. This method is usally called when you are | ||
110 | // forced to log out or similar situations where you do not have a | ||
111 | // good connection. | ||
112 | void disconnectAllSessions(); | ||
113 | |||
114 | static void toggle(void*); | ||
115 | |||
116 | // This is a helper function to determine what kind of im session | ||
117 | // should be used for the given agent. | ||
118 | static EInstantMessage defaultIMTypeForAgent(const LLUUID& agent_id); | ||
119 | |||
120 | BOOL hasSession(const LLUUID& session_id); | ||
121 | |||
122 | // This method returns the im panel corresponding to the uuid | ||
123 | // provided. The uuid must be a session id. Returns NULL if there | ||
124 | // is no matching panel. | ||
125 | LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); | ||
126 | |||
127 | private: | ||
128 | // create a panel and update internal representation for | ||
129 | // consistency. Returns the pointer, caller (the class instance | ||
130 | // since it is a private method) is not responsible for deleting | ||
131 | // the pointer. | ||
132 | LLFloaterIMPanel* createFloater(const LLUUID& session_id, const LLUUID& target_id, | ||
133 | const std::string& name, EInstantMessage dialog, BOOL user_initiated = FALSE); | ||
134 | |||
135 | // This simple method just iterates through all of the ids, and | ||
136 | // prints a simple message if they are not online. Used to help | ||
137 | // reduce 'hello' messages to the linden employees unlucky enough | ||
138 | // to have their calling card in the default inventory. | ||
139 | void noteOfflineUsers(LLFloaterIMPanel* panel, const LLDynamicArray<LLUUID>& ids); | ||
140 | |||
141 | void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); | ||
142 | |||
143 | public: | ||
144 | LLFloaterIM* mTalkFloater; | ||
145 | LLFloaterNewIM* mNewIMFloater; | ||
146 | |||
147 | private: | ||
148 | std::set<LLViewHandle> mFloaters; | ||
149 | LLFriendObserver* mFriendObserver; | ||
150 | |||
151 | // An IM has been received that you haven't seen yet. | ||
152 | BOOL mIMReceived; | ||
153 | }; | ||
154 | |||
155 | |||
156 | class LLFloaterIM : public LLMultiFloater | ||
157 | { | ||
158 | public: | ||
159 | LLFloaterIM(); | ||
160 | ///*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); | ||
161 | /*virtual*/ BOOL postBuild(); | ||
162 | /*virtual*/ void onClose(bool app_quitting); | ||
163 | /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainerCommon::END); | ||
164 | }; | ||
165 | |||
166 | // Globals | ||
167 | extern LLIMView *gIMView; | ||
168 | |||
169 | #endif // LL_LLIMView_H | ||