aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldirbrowser.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/llpaneldirbrowser.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/llpaneldirbrowser.h')
-rw-r--r--linden/indra/newview/llpaneldirbrowser.h167
1 files changed, 167 insertions, 0 deletions
diff --git a/linden/indra/newview/llpaneldirbrowser.h b/linden/indra/newview/llpaneldirbrowser.h
new file mode 100644
index 0000000..1d9ff06
--- /dev/null
+++ b/linden/indra/newview/llpaneldirbrowser.h
@@ -0,0 +1,167 @@
1/**
2 * @file llpaneldirbrowser.h
3 * @brief LLPanelDirBrowser class definition
4 *
5 * Copyright (c) 2001-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// Base class for the various search panels/results browsers
29// in the Find floater. For example, Find > Popular Places
30// is derived from this.
31
32#ifndef LL_LLPANELDIRBROWSER_H
33#define LL_LLPANELDIRBROWSER_H
34
35#include "llpanel.h"
36
37#include "llmemory.h" // LLPointer
38#include "lluuid.h"
39#include "llframetimer.h"
40#include "llviewerimage.h"
41#include "llmap.h"
42
43class LLMessageSystem;
44class LLFloaterDirectory;
45
46class LLPanelDirBrowser: public LLPanel
47{
48public:
49 LLPanelDirBrowser(const std::string& name, LLFloaterDirectory* floater);
50 virtual ~LLPanelDirBrowser();
51
52 virtual BOOL postBuild();
53
54 // Use to get periodic updates.
55 virtual void draw();
56
57 virtual void onVisibilityChange(BOOL curVisibilityIn);
58
59 // Redo your search for the prev/next page of results
60 virtual void prevPage();
61 virtual void nextPage();
62 void resetSearchStart();
63 // Do the current query (used by prevPage/nextPage)
64 virtual void performQuery() {};
65
66 const LLUUID& getSearchID() const { return mSearchID; }
67
68 // Select the line in the scroll list control with this ID,
69 // either now or when data arrives from the server.
70 void selectByUUID(const LLUUID& id);
71
72 void selectEventByID(S32 event_id);
73
74 U32 getSelectedEventID() const;
75 void getSelectedInfo(LLUUID* id, S32 *type);
76
77 // from llpaneldirbase
78 void setupNewSearch();
79
80 // default handler for clicking the search button resets the
81 // next/prev state and performs the query.
82 // Expects a pointer to an LLPanelDirBrowser object.
83 static void onClickSearchCore(void* userdata);
84
85 // query_start indicates the first result row to
86 // return, usually 0 or 100 or 200 because the searches
87 // return a max of 100 rows
88 static void sendDirFindQuery(
89 LLMessageSystem* msg,
90 const LLUUID& query_id,
91 const LLString& text,
92 U32 flags,
93 S32 query_start);
94
95 // Put an item in the first line of the results list.
96 void addHelpText(const char* text);
97
98 void newClassified();
99
100 void showEvent(const U32 event_id);
101
102 void renameClassified(const LLUUID& classified_id, const char* name);
103
104 // Prev/Next page buttons
105 static void onClickNext(void* data);
106 static void onClickPrev(void* data);
107
108 static void onCommitList(LLUICtrl* ctrl, void* data);
109
110 static void processDirPeopleReply(LLMessageSystem* msg, void**);
111 static void processDirPlacesReply(LLMessageSystem* msg, void**);
112 static void processDirEventsReply(LLMessageSystem* msg, void**);
113 static void processDirGroupsReply(LLMessageSystem* msg, void**);
114 static void processDirClassifiedReply(LLMessageSystem* msg, void**);
115 static void processDirPopularReply(LLMessageSystem* msg, void**);
116 static void processDirLandReply(LLMessageSystem *msg, void**);
117
118protected:
119 void updateResultCount();
120
121 void addClassified(LLCtrlListInterface *list, const LLUUID& classified_id, const char* name, const U32 creation_date, const S32 price_for_listing);
122 LLSD createLandSale(const LLUUID& parcel_id, BOOL is_auction, BOOL is_for_sale, BOOL is_newbie, const LLString& name, S32 *type);
123
124 static void onKeystrokeName(LLLineEditor* line, void* data);
125
126 // If this is a search for a panel like "people_panel" (and not the "all" panel)
127 // optionally show the "Next" button. Return the actual number of
128 // rows to display.
129 S32 showNextButton(S32 rows);
130
131protected:
132 LLUUID mSearchID; // Unique ID for a pending search
133 LLUUID mWantSelectID; // scroll item to select on arrival
134 LLString mCurrentSortColumn;
135 BOOL mCurrentSortAscending;
136 // Some searches return a max of 100 items per page, so we can
137 // start the search from the 100th item rather than the 0th, etc.
138 S32 mSearchStart;
139 // Places is 100 per page, events is 200 per page
140 S32 mResultsPerPage;
141 S32 mResultsReceived;
142
143 U32 mMinSearchChars;
144
145 LLSD mResultsContents;
146
147 BOOL mHaveSearchResults;
148 BOOL mDidAutoSelect;
149 LLFrameTimer mLastResultTimer;
150
151 LLFloaterDirectory* mFloaterDirectory;
152};
153
154// Codes used for sorting by type.
155const S32 EVENT_CODE = 0;
156const S32 PLACE_CODE = 1;
157const S32 ONLINE_CODE = 2;
158const S32 OFFLINE_CODE = 3;
159const S32 GROUP_CODE = 4;
160const S32 CLASSIFIED_CODE = 5;
161const S32 FOR_SALE_CODE = 6; // for sale place
162const S32 AUCTION_CODE = 7; // for auction place
163const S32 POPULAR_CODE = 8; // popular by dwell
164
165extern LLMap< const LLUUID, LLPanelDirBrowser* > gDirBrowserInstances;
166
167#endif // LL_LLPANELDIRBROWSER_H