diff options
Diffstat (limited to 'linden/indra/newview/llfloaterbulkpermission.h')
-rw-r--r-- | linden/indra/newview/llfloaterbulkpermission.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterbulkpermission.h b/linden/indra/newview/llfloaterbulkpermission.h new file mode 100644 index 0000000..09af270 --- /dev/null +++ b/linden/indra/newview/llfloaterbulkpermission.h | |||
@@ -0,0 +1,108 @@ | |||
1 | /** | ||
2 | * @file llfloaterbulkpermissions.h | ||
3 | * @brief Allow multiple task inventory properties to be set in one go. | ||
4 | * @author Michelle2 Zenovka | ||
5 | * | ||
6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | ||
7 | * | ||
8 | * Copyright (c) 2008-2009, Linden Research, Inc. | ||
9 | * | ||
10 | * Second Life Viewer Source Code | ||
11 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
12 | * to you under the terms of the GNU General Public License, version 2.0 | ||
13 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
14 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
17 | * | ||
18 | * There are special exceptions to the terms and conditions of the GPL as | ||
19 | * it is applied to this Source Code. View the full text of the exception | ||
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
21 | * online at | ||
22 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
23 | * | ||
24 | * By copying, modifying or distributing this software, you acknowledge | ||
25 | * that you have read and understood your obligations described above, | ||
26 | * and agree to abide by those obligations. | ||
27 | * | ||
28 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
30 | * COMPLETENESS OR PERFORMANCE. | ||
31 | * $/LicenseInfo$ | ||
32 | */ | ||
33 | |||
34 | #ifndef LL_LLBULKPERMISSION_H | ||
35 | #define LL_LLBULKPERMISSION_H | ||
36 | |||
37 | #include "lldarray.h" | ||
38 | #include "llinventory.h" | ||
39 | #include "llviewerobject.h" | ||
40 | #include "llvoinventorylistener.h" | ||
41 | #include "llmap.h" | ||
42 | #include "lluuid.h" | ||
43 | |||
44 | #include "llfloater.h" | ||
45 | #include "llscrolllistctrl.h" | ||
46 | |||
47 | #include "llviewerinventory.h" | ||
48 | |||
49 | class LLFloaterBulkPermission : public LLFloater, public LLVOInventoryListener, public LLFloaterSingleton<LLFloaterBulkPermission> | ||
50 | { | ||
51 | public: | ||
52 | |||
53 | LLFloaterBulkPermission(const LLSD& seed); | ||
54 | |||
55 | private: | ||
56 | virtual ~LLFloaterBulkPermission() {} | ||
57 | |||
58 | BOOL start(); // returns TRUE if the queue has started, otherwise FALSE. | ||
59 | BOOL nextObject(); | ||
60 | BOOL popNext(); | ||
61 | |||
62 | // This is the callback method for the viewer object currently | ||
63 | // being worked on. | ||
64 | /*virtual*/ void inventoryChanged(LLViewerObject* obj, | ||
65 | InventoryObjectList* inv, | ||
66 | S32 serial_num, | ||
67 | void* queue); | ||
68 | |||
69 | // This is called by inventoryChanged | ||
70 | void handleInventory(LLViewerObject* viewer_obj, | ||
71 | InventoryObjectList* inv); | ||
72 | |||
73 | |||
74 | void updateInventory(LLViewerObject* object, | ||
75 | LLViewerInventoryItem* item, | ||
76 | U8 key, | ||
77 | bool is_new); | ||
78 | |||
79 | static void onCloseBtn(void* user_data); | ||
80 | static void onApplyBtn(void* user_data); | ||
81 | static void onCommitCopy(LLUICtrl* ctrl, void* data); | ||
82 | static void onCheckAll( void* user_data) { ((LLFloaterBulkPermission*)user_data)->doCheckUncheckAll(TRUE); } | ||
83 | static void onUncheckAll(void* user_data) { ((LLFloaterBulkPermission*)user_data)->doCheckUncheckAll(FALSE); } | ||
84 | |||
85 | // returns true if this is done | ||
86 | BOOL isDone() const { return (mCurrentObjectID.isNull() || (mObjectIDs.count() == 0)); } | ||
87 | |||
88 | //Read the settings and Apply the permissions | ||
89 | void doApply(); | ||
90 | void doCheckUncheckAll(BOOL check); | ||
91 | |||
92 | private: | ||
93 | // UI | ||
94 | LLScrollListCtrl* mMessages; | ||
95 | LLButton* mCloseBtn; | ||
96 | |||
97 | // Object Queue | ||
98 | LLDynamicArray<LLUUID> mObjectIDs; | ||
99 | LLUUID mCurrentObjectID; | ||
100 | BOOL mDone; | ||
101 | |||
102 | LLUUID mID; | ||
103 | |||
104 | const char* mStartString; | ||
105 | }; | ||
106 | |||
107 | #endif | ||
108 | |||