Annotation of /trunk/indra/newview/llnamelistctrl.h
Parent Directory
|
Revision Log
Revision 137 - (view) (download)
| 1 : | mjm | 135 | /** |
| 2 : | * @file llnamelistctrl.h | ||
| 3 : | * @brief A list of names, automatically refreshing from the name cache. | ||
| 4 : | * | ||
| 5 : | * $LicenseInfo:firstyear=2003&license=viewergpl$ | ||
| 6 : | * | ||
| 7 : | mjm | 137 | * Copyright (c) 2003-2010, Linden Research, Inc. |
| 8 : | mjm | 135 | * |
| 9 : | * Second Life Viewer Source Code | ||
| 10 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 11 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 12 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 13 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 14 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 15 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 16 : | * | ||
| 17 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 18 : | * it is applied to this Source Code. View the full text of the exception | ||
| 19 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 20 : | * online at | ||
| 21 : | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 22 : | * | ||
| 23 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 24 : | * that you have read and understood your obligations described above, | ||
| 25 : | * and agree to abide by those obligations. | ||
| 26 : | * | ||
| 27 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 28 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 29 : | * COMPLETENESS OR PERFORMANCE. | ||
| 30 : | * $/LicenseInfo$ | ||
| 31 : | */ | ||
| 32 : | |||
| 33 : | #ifndef LL_LLNAMELISTCTRL_H | ||
| 34 : | #define LL_LLNAMELISTCTRL_H | ||
| 35 : | |||
| 36 : | #include <set> | ||
| 37 : | |||
| 38 : | #include "llscrolllistctrl.h" | ||
| 39 : | |||
| 40 : | |||
| 41 : | class LLNameListCtrl | ||
| 42 : | : public LLScrollListCtrl | ||
| 43 : | { | ||
| 44 : | public: | ||
| 45 : | LLNameListCtrl(const std::string& name, | ||
| 46 : | const LLRect& rect, | ||
| 47 : | LLUICtrlCallback callback, | ||
| 48 : | void* userdata, | ||
| 49 : | BOOL allow_multiple_selection, | ||
| 50 : | BOOL draw_border = TRUE, | ||
| 51 : | S32 name_column_index = 0, | ||
| 52 : | const std::string& tooltip = LLStringUtil::null); | ||
| 53 : | virtual ~LLNameListCtrl(); | ||
| 54 : | |||
| 55 : | virtual LLXMLNodePtr getXML(bool save_children = true) const; | ||
| 56 : | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); | ||
| 57 : | |||
| 58 : | // Add a user to the list by name. It will be added, the name | ||
| 59 : | // requested from the cache, and updated as necessary. | ||
| 60 : | BOOL addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM, | ||
| 61 : | BOOL enabled = TRUE, std::string& suffix = LLStringUtil::null); | ||
| 62 : | BOOL addNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM); | ||
| 63 : | |||
| 64 : | virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); | ||
| 65 : | |||
| 66 : | // Add a user to the list by name. It will be added, the name | ||
| 67 : | // requested from the cache, and updated as necessary. | ||
| 68 : | void addGroupNameItem(const LLUUID& group_id, EAddPosition pos = ADD_BOTTOM, | ||
| 69 : | BOOL enabled = TRUE); | ||
| 70 : | void addGroupNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM); | ||
| 71 : | |||
| 72 : | |||
| 73 : | void removeNameItem(const LLUUID& agent_id); | ||
| 74 : | |||
| 75 : | void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); | ||
| 76 : | |||
| 77 : | static void refreshAll(const LLUUID& id, const std::string& firstname, | ||
| 78 : | const std::string& lastname, BOOL is_group); | ||
| 79 : | |||
| 80 : | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, | ||
| 81 : | BOOL drop, EDragAndDropType cargo_type, void *cargo_data, | ||
| 82 : | EAcceptance *accept, | ||
| 83 : | std::string& tooltip_msg); | ||
| 84 : | |||
| 85 : | void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; } | ||
| 86 : | |||
| 87 : | private: | ||
| 88 : | static std::set<LLNameListCtrl*> sInstances; | ||
| 89 : | S32 mNameColumnIndex; | ||
| 90 : | BOOL mAllowCallingCardDrop; | ||
| 91 : | }; | ||
| 92 : | |||
| 93 : | #endif |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

