PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatergodtools.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 273 lines | 165 code | 58 blank | 50 comment | 0 complexity | d351e1de863725fc3e9bc885c626c76f MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatergodtools.h
  3. * @brief The on-screen rectangle with tool options.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLFLOATERGODTOOLS_H
  27. #define LL_LLFLOATERGODTOOLS_H
  28. #include "llcoord.h"
  29. #include "llhost.h"
  30. #include "llframetimer.h"
  31. #include "llfloater.h"
  32. #include "llpanel.h"
  33. #include <vector>
  34. class LLAvatarName;
  35. class LLButton;
  36. class LLCheckBoxCtrl;
  37. class LLComboBox;
  38. class LLUICtrl;
  39. class LLLineEditor;
  40. class LLPanelGridTools;
  41. class LLPanelRegionTools;
  42. class LLPanelObjectTools;
  43. class LLPanelRequestTools;
  44. //class LLSliderCtrl;
  45. class LLSpinCtrl;
  46. class LLTabContainer;
  47. class LLTextBox;
  48. class LLMessageSystem;
  49. class LLFloaterGodTools
  50. : public LLFloater
  51. {
  52. friend class LLFloaterReg;
  53. public:
  54. enum EGodPanel
  55. {
  56. PANEL_GRID,
  57. PANEL_REGION,
  58. PANEL_OBJECT,
  59. PANEL_REQUEST,
  60. PANEL_COUNT
  61. };
  62. static void* createPanelGrid(void *userdata);
  63. static void* createPanelRegion(void *userdata);
  64. static void* createPanelObjects(void *userdata);
  65. static void* createPanelRequest(void *userdata);
  66. static void refreshAll();
  67. void showPanel(const std::string& panel_name);
  68. virtual void onOpen(const LLSD& key);
  69. virtual void draw();
  70. // call this once per frame to handle visibility, rect location,
  71. // button highlights, etc.
  72. void updatePopup(LLCoordGL center, MASK mask);
  73. // Get data to populate UI.
  74. void sendRegionInfoRequest();
  75. // get and process region info if necessary.
  76. static void processRegionInfo(LLMessageSystem* msg);
  77. // Send possibly changed values to simulator.
  78. void sendGodUpdateRegionInfo();
  79. private:
  80. LLFloaterGodTools(const LLSD& key);
  81. ~LLFloaterGodTools();
  82. protected:
  83. U32 computeRegionFlags() const;
  84. protected:
  85. /*virtual*/ BOOL postBuild();
  86. // When the floater is going away, reset any options that need to be
  87. // cleared.
  88. void resetToolState();
  89. public:
  90. LLPanelRegionTools *mPanelRegionTools;
  91. LLPanelObjectTools *mPanelObjectTools;
  92. LLHost mCurrentHost;
  93. LLFrameTimer mUpdateTimer;
  94. };
  95. //-----------------------------------------------------------------------------
  96. // LLPanelRegionTools
  97. //-----------------------------------------------------------------------------
  98. class LLPanelRegionTools
  99. : public LLPanel
  100. {
  101. public:
  102. LLPanelRegionTools();
  103. /*virtual*/ ~LLPanelRegionTools();
  104. BOOL postBuild();
  105. /*virtual*/ void refresh();
  106. static void onSaveState(void* userdata);
  107. static void onChangeSimName(LLLineEditor* caller, void* userdata);
  108. void onChangeAnything();
  109. void onChangePrelude();
  110. void onApplyChanges();
  111. void onBakeTerrain();
  112. void onRevertTerrain();
  113. void onSwapTerrain();
  114. void onSelectRegion();
  115. void onRefresh();
  116. // set internal checkboxes/spinners/combos
  117. const std::string getSimName() const;
  118. U32 getEstateID() const;
  119. U32 getParentEstateID() const;
  120. U32 getRegionFlags() const;
  121. U32 getRegionFlagsMask() const;
  122. F32 getBillableFactor() const;
  123. S32 getPricePerMeter() const;
  124. S32 getGridPosX() const;
  125. S32 getGridPosY() const;
  126. S32 getRedirectGridX() const;
  127. S32 getRedirectGridY() const;
  128. // set internal checkboxes/spinners/combos
  129. void setSimName(const std::string& name);
  130. void setEstateID(U32 id);
  131. void setParentEstateID(U32 id);
  132. void setCheckFlags(U32 flags);
  133. void setBillableFactor(F32 billable_factor);
  134. void setPricePerMeter(S32 price);
  135. void setGridPosX(S32 pos);
  136. void setGridPosY(S32 pos);
  137. void setRedirectGridX(S32 pos);
  138. void setRedirectGridY(S32 pos);
  139. U32 computeRegionFlags(U32 initial_flags) const;
  140. void clearAllWidgets();
  141. void enableAllWidgets();
  142. protected:
  143. // gets from internal checkboxes/spinners/combos
  144. void updateCurrentRegion() const;
  145. };
  146. //-----------------------------------------------------------------------------
  147. // LLPanelGridTools
  148. //-----------------------------------------------------------------------------
  149. class LLPanelGridTools
  150. : public LLPanel
  151. {
  152. public:
  153. LLPanelGridTools();
  154. virtual ~LLPanelGridTools();
  155. BOOL postBuild();
  156. void refresh();
  157. static void onDragSunPhase(LLUICtrl *ctrl, void *userdata);
  158. void onClickFlushMapVisibilityCaches();
  159. static bool flushMapVisibilityCachesConfirm(const LLSD& notification, const LLSD& response);
  160. protected:
  161. std::string mKickMessage; // Message to send on kick
  162. };
  163. //-----------------------------------------------------------------------------
  164. // LLPanelObjectTools
  165. //-----------------------------------------------------------------------------
  166. class LLPanelObjectTools
  167. : public LLPanel
  168. {
  169. public:
  170. LLPanelObjectTools();
  171. /*virtual*/ ~LLPanelObjectTools();
  172. BOOL postBuild();
  173. /*virtual*/ void refresh();
  174. void setTargetAvatar(const LLUUID& target_id);
  175. U32 computeRegionFlags(U32 initial_flags) const;
  176. void clearAllWidgets();
  177. void enableAllWidgets();
  178. void setCheckFlags(U32 flags);
  179. void onChangeAnything();
  180. void onApplyChanges();
  181. void onClickSet();
  182. void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
  183. void onClickDeletePublicOwnedBy();
  184. void onClickDeleteAllScriptedOwnedBy();
  185. void onClickDeleteAllOwnedBy();
  186. static bool callbackSimWideDeletes(const LLSD& notification, const LLSD& response);
  187. void onGetTopColliders();
  188. void onGetTopScripts();
  189. void onGetScriptDigest();
  190. static void onClickSetBySelection(void* data);
  191. protected:
  192. LLUUID mTargetAvatar;
  193. // For all delete dialogs, store flags here for message.
  194. U32 mSimWideDeletesFlags;
  195. };
  196. //-----------------------------------------------------------------------------
  197. // LLPanelRequestTools
  198. //-----------------------------------------------------------------------------
  199. class LLPanelRequestTools : public LLPanel
  200. {
  201. public:
  202. LLPanelRequestTools();
  203. /*virtual*/ ~LLPanelRequestTools();
  204. BOOL postBuild();
  205. void refresh();
  206. static void sendRequest(const std::string& request,
  207. const std::string& parameter,
  208. const LLHost& host);
  209. protected:
  210. void onClickRequest();
  211. void sendRequest(const LLHost& host);
  212. };
  213. // Flags are SWD_ flags.
  214. void send_sim_wide_deletes(const LLUUID& owner_id, U32 flags);
  215. #endif