llfloaterregioninfo.h

Go to the documentation of this file.
00001 
00033 #ifndef LL_LLFLOATERREGIONINFO_H
00034 #define LL_LLFLOATERREGIONINFO_H
00035 
00036 #include <vector>
00037 #include "llfloater.h"
00038 #include "llpanel.h"
00039 
00040 class LLLineEditor;
00041 class LLMessageSystem;
00042 class LLPanelRegionInfo;
00043 class LLTabContainer;
00044 class LLViewerRegion;
00045 class LLViewerTextEditor;
00046 class LLInventoryItem;
00047 class LLCheckBoxCtrl;
00048 class LLComboBox;
00049 class LLNameListCtrl;
00050 class LLSliderCtrl;
00051 class LLSpinCtrl;
00052 class LLTextBox;
00053 
00054 class LLPanelRegionGeneralInfo;
00055 class LLPanelRegionDebugInfo;
00056 class LLPanelRegionTextureInfo;
00057 class LLPanelRegionTerrainInfo;
00058 class LLPanelEstateInfo;
00059 class LLPanelEstateCovenant;
00060 
00061 class LLFloaterRegionInfo : public LLFloater, public LLFloaterSingleton<LLFloaterRegionInfo>
00062 {
00063         friend class LLUISingleton<LLFloaterRegionInfo, VisibilityPolicy<LLFloater> >;
00064 public:
00065         ~LLFloaterRegionInfo();
00066 
00067         /*virtual*/ void onOpen();
00068         /*virtual*/ BOOL postBuild();
00069 
00070         static void processEstateOwnerRequest(LLMessageSystem* msg, void**);
00071 
00072         // get and process region info if necessary.
00073         static void processRegionInfo(LLMessageSystem* msg);
00074 
00075         static const LLUUID& getLastInvoice() { return sRequestInvoice; }
00076         static void nextInvoice() { sRequestInvoice.generate(); }
00077         //static S32 getSerial() { return sRequestSerial; }
00078         //static void incrementSerial() { sRequestSerial++; }
00079 
00080         static LLPanelEstateInfo* getPanelEstate();
00081         static LLPanelEstateCovenant* getPanelCovenant();
00082 
00083         // from LLPanel
00084         virtual void refresh();
00085         
00086         static void requestRegionInfo();
00087 
00088 protected:
00089         LLFloaterRegionInfo(const LLSD& seed);
00090         void refreshFromRegion(LLViewerRegion* region);
00091 
00092         // member data
00093         LLTabContainer* mTab;
00094         typedef std::vector<LLPanelRegionInfo*> info_panels_t;
00095         info_panels_t mInfoPanels;
00096         //static S32 sRequestSerial;    // serial # of last EstateOwnerRequest
00097         static LLUUID sRequestInvoice;
00098 };
00099 
00100 
00101 // Base class for all region information panels.
00102 class LLPanelRegionInfo : public LLPanel
00103 {
00104 public:
00105         LLPanelRegionInfo() : LLPanel("Region Info Panel") {}
00106         static void onBtnSet(void* user_data);
00107         static void onChangeChildCtrl(LLUICtrl* ctrl, void* user_data);
00108         static void onChangeAnything(LLUICtrl* ctrl, void* user_data);
00109         static void onChangeText(LLLineEditor* caller, void* user_data);
00110         
00111         virtual bool refreshFromRegion(LLViewerRegion* region);
00112         virtual bool estateUpdate(LLMessageSystem* msg) { return true; }
00113         
00114         virtual BOOL postBuild();
00115         virtual void updateChild(LLUICtrl* child_ctrl);
00116         
00117         void enableButton(const char* btn_name, BOOL enable = TRUE);
00118         void disableButton(const char* btn_name);
00119         
00120 protected:
00121         void initCtrl(const char* name);
00122         void initTextCtrl(const char* name);
00123         void initHelpBtn(const char* name, const char* xml_alert);
00124 
00125         // Callback for all help buttons, data is name of XML alert to show.
00126         static void onClickHelp(void* data);
00127         
00128         // Returns TRUE if update sent and apply button should be
00129         // disabled.
00130         virtual BOOL sendUpdate() { return TRUE; }
00131         
00132         typedef std::vector<std::string> strings_t;
00133         //typedef std::vector<U32> integers_t;
00134         void sendEstateOwnerMessage(
00135                                          LLMessageSystem* msg,
00136                                          const char* request,
00137                                          const LLUUID& invoice,
00138                                          const strings_t& strings);
00139         
00140         // member data
00141         LLHost mHost;
00142 };
00143 
00145 // Actual panels start here
00147 
00148 class LLPanelRegionGeneralInfo : public LLPanelRegionInfo
00149 {
00150 public:
00151         LLPanelRegionGeneralInfo()
00152                 :       LLPanelRegionInfo()     {}
00153         ~LLPanelRegionGeneralInfo() {}
00154         
00155         virtual bool refreshFromRegion(LLViewerRegion* region);
00156         
00157         // LLPanel
00158         virtual BOOL postBuild();
00159 protected:
00160         virtual BOOL sendUpdate();
00161         
00162         static void onClickKick(void* userdata);
00163         static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
00164         static void onClickKickAll(void* userdata);
00165         static void onKickAllCommit(S32 option, void* userdata);
00166         static void onClickMessage(void* userdata);
00167         static void onMessageCommit(S32 option, const LLString& text, void* userdata);
00168         static void onClickManageTelehub(void* data);
00169 };
00170 
00172 
00173 class LLPanelRegionDebugInfo : public LLPanelRegionInfo
00174 {
00175 public:
00176         LLPanelRegionDebugInfo()
00177                 :       LLPanelRegionInfo(), mTargetAvatar() {}
00178         ~LLPanelRegionDebugInfo() {}
00179         // LLPanel
00180         virtual BOOL postBuild();
00181         
00182         virtual bool refreshFromRegion(LLViewerRegion* region);
00183         
00184 protected:
00185         virtual BOOL sendUpdate();
00186 
00187         static void onClickChooseAvatar(void*);
00188         static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
00189         static void onClickReturnScriptedOtherLand(void*);
00190         static void callbackReturnScriptedOtherLand(S32 option, void*);
00191         static void onClickReturnScriptedAll(void*);
00192         static void callbackReturnScriptedAll(S32 option, void*);
00193         static void onClickTopColliders(void*);
00194         static void onClickTopScripts(void*);
00195         static void onClickRestart(void* data);
00196         static void callbackRestart(S32 option, void* data);
00197         static void onClickCancelRestart(void* data);
00198         
00199 private:
00200         LLUUID mTargetAvatar;
00201 };
00202 
00204 
00205 class LLPanelRegionTextureInfo : public LLPanelRegionInfo
00206 {
00207 public:
00208         LLPanelRegionTextureInfo();
00209         ~LLPanelRegionTextureInfo() {}
00210         
00211         virtual bool refreshFromRegion(LLViewerRegion* region);
00212         
00213         // LLPanel && LLView
00214         virtual BOOL postBuild();
00215         
00216 protected:
00217         virtual BOOL sendUpdate();
00218         
00219         static void onClickDump(void* data);
00220         BOOL validateTextureSizes();
00221 };
00222 
00224 
00225 class LLPanelRegionTerrainInfo : public LLPanelRegionInfo
00226 {
00227 public:
00228         LLPanelRegionTerrainInfo()
00229                 :       LLPanelRegionInfo() {}
00230         ~LLPanelRegionTerrainInfo() {}
00231         // LLPanel
00232         virtual BOOL postBuild();
00233         
00234         virtual bool refreshFromRegion(LLViewerRegion* region);
00235         
00236 protected:
00237         virtual BOOL sendUpdate();
00238 
00239         static void onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data);
00240         static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data);
00241         static void onChangeSunHour(LLUICtrl* ctrl, void*);
00242 
00243         static void onClickDownloadRaw(void*);
00244         static void onClickUploadRaw(void*);
00245         static void onClickBakeTerrain(void*);
00246         static void callbackBakeTerrain(S32 option, void* data);
00247 };
00248 
00250 
00251 class LLPanelEstateInfo : public LLPanelRegionInfo
00252 {
00253 public:
00254         static void initDispatch(LLDispatcher& dispatch);
00255         
00256         static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data);
00257         static void onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data);
00258         
00259         static void onClickEditSky(void* userdata);
00260         static void onClickEditSkyHelp(void* userdata); 
00261         static void onClickEditDayCycle(void* userdata);
00262         static void onClickEditDayCycleHelp(void* userdata);    
00263 
00264         static void onClickAddAllowedAgent(void* user_data);
00265         static void onClickRemoveAllowedAgent(void* user_data);
00266         static void onClickAddAllowedGroup(void* user_data);
00267         static void onClickRemoveAllowedGroup(void* user_data);
00268         static void onClickAddBannedAgent(void* user_data);
00269         static void onClickRemoveBannedAgent(void* user_data);
00270         static void onClickAddEstateManager(void* user_data);
00271         static void onClickRemoveEstateManager(void* user_data);
00272         static void onClickKickUser(void* userdata);
00273 
00274         // Group picker callback is different, can't use core methods below
00275         static void addAllowedGroup(S32 option, void* data);
00276         static void addAllowedGroup2(LLUUID id, void* data);
00277 
00278         // Core methods for all above add/remove button clicks
00279         static void accessAddCore(U32 operation_flag, const char* dialog_name);
00280         static void accessAddCore2(S32 option, void* data);
00281         static void accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
00282 
00283         static void accessRemoveCore(U32 operation_flag, const char* dialog_name, const char* list_ctrl_name);
00284         static void accessRemoveCore2(S32 option, void* data);
00285 
00286         // used for both add and remove operations
00287         static void accessCoreConfirm(S32 option, void* data);
00288         static void kickUserConfirm(S32 option, void* userdata);
00289 
00290         // Send the actual EstateOwnerRequest "estateaccessdelta" message
00291         static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id);
00292 
00293         static void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
00294         static void onClickMessageEstate(void* data);
00295         static void onMessageCommit(S32 option, const LLString& text, void* data);
00296         
00297         LLPanelEstateInfo();
00298         ~LLPanelEstateInfo() {}
00299         
00300         virtual bool refreshFromRegion(LLViewerRegion* region);
00301         virtual bool estateUpdate(LLMessageSystem* msg);
00302         
00303         // LLPanel
00304         virtual BOOL postBuild();
00305         virtual void updateChild(LLUICtrl* child_ctrl);
00306         virtual void refresh();
00307         
00308         U32 computeEstateFlags();
00309         void setEstateFlags(U32 flags);
00310         
00311         BOOL getGlobalTime();
00312         void setGlobalTime(bool b);
00313 
00314         BOOL getFixedSun();
00315 
00316         F32 getSunHour();
00317         void setSunHour(F32 sun_hour);
00318         
00319         const std::string getEstateName() const;
00320         void setEstateName(const std::string& name);
00321 
00322         U32 getEstateID() const { return mEstateID; }
00323         void setEstateID(U32 estate_id) { mEstateID = estate_id; }
00324         static bool isLindenEstate();
00325         
00326         const std::string getOwnerName() const;
00327         void setOwnerName(const std::string& name);
00328 
00329         const std::string getAbuseEmailAddress() const;
00330         void setAbuseEmailAddress(const std::string& address);
00331 
00332         // If visible from mainland, allowed agent and allowed groups
00333         // are ignored, so must disable UI.
00334         void setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban);
00335 
00336         // this must have the same function signature as
00337         // llmessage/llcachename.h:LLCacheNameCallback
00338         static void callbackCacheName(
00339                 const LLUUID& id,
00340                 const char* first,
00341                 const char* last,
00342                 BOOL is_group,
00343                 void*);
00344 
00345 protected:
00346         virtual BOOL sendUpdate();
00347         // confirmation dialog callback
00348         static void callbackChangeLindenEstate(S32 opt, void* data);
00349 
00350         void commitEstateInfoDataserver();
00351         bool commitEstateInfoCaps();
00352         void commitEstateAccess();
00353         void commitEstateManagers();
00354         
00355         void clearAccessLists();
00356         BOOL checkRemovalButton(std::string name);
00357         BOOL checkSunHourSlider(LLUICtrl* child_ctrl);
00358 
00359         U32 mEstateID;
00360 };
00361 
00363 
00364 class LLPanelEstateCovenant : public LLPanelRegionInfo
00365 {
00366 public:
00367         LLPanelEstateCovenant();
00368         ~LLPanelEstateCovenant() {}
00369         
00370         // LLPanel
00371         virtual BOOL postBuild();
00372         virtual void updateChild(LLUICtrl* child_ctrl);
00373         virtual bool refreshFromRegion(LLViewerRegion* region);
00374         virtual bool estateUpdate(LLMessageSystem* msg);
00375 
00376         // LLView overrides
00377         BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
00378                                                    BOOL drop, EDragAndDropType cargo_type,
00379                                                    void *cargo_data, EAcceptance *accept,
00380                                                    LLString& tooltip_msg);
00381         static void confirmChangeCovenantCallback(S32 option, void* userdata);
00382         static void resetCovenantID(void* userdata);
00383         static void confirmResetCovenantCallback(S32 option, void* userdata);
00384         void sendChangeCovenantID(const LLUUID &asset_id);
00385         void loadInvItem(LLInventoryItem *itemp);
00386         static void onLoadComplete(LLVFS *vfs,
00387                                                            const LLUUID& asset_uuid,
00388                                                            LLAssetType::EType type,
00389                                                            void* user_data, S32 status, LLExtStat ext_status);
00390 
00391         // Accessor functions
00392         static void updateCovenantText(const std::string& string, const LLUUID& asset_id);
00393         static void updateEstateName(const std::string& name);
00394         static void updateLastModified(const std::string& text);
00395         static void updateEstateOwnerName(const std::string& name);
00396 
00397         const LLUUID& getCovenantID() const { return mCovenantID; }
00398         void setCovenantID(const LLUUID& id) { mCovenantID = id; }
00399         const std::string& getEstateName() const;
00400         void setEstateName(const std::string& name);
00401         const std::string& getOwnerName() const;
00402         void setOwnerName(const std::string& name);
00403         void setCovenantTextEditor(const std::string& text);
00404 
00405         typedef enum e_asset_status
00406         {
00407                 ASSET_ERROR,
00408                 ASSET_UNLOADED,
00409                 ASSET_LOADING,
00410                 ASSET_LOADED
00411         } EAssetStatus;
00412 
00413 protected:
00414         virtual BOOL sendUpdate();
00415         LLTextBox*                              mEstateNameText;
00416         LLTextBox*                              mEstateOwnerText;
00417         LLTextBox*                              mLastModifiedText;
00418         // CovenantID from sim
00419         LLUUID                                  mCovenantID;
00420         LLViewerTextEditor*             mEditor;
00421         EAssetStatus                    mAssetStatus;
00422 };
00423 
00424 #endif

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