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

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