00001
00032
00033
00034
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
00057 virtual void draw();
00058
00059 virtual void onVisibilityChange(BOOL curVisibilityIn);
00060
00061
00062 virtual void prevPage();
00063 virtual void nextPage();
00064 void resetSearchStart();
00065
00066 virtual void performQuery() {};
00067
00068 const LLUUID& getSearchID() const { return mSearchID; }
00069
00070
00071
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
00081
00082
00083
00084 void setupNewSearch();
00085
00086
00087
00088
00089 static void onClickSearchCore(void* userdata);
00090
00091
00092
00093
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
00102 void addHelpText(const char* text);
00103
00104 void newClassified();
00105
00106 void showEvent(const U32 event_id);
00107
00108
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
00132
00133
00134 S32 showNextButton(S32 rows);
00135
00136 protected:
00137 LLUUID mSearchID;
00138 LLUUID mWantSelectID;
00139 LLString mCurrentSortColumn;
00140 BOOL mCurrentSortAscending;
00141
00142
00143 S32 mSearchStart;
00144
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
00160 const S32 INVALID_CODE = -1;
00161 const S32 EVENT_CODE = 0;
00162 const S32 PLACE_CODE = 1;
00163
00164
00165
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;
00170 const S32 AUCTION_CODE = 7;
00171 const S32 POPULAR_CODE = 8;
00172
00173 extern LLMap< const LLUUID, LLPanelDirBrowser* > gDirBrowserInstances;
00174
00175 #endif // LL_LLPANELDIRBROWSER_H