aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelgrouproles.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llpanelgrouproles.h
parentREADME.txt (diff)
downloadmeta-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/llpanelgrouproles.h')
-rw-r--r--linden/indra/newview/llpanelgrouproles.h316
1 files changed, 316 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelgrouproles.h b/linden/indra/newview/llpanelgrouproles.h
new file mode 100644
index 0000000..fda3d40
--- /dev/null
+++ b/linden/indra/newview/llpanelgrouproles.h
@@ -0,0 +1,316 @@
1/**
2 * @file llpanelgrouproles.h
3 * @brief Panel for roles information about a particular group.
4 *
5 * Copyright (c) 2006-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_LLPANELGROUPROLES_H
29#define LL_LLPANELGROUPROLES_H
30
31#include "llpanelgroup.h"
32
33class LLNameListCtrl;
34class LLPanelGroupSubTab;
35class LLPanelGroupMembersSubTab;
36class LLPanelGroupRolesSubTab;
37class LLPanelGroupActionsSubTab;
38class LLScrollListCtrl;
39class LLScrollListItem;
40
41// Forward declare for friend usage.
42//virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*);
43
44typedef std::map<std::string,LLUUID> icon_map_t;
45
46class LLPanelGroupRoles : public LLPanelGroupTab,
47 public LLPanelGroupTabObserver
48{
49public:
50 LLPanelGroupRoles(const std::string& name, const LLUUID& group_id);
51 virtual ~LLPanelGroupRoles();
52
53 // Allow sub tabs to ask for sibling controls.
54 friend class LLPanelGroupMembersSubTab;
55 friend class LLPanelGroupRolesSubTab;
56 friend class LLPanelGroupActionsSubTab;
57
58 virtual BOOL postBuild();
59 virtual BOOL isVisibleByAgent(LLAgent* agentp);
60
61 static void* createTab(void* data);
62 static void onClickSubTab(void*,bool);
63 void handleClickSubTab();
64
65 // Checks if the current tab needs to be applied, and tries to switch to the requested tab.
66 BOOL attemptTransition();
67
68 // Switches to the requested tab (will close() if requested is NULL)
69 void transitionToTab();
70
71 // Used by attemptTransition to query the user's response to a tab that needs to apply.
72 static void onNotifyCallback(S32 option, void* user_data);
73 void handleNotifyCallback(S32 option);
74 static void onModalClose(S32 option, void* user_data);
75
76 // Most of these messages are just passed on to the current sub-tab.
77 virtual LLString getHelpText() const;
78 virtual void activate();
79 virtual void deactivate();
80 virtual bool needsApply(LLString& mesg);
81 virtual BOOL hasModal();
82 virtual bool apply(LLString& mesg);
83 virtual void cancel();
84 virtual void update(LLGroupChange gc);
85
86 // PanelGroupTab observer trigger
87 virtual void tabChanged();
88
89protected:
90 LLPanelGroupTab* mCurrentTab;
91 LLPanelGroupTab* mRequestedTab;
92 LLTabContainerCommon* mSubTabContainer;
93 BOOL mFirstUse;
94 BOOL mIgnoreTransition;
95
96 LLString mDefaultNeedsApplyMesg;
97 LLString mWantApplyMesg;
98};
99
100class LLPanelGroupSubTab : public LLPanelGroupTab
101{
102public:
103 LLPanelGroupSubTab(const std::string& name, const LLUUID& group_id);
104 virtual ~LLPanelGroupSubTab();
105
106 virtual BOOL postBuild();
107
108 // This allows sub-tabs to collect child widgets from a higher level in the view hierarchy.
109 virtual BOOL postBuildSubTab(LLView* root) { return TRUE; }
110
111 static void onSearchKeystroke(LLLineEditor* caller, void* user_data);
112 void handleSearchKeystroke(LLLineEditor* caller);
113
114 static void onClickSearch(void*);
115 void handleClickSearch();
116 static void onClickShowAll(void*);
117 void handleClickShowAll();
118
119 virtual void setSearchFilter( const LLString& filter );
120
121 virtual void activate();
122 virtual void deactivate();
123
124 // Helper functions
125 bool matchesActionSearchFilter(std::string action);
126 void buildActionsList(LLScrollListCtrl* ctrl,
127 U64 allowed_by_some,
128 U64 allowed_by_all,
129 icon_map_t& icons,
130 void (*commit_callback)(LLUICtrl*,void*),
131 BOOL show_all,
132 BOOL filter,
133 BOOL is_owner_role);
134 void buildActionCategory(LLScrollListCtrl* ctrl,
135 U64 allowed_by_some,
136 U64 allowed_by_all,
137 LLRoleActionSet* action_set,
138 icon_map_t& icons,
139 void (*commit_callback)(LLUICtrl*,void*),
140 BOOL show_all,
141 BOOL filter,
142 BOOL is_owner_role);
143
144 void setFooterEnabled(BOOL enable);
145protected:
146 LLPanel* mHeader;
147 LLPanel* mFooter;
148
149 LLLineEditor* mSearchLineEditor;
150 LLButton* mSearchButton;
151 LLButton* mShowAllButton;
152
153 LLString mSearchFilter;
154
155 icon_map_t mActionIcons;
156
157 void setOthersVisible(BOOL b);
158};
159
160class LLPanelGroupMembersSubTab : public LLPanelGroupSubTab
161{
162public:
163 LLPanelGroupMembersSubTab(const std::string& name, const LLUUID& group_id);
164 virtual ~LLPanelGroupMembersSubTab();
165
166 virtual BOOL postBuildSubTab(LLView* root);
167
168 static void* createTab(void* data);
169
170 static void onMemberSelect(LLUICtrl*, void*);
171 void handleMemberSelect();
172
173 static void onMemberDoubleClick(void*);
174 void handleMemberDoubleClick();
175
176 static void onInviteMember(void*);
177 void handleInviteMember();
178
179 static void onEjectMembers(void*);
180 void handleEjectMembers();
181
182 static void onRoleCheck(LLUICtrl* check, void* user_data);
183 void handleRoleCheck(const LLUUID& role_id,
184 LLRoleMemberChangeType type);
185
186 void applyMemberChanges();
187 static void addOwnerCB(S32 option, void* data);
188
189 virtual void activate();
190 virtual void deactivate();
191 virtual void cancel();
192 virtual bool needsApply(LLString& mesg);
193 virtual bool apply(LLString& mesg);
194 virtual void update(LLGroupChange gc);
195 void updateMembers();
196
197 virtual void draw();
198
199protected:
200 typedef std::map<LLUUID, LLRoleMemberChangeType> role_change_data_map_t;
201 typedef std::map<LLUUID, role_change_data_map_t*>::iterator member_role_change_iter;
202 typedef std::map<LLUUID, role_change_data_map_t*> member_role_changes_map_t;
203
204 bool matchesSearchFilter(char* first, char* last);
205
206 U64 getAgentPowersBasedOnRoleChanges(const LLUUID& agent_id);
207 bool getRoleChangeType(const LLUUID& member_id,
208 const LLUUID& role_id,
209 LLRoleMemberChangeType& type);
210
211 LLNameListCtrl* mMembersList;
212 LLScrollListCtrl* mAssignedRolesList;
213 LLScrollListCtrl* mAllowedActionsList;
214 LLButton* mEjectBtn;
215
216 BOOL mChanged;
217 BOOL mPendingMemberUpdate;
218 BOOL mHasMatch;
219
220 member_role_changes_map_t mMemberRoleChangeData;
221 U32 mNumOwnerAdditions;
222
223 LLGroupMgrGroupData::member_iter mMemberProgress;
224};
225
226class LLPanelGroupRolesSubTab : public LLPanelGroupSubTab
227{
228public:
229 LLPanelGroupRolesSubTab(const std::string& name, const LLUUID& group_id);
230 virtual ~LLPanelGroupRolesSubTab();
231
232 virtual BOOL postBuildSubTab(LLView* root);
233
234 static void* createTab(void* data);
235
236 virtual void activate();
237 virtual void deactivate();
238 virtual bool needsApply(LLString& mesg);
239 virtual bool apply(LLString& mesg);
240 virtual void cancel();
241 bool matchesSearchFilter(std::string rolename, std::string roletitle);
242 virtual void update(LLGroupChange gc);
243
244 static void onRoleSelect(LLUICtrl*, void*);
245 void handleRoleSelect();
246 void buildMembersList();
247
248 static void onActionCheck(LLUICtrl*, void*);
249 void handleActionCheck(LLCheckBoxCtrl*, bool force=false);
250 static void addActionCB(S32 option, void* data);
251
252 static void onPropertiesKey(LLLineEditor*, void*);
253
254 static void onDescriptionCommit(LLUICtrl*, void*);
255
256 static void onMemberVisibilityChange(LLUICtrl*, void*);
257 void handleMemberVisibilityChange(bool value);
258
259 static void onCreateRole(void*);
260 void handleCreateRole();
261
262 static void onDeleteRole(void*);
263 void handleDeleteRole();
264
265 void saveRoleChanges();
266protected:
267 LLSD createRoleItem(const LLUUID& role_id,
268 std::string name,
269 std::string title,
270 S32 members);
271
272 LLScrollListCtrl* mRolesList;
273 LLNameListCtrl* mAssignedMembersList;
274 LLScrollListCtrl* mAllowedActionsList;
275
276 LLLineEditor* mRoleName;
277 LLLineEditor* mRoleTitle;
278 LLTextEditor* mRoleDescription;
279
280 LLCheckBoxCtrl* mMemberVisibleCheck;
281 LLButton* mDeleteRoleButton;
282 LLButton* mCreateRoleButton;
283
284 LLUUID mSelectedRole;
285 BOOL mHasRoleChange;
286 std::string mRemoveEveryoneTxt;
287};
288
289class LLPanelGroupActionsSubTab : public LLPanelGroupSubTab
290{
291public:
292 LLPanelGroupActionsSubTab(const std::string& name, const LLUUID& group_id);
293 virtual ~LLPanelGroupActionsSubTab();
294
295 virtual BOOL postBuildSubTab(LLView* root);
296
297 static void* createTab(void* data);
298
299 virtual void activate();
300 virtual void deactivate();
301 virtual bool needsApply(LLString& mesg);
302 virtual bool apply(LLString& mesg);
303 virtual void update(LLGroupChange gc);
304
305 static void onActionSelect(LLUICtrl*, void*);
306 void handleActionSelect();
307protected:
308 LLScrollListCtrl* mActionList;
309 LLScrollListCtrl* mActionRoles;
310 LLNameListCtrl* mActionMembers;
311
312 LLTextEditor* mActionDescription;
313};
314
315
316#endif // LL_LLPANELGROUPROLES_H