llpaneldirbrowser.h

Go to the documentation of this file.
00001 
00032 // Base class for the various search panels/results browsers
00033 // in the Find floater.  For example, Find > Popular Places
00034 // is derived from this.
00035 
00036 #ifndef LL_LLPANELDIRBROWSER_H
00037 #define LL_LLPANELDIRBROWSER_H
00038 
00039 #include "llpanel.h"
00040 
00041 #include "lluuid.h"
00042 #include "llframetimer.h"
00043 #include "llmap.h"
00044 
00045 class LLMessageSystem;
00046 class LLFloaterDirectory;
00047 
00048 class LLPanelDirBrowser: public LLPanel
00049 {
00050 public:
00051         LLPanelDirBrowser(const std::string& name, LLFloaterDirectory* floater);
00052         virtual ~LLPanelDirBrowser();
00053 
00054         virtual BOOL postBuild();
00055 
00056         // Use to get periodic updates.
00057         virtual void draw();
00058 
00059         virtual void onVisibilityChange(BOOL curVisibilityIn);
00060 
00061         // Redo your search for the prev/next page of results
00062         virtual void prevPage();
00063         virtual void nextPage();
00064         void resetSearchStart();
00065         // Do the current query (used by prevPage/nextPage)
00066         virtual void performQuery() {};
00067 
00068         const LLUUID& getSearchID() const { return mSearchID; }
00069 
00070         // Select the line in the scroll list control with this ID,
00071         // either now or when data arrives from the server.
00072         void selectByUUID(const LLUUID& id);
00073 
00074         void selectEventByID(S32 event_id);
00075 
00076         U32 getSelectedEventID() const;
00077         void getSelectedInfo(LLUUID* id, S32 *type);
00078 
00079         void showDetailPanel(S32 type, LLSD item_id);
00080                 // type is EVENT_CODE, PLACE_CODE, etc. from below.
00081                 // item_id is integer for events, UUID for all others.
00082 
00083         // from llpaneldirbase
00084         void setupNewSearch();
00085 
00086         // default handler for clicking the search button resets the
00087         // next/prev state and performs the query.
00088         // Expects a pointer to an LLPanelDirBrowser object.
00089         static void onClickSearchCore(void* userdata);
00090 
00091         // query_start indicates the first result row to
00092         // return, usually 0 or 100 or 200 because the searches
00093         // return a max of 100 rows
00094         static void sendDirFindQuery(
00095                 LLMessageSystem* msg,
00096                 const LLUUID& query_id,
00097                 const LLString& text,
00098                 U32 flags,
00099                 S32 query_start);
00100 
00101         // Put an item in the first line of the results list.
00102         void addHelpText(const char* text);
00103 
00104         void newClassified();
00105 
00106         void showEvent(const U32 event_id);
00107 
00108         void renameClassified(const LLUUID& classified_id, const char* name);
00109 
00110         // Prev/Next page buttons
00111         static void onClickNext(void* data);
00112         static void onClickPrev(void* data);
00113 
00114         static void onCommitList(LLUICtrl* ctrl, void* data);
00115 
00116         static void processDirPeopleReply(LLMessageSystem* msg, void**);
00117         static void processDirPlacesReply(LLMessageSystem* msg, void**);
00118         static void processDirEventsReply(LLMessageSystem* msg, void**);
00119         static void processDirGroupsReply(LLMessageSystem* msg, void**);
00120         static void processDirClassifiedReply(LLMessageSystem* msg, void**);
00121         static void processDirPopularReply(LLMessageSystem* msg, void**);
00122         static void processDirLandReply(LLMessageSystem *msg, void**);
00123 
00124 protected:
00125         void updateResultCount();
00126 
00127         void addClassified(LLCtrlListInterface *list, const LLUUID& classified_id, const char* name, const U32 creation_date, const S32 price_for_listing);
00128         LLSD createLandSale(const LLUUID& parcel_id, BOOL is_auction, BOOL is_for_sale, const LLString& name, S32 *type);
00129 
00130         static void onKeystrokeName(LLLineEditor* line, void* data);
00131 
00132         // If this is a search for a panel like "people_panel" (and not the "all" panel)
00133         // optionally show the "Next" button.  Return the actual number of
00134         // rows to display.
00135         S32 showNextButton(S32 rows);
00136 
00137 protected:
00138         LLUUID                  mSearchID;              // Unique ID for a pending search
00139         LLUUID                  mWantSelectID;  // scroll item to select on arrival
00140         LLString        mCurrentSortColumn;
00141         BOOL            mCurrentSortAscending;
00142         // Some searches return a max of 100 items per page, so we can
00143         // start the search from the 100th item rather than the 0th, etc.
00144         S32                             mSearchStart;
00145         // Places is 100 per page, events is 200 per page
00146         S32                             mResultsPerPage;
00147         S32                             mResultsReceived;
00148 
00149         U32                             mMinSearchChars;
00150 
00151         LLSD                    mResultsContents;
00152 
00153         BOOL                    mHaveSearchResults;
00154         BOOL                    mDidAutoSelect;
00155         LLFrameTimer    mLastResultTimer;
00156 
00157         LLFloaterDirectory* mFloaterDirectory;
00158 };
00159 
00160 // Codes used for sorting by type.
00161 const S32 INVALID_CODE = -1;
00162 const S32 EVENT_CODE = 0;
00163 const S32 PLACE_CODE = 1;
00164 // We no longer show online vs. offline in search result icons.
00165 //const S32 ONLINE_CODE = 2;
00166 //const S32 OFFLINE_CODE = 3;
00167 const S32 AVATAR_CODE = 3;
00168 const S32 GROUP_CODE = 4;
00169 const S32 CLASSIFIED_CODE = 5;  
00170 const S32 FOR_SALE_CODE = 6;    // for sale place
00171 const S32 AUCTION_CODE = 7;             // for auction place
00172 const S32 POPULAR_CODE = 8;             // popular by dwell
00173 
00174 extern LLMap< const LLUUID, LLPanelDirBrowser* > gDirBrowserInstances;
00175 
00176 #endif // LL_LLPANELDIRBROWSER_H

Generated on Thu Jul 1 06:08:56 2010 for Second Life Viewer by  doxygen 1.4.7