PageRenderTime 882ms CodeModel.GetById 208ms app.highlight 329ms RepoModel.GetById 189ms app.codeStats 0ms

/indra/newview/llavatarlistitem.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 649 lines | 466 code | 110 blank | 73 comment | 45 complexity | 0fa427b97b05342bf39b37919559ad61 MD5 | raw file
  1/** 
  2 * @file llavatarlistitem.cpp
  3 * @brief avatar list item source file
  4 *
  5 * $LicenseInfo:firstyear=2009&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
 28#include "llviewerprecompiledheaders.h"
 29
 30#include "llavataractions.h"
 31#include "llavatarlistitem.h"
 32
 33#include "llbutton.h"
 34#include "llfloaterreg.h"
 35#include "lltextutil.h"
 36
 37#include "llagent.h"
 38#include "llavatarnamecache.h"
 39#include "llavatariconctrl.h"
 40#include "lloutputmonitorctrl.h"
 41
 42bool LLAvatarListItem::sStaticInitialized = false;
 43S32 LLAvatarListItem::sLeftPadding = 0;
 44S32 LLAvatarListItem::sNameRightPadding = 0;
 45S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT];
 46
 47static LLWidgetNameRegistry::StaticRegistrar sRegisterAvatarListItemParams(&typeid(LLAvatarListItem::Params), "avatar_list_item");
 48
 49LLAvatarListItem::Params::Params()
 50:	default_style("default_style"),
 51	voice_call_invited_style("voice_call_invited_style"),
 52	voice_call_joined_style("voice_call_joined_style"),
 53	voice_call_left_style("voice_call_left_style"),
 54	online_style("online_style"),
 55	offline_style("offline_style"),
 56	name_right_pad("name_right_pad", 0)
 57{};
 58
 59
 60LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
 61:	LLPanel(),
 62	mAvatarIcon(NULL),
 63	mAvatarName(NULL),
 64	mLastInteractionTime(NULL),
 65	mIconPermissionOnline(NULL),
 66	mIconPermissionMap(NULL),
 67	mIconPermissionEditMine(NULL),
 68	mIconPermissionEditTheirs(NULL),
 69	mSpeakingIndicator(NULL),
 70	mInfoBtn(NULL),
 71	mProfileBtn(NULL),
 72	mOnlineStatus(E_UNKNOWN),
 73	mShowInfoBtn(true),
 74	mShowProfileBtn(true),
 75	mShowPermissions(false),
 76	mHovered(false)
 77{
 78	if (not_from_ui_factory)
 79	{
 80		buildFromFile("panel_avatar_list_item.xml");
 81	}
 82	// *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance
 83	// is created from the UICtrlFactory
 84}
 85
 86LLAvatarListItem::~LLAvatarListItem()
 87{
 88	if (mAvatarId.notNull())
 89		LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this);
 90}
 91
 92BOOL  LLAvatarListItem::postBuild()
 93{
 94	mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
 95	mAvatarName = getChild<LLTextBox>("avatar_name");
 96	mLastInteractionTime = getChild<LLTextBox>("last_interaction");
 97
 98	mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon");
 99	mIconPermissionMap = getChild<LLIconCtrl>("permission_map_icon");
100	mIconPermissionEditMine = getChild<LLIconCtrl>("permission_edit_mine_icon");
101	mIconPermissionEditTheirs = getChild<LLIconCtrl>("permission_edit_theirs_icon");
102	mIconPermissionOnline->setVisible(false);
103	mIconPermissionMap->setVisible(false);
104	mIconPermissionEditMine->setVisible(false);
105	mIconPermissionEditTheirs->setVisible(false);
106
107	mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
108	mInfoBtn = getChild<LLButton>("info_btn");
109	mProfileBtn = getChild<LLButton>("profile_btn");
110
111	mInfoBtn->setVisible(false);
112	mInfoBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onInfoBtnClick, this));
113
114	mProfileBtn->setVisible(false);
115	mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this));
116
117	if (!sStaticInitialized)
118	{
119		// Remember children widths including their padding from the next sibling,
120		// so that we can hide and show them again later.
121		initChildrenWidths(this);
122
123		// Right padding between avatar name text box and nearest visible child.
124		sNameRightPadding = LLUICtrlFactory::getDefaultParams<LLAvatarListItem>().name_right_pad;
125
126		sStaticInitialized = true;
127	}
128
129	return TRUE;
130}
131
132S32 LLAvatarListItem::notifyParent(const LLSD& info)
133{
134	if (info.has("visibility_changed"))
135	{
136		updateChildren();
137		return 1;
138	}
139	return LLPanel::notifyParent(info);
140}
141
142void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
143{
144	getChildView("hovered_icon")->setVisible( true);
145	mInfoBtn->setVisible(mShowInfoBtn);
146	mProfileBtn->setVisible(mShowProfileBtn);
147
148	mHovered = true;
149	LLPanel::onMouseEnter(x, y, mask);
150
151	showPermissions(mShowPermissions);
152	updateChildren();
153}
154
155void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask)
156{
157	getChildView("hovered_icon")->setVisible( false);
158	mInfoBtn->setVisible(false);
159	mProfileBtn->setVisible(false);
160
161	mHovered = false;
162	LLPanel::onMouseLeave(x, y, mask);
163
164	showPermissions(false);
165	updateChildren();
166}
167
168// virtual, called by LLAvatarTracker
169void LLAvatarListItem::changed(U32 mask)
170{
171	// no need to check mAvatarId for null in this case
172	setOnline(LLAvatarTracker::instance().isBuddyOnline(mAvatarId));
173
174	if (mask & LLFriendObserver::POWERS)
175	{
176		showPermissions(mShowPermissions && mHovered);
177		updateChildren();
178	}
179}
180
181void LLAvatarListItem::setOnline(bool online)
182{
183	// *FIX: setName() overrides font style set by setOnline(). Not an issue ATM.
184
185	if (mOnlineStatus != E_UNKNOWN && (bool) mOnlineStatus == online)
186		return;
187
188	mOnlineStatus = (EOnlineStatus) online;
189
190	// Change avatar name font style depending on the new online status.
191	setState(online ? IS_ONLINE : IS_OFFLINE);
192}
193
194void LLAvatarListItem::setAvatarName(const std::string& name)
195{
196	setNameInternal(name, mHighlihtSubstring);
197}
198
199void LLAvatarListItem::setAvatarToolTip(const std::string& tooltip)
200{
201	mAvatarName->setToolTip(tooltip);
202}
203
204void LLAvatarListItem::setHighlight(const std::string& highlight)
205{
206	setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight);
207}
208
209void LLAvatarListItem::setState(EItemState item_style)
210{
211	const LLAvatarListItem::Params& params = LLUICtrlFactory::getDefaultParams<LLAvatarListItem>();
212
213	switch(item_style)
214	{
215	default:
216	case IS_DEFAULT:
217		mAvatarNameStyle = params.default_style();
218		break;
219	case IS_VOICE_INVITED:
220		mAvatarNameStyle = params.voice_call_invited_style();
221		break;
222	case IS_VOICE_JOINED:
223		mAvatarNameStyle = params.voice_call_joined_style();
224		break;
225	case IS_VOICE_LEFT:
226		mAvatarNameStyle = params.voice_call_left_style();
227		break;
228	case IS_ONLINE:
229		mAvatarNameStyle = params.online_style();
230		break;
231	case IS_OFFLINE:
232		mAvatarNameStyle = params.offline_style();
233		break;
234	}
235
236	// *NOTE: You cannot set the style on a text box anymore, you must
237	// rebuild the text.  This will cause problems if the text contains
238	// hyperlinks, as their styles will be wrong.
239	setNameInternal(mAvatarName->getText(), mHighlihtSubstring);
240
241	icon_color_map_t& item_icon_color_map = getItemIconColorMap();
242	mAvatarIcon->setColor(item_icon_color_map[item_style]);
243}
244
245void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes/* = false*/, bool is_resident/* = true*/)
246{
247	if (mAvatarId.notNull())
248		LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this);
249
250	mAvatarId = id;
251	mSpeakingIndicator->setSpeakerId(id, session_id);
252
253	// We'll be notified on avatar online status changes
254	if (!ignore_status_changes && mAvatarId.notNull())
255		LLAvatarTracker::instance().addParticularFriendObserver(mAvatarId, this);
256
257	if (is_resident)
258	{
259		mAvatarIcon->setValue(id);
260
261		// Set avatar name.
262		LLAvatarNameCache::get(id,
263			boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
264	}
265}
266
267void LLAvatarListItem::showLastInteractionTime(bool show)
268{
269	mLastInteractionTime->setVisible(show);
270	updateChildren();
271}
272
273void LLAvatarListItem::setLastInteractionTime(U32 secs_since)
274{
275	mLastInteractionTime->setValue(formatSeconds(secs_since));
276}
277
278void LLAvatarListItem::setShowInfoBtn(bool show)
279{
280	mShowInfoBtn = show;
281}
282
283void LLAvatarListItem::setShowProfileBtn(bool show)
284{
285	mShowProfileBtn = show;
286}
287
288void LLAvatarListItem::showSpeakingIndicator(bool visible)
289{
290	// Already done? Then do nothing.
291	if (mSpeakingIndicator->getVisible() == (BOOL)visible)
292		return;
293// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976
294// probably this method should be totally removed.
295//	mSpeakingIndicator->setVisible(visible);
296//	updateChildren();
297}
298
299void LLAvatarListItem::setAvatarIconVisible(bool visible)
300{
301	// Already done? Then do nothing.
302	if (mAvatarIcon->getVisible() == (BOOL)visible)
303	{
304		return;
305	}
306
307	// Show/hide avatar icon.
308	mAvatarIcon->setVisible(visible);
309	updateChildren();
310}
311
312void LLAvatarListItem::onInfoBtnClick()
313{
314	LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId));
315}
316
317void LLAvatarListItem::onProfileBtnClick()
318{
319	LLAvatarActions::showProfile(mAvatarId);
320}
321
322BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask)
323{
324	if(mInfoBtn->getRect().pointInRect(x, y))
325	{
326		onInfoBtnClick();
327		return TRUE;
328	}
329	if(mProfileBtn->getRect().pointInRect(x, y))
330	{
331		onProfileBtnClick();
332		return TRUE;
333	}
334	return LLPanel::handleDoubleClick(x, y, mask);
335}
336
337void LLAvatarListItem::setValue( const LLSD& value )
338{
339	if (!value.isMap()) return;;
340	if (!value.has("selected")) return;
341	getChildView("selected_icon")->setVisible( value["selected"]);
342}
343
344const LLUUID& LLAvatarListItem::getAvatarId() const
345{
346	return mAvatarId;
347}
348
349std::string LLAvatarListItem::getAvatarName() const
350{
351	return mAvatarName->getValue();
352}
353
354std::string LLAvatarListItem::getAvatarToolTip() const
355{
356	return mAvatarName->getToolTip();
357}
358
359void LLAvatarListItem::updateAvatarName()
360{
361	LLAvatarNameCache::get(getAvatarId(),
362			boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
363}
364
365//== PRIVATE SECITON ==========================================================
366
367void LLAvatarListItem::setNameInternal(const std::string& name, const std::string& highlight)
368{
369	LLTextUtil::textboxSetHighlightedVal(mAvatarName, mAvatarNameStyle, name, highlight);
370}
371
372void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name)
373{
374	setAvatarName(av_name.mDisplayName);
375	setAvatarToolTip(av_name.mUsername);
376
377	//requesting the list to resort
378	notifyParent(LLSD().with("sort", LLSD()));
379}
380
381// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years",
382// taking i18n into account. The format string to use is taken from the panel XML.
383std::string LLAvatarListItem::formatSeconds(U32 secs)
384{
385	static const U32 LL_ALI_MIN		= 60;
386	static const U32 LL_ALI_HOUR	= LL_ALI_MIN	* 60;
387	static const U32 LL_ALI_DAY		= LL_ALI_HOUR	* 24;
388	static const U32 LL_ALI_WEEK	= LL_ALI_DAY	* 7;
389	static const U32 LL_ALI_MONTH	= LL_ALI_DAY	* 30;
390	static const U32 LL_ALI_YEAR	= LL_ALI_DAY	* 365;
391
392	std::string fmt; 
393	U32 count = 0;
394
395	if (secs >= LL_ALI_YEAR)
396	{
397		fmt = "FormatYears"; count = secs / LL_ALI_YEAR;
398	}
399	else if (secs >= LL_ALI_MONTH)
400	{
401		fmt = "FormatMonths"; count = secs / LL_ALI_MONTH;
402	}
403	else if (secs >= LL_ALI_WEEK)
404	{
405		fmt = "FormatWeeks"; count = secs / LL_ALI_WEEK;
406	}
407	else if (secs >= LL_ALI_DAY)
408	{
409		fmt = "FormatDays"; count = secs / LL_ALI_DAY;
410	}
411	else if (secs >= LL_ALI_HOUR)
412	{
413		fmt = "FormatHours"; count = secs / LL_ALI_HOUR;
414	}
415	else if (secs >= LL_ALI_MIN)
416	{
417		fmt = "FormatMinutes"; count = secs / LL_ALI_MIN;
418	}
419	else
420	{
421		fmt = "FormatSeconds"; count = secs;
422	}
423
424	LLStringUtil::format_map_t args;
425	args["[COUNT]"] = llformat("%u", count);
426	return getString(fmt, args);
427}
428
429// static
430LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap()
431{
432	static icon_color_map_t item_icon_color_map;
433	if (!item_icon_color_map.empty()) return item_icon_color_map;
434
435	item_icon_color_map.insert(
436		std::make_pair(IS_DEFAULT,
437		LLUIColorTable::instance().getColor("AvatarListItemIconDefaultColor", LLColor4::white)));
438
439	item_icon_color_map.insert(
440		std::make_pair(IS_VOICE_INVITED,
441		LLUIColorTable::instance().getColor("AvatarListItemIconVoiceInvitedColor", LLColor4::white)));
442
443	item_icon_color_map.insert(
444		std::make_pair(IS_VOICE_JOINED,
445		LLUIColorTable::instance().getColor("AvatarListItemIconVoiceJoinedColor", LLColor4::white)));
446
447	item_icon_color_map.insert(
448		std::make_pair(IS_VOICE_LEFT,
449		LLUIColorTable::instance().getColor("AvatarListItemIconVoiceLeftColor", LLColor4::white)));
450
451	item_icon_color_map.insert(
452		std::make_pair(IS_ONLINE,
453		LLUIColorTable::instance().getColor("AvatarListItemIconOnlineColor", LLColor4::white)));
454
455	item_icon_color_map.insert(
456		std::make_pair(IS_OFFLINE,
457		LLUIColorTable::instance().getColor("AvatarListItemIconOfflineColor", LLColor4::white)));
458
459	return item_icon_color_map;
460}
461
462// static
463void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
464{
465	//speaking indicator width + padding
466	S32 speaking_indicator_width = avatar_item->getRect().getWidth() - avatar_item->mSpeakingIndicator->getRect().mLeft;
467
468	//profile btn width + padding
469	S32 profile_btn_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mProfileBtn->getRect().mLeft;
470
471	//info btn width + padding
472	S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft;
473
474	// online permission icon width + padding
475	S32 permission_online_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mIconPermissionOnline->getRect().mLeft;
476
477	// map permission icon width + padding
478	S32 permission_map_width = avatar_item->mIconPermissionOnline->getRect().mLeft - avatar_item->mIconPermissionMap->getRect().mLeft;
479
480	// edit my objects permission icon width + padding
481	S32 permission_edit_mine_width = avatar_item->mIconPermissionMap->getRect().mLeft - avatar_item->mIconPermissionEditMine->getRect().mLeft;
482
483	// edit their objects permission icon width + padding
484	S32 permission_edit_theirs_width = avatar_item->mIconPermissionEditMine->getRect().mLeft - avatar_item->mIconPermissionEditTheirs->getRect().mLeft;
485
486	// last interaction time textbox width + padding
487	S32 last_interaction_time_width = avatar_item->mIconPermissionEditTheirs->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft;
488
489	// avatar icon width + padding
490	S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft;
491
492	sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft;
493
494	S32 index = ALIC_COUNT;
495	sChildrenWidths[--index] = icon_width;
496	sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space"
497	sChildrenWidths[--index] = last_interaction_time_width;
498	sChildrenWidths[--index] = permission_edit_theirs_width;
499	sChildrenWidths[--index] = permission_edit_mine_width;
500	sChildrenWidths[--index] = permission_map_width;
501	sChildrenWidths[--index] = permission_online_width;
502	sChildrenWidths[--index] = info_btn_width;
503	sChildrenWidths[--index] = profile_btn_width;
504	sChildrenWidths[--index] = speaking_indicator_width;
505	llassert(index == 0);
506}
507
508void LLAvatarListItem::updateChildren()
509{
510	LL_DEBUGS("AvatarItemReshape") << LL_ENDL;
511	LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL;
512
513	S32 name_new_width = getRect().getWidth();
514	S32 ctrl_new_left = name_new_width;
515	S32 name_new_left = sLeftPadding;
516
517	// iterate through all children and set them into correct position depend on each child visibility
518	// assume that child indexes are in back order: the first in Enum is the last (right) in the item
519	// iterate & set child views starting from right to left
520	for (S32 i = 0; i < ALIC_COUNT; ++i)
521	{
522		// skip "name" textbox, it will be processed out of loop later
523		if (ALIC_NAME == i) continue;
524
525		LLView* control = getItemChildView((EAvatarListItemChildIndex)i);
526
527		LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL;
528		// skip invisible views
529		if (!control->getVisible()) continue;
530
531		S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls
532
533		// decrease available for 
534		name_new_width -= ctrl_width;
535		LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL;
536
537		LLRect control_rect = control->getRect();
538		LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL;
539
540		if (ALIC_ICON == i)
541		{
542			// assume that this is the last iteration,
543			// so it is not necessary to save "ctrl_new_left" value calculated on previous iterations
544			ctrl_new_left = sLeftPadding;
545			name_new_left = ctrl_new_left + ctrl_width;
546		}
547		else
548		{
549			ctrl_new_left -= ctrl_width;
550		}
551
552		LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL;
553
554		control_rect.setLeftTopAndSize(
555			ctrl_new_left,
556			control_rect.mTop,
557			control_rect.getWidth(),
558			control_rect.getHeight());
559
560		LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL;
561		control->setShape(control_rect);
562	}
563
564	// set size and position of the "name" child
565	LLView* name_view = getItemChildView(ALIC_NAME);
566	LLRect name_view_rect = name_view->getRect();
567	LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL;
568
569	// apply paddings
570	name_new_width -= sLeftPadding;
571	name_new_width -= sNameRightPadding;
572
573	name_view_rect.setLeftTopAndSize(
574		name_new_left,
575		name_view_rect.mTop,
576		name_new_width,
577		name_view_rect.getHeight());
578
579	name_view->setShape(name_view_rect);
580
581	LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL;
582}
583
584bool LLAvatarListItem::showPermissions(bool visible)
585{
586	const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
587	if(relation && visible)
588	{
589		mIconPermissionOnline->setVisible(relation->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
590		mIconPermissionMap->setVisible(relation->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
591		mIconPermissionEditMine->setVisible(relation->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));
592		mIconPermissionEditTheirs->setVisible(relation->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS));
593	}
594	else
595	{
596		mIconPermissionOnline->setVisible(false);
597		mIconPermissionMap->setVisible(false);
598		mIconPermissionEditMine->setVisible(false);
599		mIconPermissionEditTheirs->setVisible(false);
600	}
601
602	return NULL != relation;
603}
604
605LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index)
606{
607	LLView* child_view = mAvatarName;
608
609	switch (child_view_index)
610	{
611	case ALIC_ICON:
612		child_view = mAvatarIcon;
613		break;
614	case ALIC_NAME:
615		child_view = mAvatarName;
616		break;
617	case ALIC_INTERACTION_TIME:
618		child_view = mLastInteractionTime;
619		break;
620	case ALIC_SPEAKER_INDICATOR:
621		child_view = mSpeakingIndicator;
622		break;
623	case ALIC_PERMISSION_ONLINE:
624		child_view = mIconPermissionOnline;
625		break;
626	case ALIC_PERMISSION_MAP:
627		child_view = mIconPermissionMap;
628		break;
629	case ALIC_PERMISSION_EDIT_MINE:
630		child_view = mIconPermissionEditMine;
631		break;
632	case ALIC_PERMISSION_EDIT_THEIRS:
633		child_view = mIconPermissionEditTheirs;
634		break;
635	case ALIC_INFO_BUTTON:
636		child_view = mInfoBtn;
637		break;
638	case ALIC_PROFILE_BUTTON:
639		child_view = mProfileBtn;
640		break;
641	default:
642		LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL;
643		// leave child_view untouched
644	}
645	
646	return child_view;
647}
648
649// EOF