00001
00032 #ifndef LL_LLFLOATERGODTOOLS_H
00033 #define LL_LLFLOATERGODTOOLS_H
00034
00035 #include "llcoord.h"
00036 #include "llhost.h"
00037 #include "llframetimer.h"
00038
00039 #include "llfloater.h"
00040 #include "llpanel.h"
00041 #include <vector>
00042
00043 class LLButton;
00044 class LLCheckBoxCtrl;
00045 class LLComboBox;
00046 class LLUICtrl;
00047 class LLLineEditor;
00048 class LLPanelGridTools;
00049 class LLPanelRegionTools;
00050 class LLPanelObjectTools;
00051 class LLPanelRequestTools;
00052
00053 class LLSpinCtrl;
00054 class LLTabContainer;
00055 class LLTextBox;
00056 class LLMessageSystem;
00057
00058 class LLFloaterGodTools
00059 : public LLFloater
00060 {
00061 public:
00062
00063 static LLFloaterGodTools* instance();
00064
00065 enum EGodPanel
00066 {
00067 PANEL_GRID,
00068 PANEL_REGION,
00069 PANEL_OBJECT,
00070 PANEL_REQUEST,
00071 PANEL_COUNT
00072 };
00073
00074 static void show(void *);
00075 static void hide(void *);
00076
00077 static void* createPanelGrid(void *userdata);
00078 static void* createPanelRegion(void *userdata);
00079 static void* createPanelObjects(void *userdata);
00080 static void* createPanelRequest(void *userdata);
00081
00082 static void refreshAll();
00083
00084 void showPanel(const LLString& panel_name);
00085
00086 virtual void onClose(bool app_quitting);
00087
00088 virtual void draw();
00089
00090
00091
00092 void updatePopup(LLCoordGL center, MASK mask);
00093
00094
00095 void sendRegionInfoRequest();
00096
00097
00098 static void processRegionInfo(LLMessageSystem* msg);
00099
00100
00101 void sendGodUpdateRegionInfo();
00102
00103 static void onTabChanged(void *data, bool from_click);
00104
00105 protected:
00106 U32 computeRegionFlags() const;
00107
00108 protected:
00109 LLFloaterGodTools();
00110 ~LLFloaterGodTools();
00111
00112
00113
00114 void resetToolState();
00115
00116 static LLFloaterGodTools* sInstance;
00117
00118 public:
00119 LLPanelRegionTools *mPanelRegionTools;
00120 LLPanelObjectTools *mPanelObjectTools;
00121
00122 LLHost mCurrentHost;
00123 LLFrameTimer mUpdateTimer;
00124 };
00125
00126
00127
00128
00129
00130
00131 class LLPanelRegionTools
00132 : public LLPanel
00133 {
00134 public:
00135 LLPanelRegionTools(const std::string& name);
00136 ~LLPanelRegionTools();
00137
00138 BOOL postBuild();
00139
00140 void refresh();
00141
00142 static void onSaveState(void* data);
00143 static void onChangeAnything(LLUICtrl* ctrl, void* userdata);
00144 static void onChangePrelude(LLUICtrl* ctrl, void* data);
00145 static void onChangeSimName(LLLineEditor* caller, void* userdata);
00146 static void onApplyChanges(void* userdata);
00147 static void onBakeTerrain(void *userdata);
00148 static void onRevertTerrain(void *userdata);
00149 static void onSwapTerrain(void *userdata);
00150 static void onSelectRegion(void *userdata);
00151 static void onRefresh(void* userdata);
00152
00153
00154 const std::string getSimName() const;
00155 U32 getEstateID() const;
00156 U32 getParentEstateID() const;
00157 U32 getRegionFlags() const;
00158 U32 getRegionFlagsMask() const;
00159 F32 getBillableFactor() const;
00160 S32 getPricePerMeter() const;
00161 S32 getGridPosX() const;
00162 S32 getGridPosY() const;
00163 S32 getRedirectGridX() const;
00164 S32 getRedirectGridY() const;
00165
00166
00167 void setSimName(char *name);
00168 void setEstateID(U32 id);
00169 void setParentEstateID(U32 id);
00170 void setCheckFlags(U32 flags);
00171 void setBillableFactor(F32 billable_factor);
00172 void setPricePerMeter(S32 price);
00173 void setGridPosX(S32 pos);
00174 void setGridPosY(S32 pos);
00175 void setRedirectGridX(S32 pos);
00176 void setRedirectGridY(S32 pos);
00177
00178 U32 computeRegionFlags(U32 initial_flags) const;
00179 void clearAllWidgets();
00180 void enableAllWidgets();
00181
00182 protected:
00183
00184 void updateCurrentRegion() const;
00185 };
00186
00187
00188
00189
00190
00191
00192 class LLPanelGridTools
00193 : public LLPanel
00194 {
00195 public:
00196 LLPanelGridTools(const std::string& name);
00197 virtual ~LLPanelGridTools();
00198
00199 BOOL postBuild();
00200
00201 void refresh();
00202
00203 static void onClickKickAll(void *data);
00204 static void confirmKick(S32 option, const LLString& text, void* userdata);
00205 static void finishKick(S32 option, void* userdata);
00206 static void onDragSunPhase(LLUICtrl *ctrl, void *userdata);
00207 static void onClickFlushMapVisibilityCaches(void* data);
00208 static void flushMapVisibilityCachesConfirm(S32 option, void* data);
00209
00210 protected:
00211 LLString mKickMessage;
00212 };
00213
00214
00215
00216
00217
00218
00219 class LLPanelObjectTools
00220 : public LLPanel
00221 {
00222 public:
00223 LLPanelObjectTools(const std::string& name);
00224 ~LLPanelObjectTools();
00225
00226 BOOL postBuild();
00227
00228 void refresh();
00229
00230 void setTargetAvatar(const LLUUID& target_id);
00231 U32 computeRegionFlags(U32 initial_flags) const;
00232 void clearAllWidgets();
00233 void enableAllWidgets();
00234 void setCheckFlags(U32 flags);
00235
00236 static void onChangeAnything(LLUICtrl* ctrl, void* data);
00237 static void onApplyChanges(void* data);
00238 static void onClickSet(void* data);
00239 static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
00240 static void onClickDeletePublicOwnedBy(void* data);
00241 static void onClickDeleteAllScriptedOwnedBy(void* data);
00242 static void onClickDeleteAllOwnedBy(void* data);
00243 static void callbackSimWideDeletes(S32 option, void* userdata);
00244 static void onGetTopColliders(void* data);
00245 static void onGetTopScripts(void* data);
00246 static void onGetScriptDigest(void* data);
00247 static void onClickSetBySelection(void* data);
00248
00249 protected:
00250 LLUUID mTargetAvatar;
00251
00252
00253 U32 mSimWideDeletesFlags;
00254 };
00255
00256
00257
00258
00259
00260
00261 class LLPanelRequestTools : public LLPanel
00262 {
00263 public:
00264 LLPanelRequestTools(const std::string& name);
00265 ~LLPanelRequestTools();
00266
00267 BOOL postBuild();
00268
00269 void refresh();
00270
00271 static void sendRequest(const char* request,
00272 const char* parameter,
00273 const LLHost& host);
00274
00275 protected:
00276 static void onClickRequest(void *data);
00277 void sendRequest(const LLHost& host);
00278 };
00279
00280
00281 void send_sim_wide_deletes(const LLUUID& owner_id, U32 flags);
00282
00283 #endif