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         // Prev/Next page buttons
00109         static void onClickNext(void* data);
00110         static void onClickPrev(void* data);
00111 
00112         static void onCommitList(LLUICtrl* ctrl, void* data);
00113 
00114         static void processDirPeopleReply(LLMessageSystem* msg, void**);
00115         static void processDirPlacesReply(LLMessageSystem* msg, void**);
00116         static void processDirEventsReply(LLMessageSystem* msg, void**);
00117         static void processDirGroupsReply(LLMessageSystem* msg, void**);
00118         static void processDirClassifiedReply(LLMessageSystem* msg, void**);
00119         static void processDirLandReply(LLMessageSystem *msg, void**);
00120 
00121         std::string filterShortWords( const std::string source_string, int shortest_word_length, bool& was_filtered );
00122 
00123 protected:
00124         void updateResultCount();
00125 
00126         void addClassified(LLCtrlListInterface *list, const LLUUID& classified_id, const char* name, const U32 creation_date, const S32 price_for_listing);
00127         LLSD createLandSale(const LLUUID& parcel_id, BOOL is_auction, BOOL is_for_sale, const LLString& name, S32 *type);
00128 
00129         static void onKeystrokeName(LLLineEditor* line, void* data);
00130 
00131         // If this is a search for a panel like "people_panel" (and not the "all" panel)
00132         // optionally show the "Next" button.  Return the actual number of
00133         // rows to display.
00134         S32 showNextButton(S32 rows);
00135 
00136 protected:
00137         LLUUID                  mSearchID;              // Unique ID for a pending search
00138         LLUUID                  mWantSelectID;  // scroll item to select on arrival
00139         LLString        mCurrentSortColumn;
00140         BOOL            mCurrentSortAscending;
00141         // Some searches return a max of 100 items per page, so we can
00142         // start the search from the 100th item rather than the 0th, etc.
00143         S32                             mSearchStart;
00144         // Places is 100 per page, events is 200 per page
00145         S32                             mResultsPerPage;
00146         S32                             mResultsReceived;
00147 
00148         U32                             mMinSearchChars;
00149 
00150         LLSD                    mResultsContents;
00151 
00152         BOOL                    mHaveSearchResults;
00153         BOOL                    mDidAutoSelect;
00154         LLFrameTimer    mLastResultTimer;
00155 
00156         LLFloaterDirectory* mFloaterDirectory;
00157 };
00158 
00159 // Codes used for sorting by type.
00160 const S32 INVALID_CODE = -1;
00161 const S32 EVENT_CODE = 0;
00162 const S32 PLACE_CODE = 1;
00163 // We no longer show online vs. offline in search result icons.
00164 //const S32 ONLINE_CODE = 2;
00165 //const S32 OFFLINE_CODE = 3;
00166 const S32 AVATAR_CODE = 3;
00167 const S32 GROUP_CODE = 4;
00168 const S32 CLASSIFIED_CODE = 5;  
00169 const S32 FOR_SALE_CODE = 6;    // for sale place
00170 const S32 AUCTION_CODE = 7;             // for auction place
00171 const S32 POPULAR_CODE = 8;             // popular by dwell
00172 
00173 extern LLMap< const LLUUID, LLPanelDirBrowser* > gDirBrowserInstances;
00174 
00175 #endif // LL_LLPANELDIRBROWSER_H

Generated on Fri May 16 08:33:49 2008 for SecondLife by  doxygen 1.5.5