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/llpanelgroup.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/llpanelgroup.h')
-rw-r--r-- | linden/indra/newview/llpanelgroup.h | 192 |
1 files changed, 192 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelgroup.h b/linden/indra/newview/llpanelgroup.h new file mode 100644 index 0000000..d17c200 --- /dev/null +++ b/linden/indra/newview/llpanelgroup.h | |||
@@ -0,0 +1,192 @@ | |||
1 | /** | ||
2 | * @file llpanelgroup.h | ||
3 | * | ||
4 | * Copyright (c) 2006-2007, Linden Research, Inc. | ||
5 | * | ||
6 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
7 | * to you under the terms of the GNU General Public License, version 2.0 | ||
8 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
9 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
10 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
11 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
12 | * | ||
13 | * There are special exceptions to the terms and conditions of the GPL as | ||
14 | * it is applied to this Source Code. View the full text of the exception | ||
15 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
16 | * online at http://secondlife.com/developers/opensource/flossexception | ||
17 | * | ||
18 | * By copying, modifying or distributing this software, you acknowledge | ||
19 | * that you have read and understood your obligations described above, | ||
20 | * and agree to abide by those obligations. | ||
21 | * | ||
22 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
23 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
24 | * COMPLETENESS OR PERFORMANCE. | ||
25 | */ | ||
26 | |||
27 | #ifndef LL_LLPANELGROUP_H | ||
28 | #define LL_LLPANELGROUP_H | ||
29 | |||
30 | #include "llgroupmgr.h" | ||
31 | #include "llpanel.h" | ||
32 | #include "lltimer.h" | ||
33 | |||
34 | struct LLOfferInfo; | ||
35 | |||
36 | const S32 UPDATE_MEMBERS_PER_FRAME = 500; | ||
37 | |||
38 | // Forward declares | ||
39 | class LLPanelGroupTab; | ||
40 | class LLTabContainerCommon; | ||
41 | class LLAgent; | ||
42 | |||
43 | class LLPanelGroupTabObserver | ||
44 | { | ||
45 | public: | ||
46 | LLPanelGroupTabObserver() {}; | ||
47 | virtual ~LLPanelGroupTabObserver(){}; | ||
48 | virtual void tabChanged() = 0; | ||
49 | }; | ||
50 | |||
51 | class LLPanelGroup : public LLPanel, | ||
52 | public LLGroupMgrObserver, | ||
53 | public LLPanelGroupTabObserver | ||
54 | { | ||
55 | public: | ||
56 | LLPanelGroup(const std::string& filename, | ||
57 | const std::string& name, | ||
58 | const LLUUID& group_id, | ||
59 | const std::string& initial_tab_selected = ""); | ||
60 | virtual ~LLPanelGroup(); | ||
61 | |||
62 | virtual BOOL postBuild(); | ||
63 | |||
64 | static void onBtnOK(void*); | ||
65 | static void onBtnCancel(void*); | ||
66 | static void onBtnApply(void*); | ||
67 | static void onBtnRefresh(void*); | ||
68 | static void onClickTab(void*,bool); | ||
69 | void handleClickTab(); | ||
70 | |||
71 | void setGroupID(const LLUUID& group_id); | ||
72 | void selectTab(std::string tab_name); | ||
73 | |||
74 | // Called when embedded in a floater during a close attempt. | ||
75 | BOOL canClose(); | ||
76 | |||
77 | // Checks if the current tab needs to be applied, and tries to switch to the requested tab. | ||
78 | BOOL attemptTransition(); | ||
79 | |||
80 | // Switches to the requested tab (will close() if requested is NULL) | ||
81 | void transitionToTab(); | ||
82 | |||
83 | void updateTabVisibility(); | ||
84 | |||
85 | // Used by attemptTransition to query the user's response to a tab that needs to apply. | ||
86 | static void onNotifyCallback(S32 option, void* user_data); | ||
87 | void handleNotifyCallback(S32 option); | ||
88 | |||
89 | bool apply(); | ||
90 | void refreshData(); | ||
91 | void close(); | ||
92 | void draw(); | ||
93 | |||
94 | // Group manager observer trigger. | ||
95 | virtual void changed(LLGroupChange gc); | ||
96 | |||
97 | // PanelGroupTab observer trigger | ||
98 | virtual void tabChanged(); | ||
99 | |||
100 | void setAllowEdit(BOOL v) { mAllowEdit = v; } | ||
101 | |||
102 | void showNotice(const char* subject, | ||
103 | const char* message, | ||
104 | const bool& has_inventory, | ||
105 | const char* inventory_name, | ||
106 | LLOfferInfo* inventory_offer); | ||
107 | protected: | ||
108 | LLPanelGroupTab* mCurrentTab; | ||
109 | LLPanelGroupTab* mRequestedTab; | ||
110 | LLTabContainerCommon* mTabContainer; | ||
111 | BOOL mIgnoreTransition; | ||
112 | |||
113 | LLButton* mApplyBtn; | ||
114 | |||
115 | LLTimer mRefreshTimer; | ||
116 | |||
117 | BOOL mForceClose; | ||
118 | |||
119 | std::string mInitialTab; | ||
120 | std::string mFilename; | ||
121 | |||
122 | LLString mDefaultNeedsApplyMesg; | ||
123 | LLString mWantApplyMesg; | ||
124 | |||
125 | BOOL mAllowEdit; | ||
126 | BOOL mShowingNotifyDialog; | ||
127 | }; | ||
128 | |||
129 | class LLPanelGroupTab : public LLPanel | ||
130 | { | ||
131 | public: | ||
132 | LLPanelGroupTab(const std::string& name, const LLUUID& group_id) | ||
133 | : LLPanel(name), mGroupID(group_id), mAllowEdit(TRUE), mHasModal(FALSE) { } | ||
134 | virtual ~LLPanelGroupTab(); | ||
135 | |||
136 | // Factory that returns a new LLPanelGroupFoo tab. | ||
137 | static void* createTab(void* data); | ||
138 | |||
139 | // Triggered when the tab becomes active. | ||
140 | virtual void activate() { } | ||
141 | |||
142 | // Triggered when the tab becomes inactive. | ||
143 | virtual void deactivate() { } | ||
144 | |||
145 | // Asks if something needs to be applied. | ||
146 | // If returning true, this function should modify the message to the user. | ||
147 | virtual bool needsApply(LLString& mesg) { return false; } | ||
148 | |||
149 | // Asks if there is currently a modal dialog being shown. | ||
150 | virtual BOOL hasModal() { return mHasModal; } | ||
151 | |||
152 | // Request to apply current data. | ||
153 | // If returning fail, this function should modify the message to the user. | ||
154 | virtual bool apply(LLString& mesg) { return true; } | ||
155 | |||
156 | // Request a cancel of changes | ||
157 | virtual void cancel() { } | ||
158 | |||
159 | // Triggered when group information changes in the group manager. | ||
160 | virtual void update(LLGroupChange gc) { } | ||
161 | |||
162 | // This is the text to be displayed when a help button is pressed. | ||
163 | virtual LLString getHelpText() const { return mHelpText; } | ||
164 | |||
165 | // Display anything returned by getHelpText | ||
166 | static void onClickHelp(void* data); | ||
167 | void handleClickHelp(); | ||
168 | |||
169 | // This just connects the help button callback. | ||
170 | virtual BOOL postBuild(); | ||
171 | |||
172 | virtual BOOL isVisibleByAgent(LLAgent* agentp); | ||
173 | |||
174 | void setAllowEdit(BOOL v) { mAllowEdit = v; } | ||
175 | |||
176 | void addObserver(LLPanelGroupTabObserver *obs); | ||
177 | void removeObserver(LLPanelGroupTabObserver *obs); | ||
178 | void notifyObservers(); | ||
179 | |||
180 | protected: | ||
181 | LLUUID mGroupID; | ||
182 | LLTabContainerCommon* mTabContainer; | ||
183 | LLString mHelpText; | ||
184 | |||
185 | BOOL mAllowEdit; | ||
186 | BOOL mHasModal; | ||
187 | |||
188 | typedef std::set<LLPanelGroupTabObserver*> observer_list_t; | ||
189 | observer_list_t mObservers; | ||
190 | }; | ||
191 | |||
192 | #endif // LL_LLPANELGROUP_H | ||