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         void renameClassified(const LLUUID& classified_id, const char* name);
00109 
00110         
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         
00133         
00134         
00135         S32 showNextButton(S32 rows);
00136 
00137 protected:
00138         LLUUID                  mSearchID;              
00139         LLUUID                  mWantSelectID;  
00140         LLString        mCurrentSortColumn;
00141         BOOL            mCurrentSortAscending;
00142         
00143         
00144         S32                             mSearchStart;
00145         
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 
00161 const S32 INVALID_CODE = -1;
00162 const S32 EVENT_CODE = 0;
00163 const S32 PLACE_CODE = 1;
00164 
00165 
00166 
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;    
00171 const S32 AUCTION_CODE = 7;             
00172 const S32 POPULAR_CODE = 8;             
00173 
00174 extern LLMap< const LLUUID, LLPanelDirBrowser* > gDirBrowserInstances;
00175 
00176 #endif // LL_LLPANELDIRBROWSER_H