PageRenderTime 35ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfloatertools.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 208 lines | 132 code | 40 blank | 36 comment | 0 complexity | d25a354bc7328267eb9f46ea959ba682 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatertools.h
  3. * @brief The edit tools, including move, position, land, etc.
  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_LLFLOATERTOOLS_H
  27. #define LL_LLFLOATERTOOLS_H
  28. #include "llfloater.h"
  29. #include "llcoord.h"
  30. #include "llparcelselection.h"
  31. class LLButton;
  32. class LLCheckBoxCtrl;
  33. class LLPanelPermissions;
  34. class LLPanelObject;
  35. class LLPanelVolume;
  36. class LLPanelContents;
  37. class LLPanelFace;
  38. class LLPanelLandInfo;
  39. class LLRadioGroup;
  40. class LLSlider;
  41. class LLTabContainer;
  42. class LLTextBox;
  43. class LLMediaCtrl;
  44. class LLTool;
  45. class LLParcelSelection;
  46. class LLObjectSelection;
  47. class LLLandImpactsObserver;
  48. typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
  49. class LLFloaterTools
  50. : public LLFloater
  51. {
  52. public:
  53. virtual BOOL postBuild();
  54. static void* createPanelPermissions(void* vdata);
  55. static void* createPanelObject(void* vdata);
  56. static void* createPanelVolume(void* vdata);
  57. static void* createPanelFace(void* vdata);
  58. static void* createPanelContents(void* vdata);
  59. static void* createPanelLandInfo(void* vdata);
  60. LLFloaterTools(const LLSD& key);
  61. virtual ~LLFloaterTools();
  62. /*virtual*/ void onOpen(const LLSD& key);
  63. /*virtual*/ BOOL canClose();
  64. /*virtual*/ void onClose(bool app_quitting);
  65. /*virtual*/ void draw();
  66. /*virtual*/ void onFocusReceived();
  67. // call this once per frame to handle visibility, rect location,
  68. // button highlights, etc.
  69. void updatePopup(LLCoordGL center, MASK mask);
  70. // When the floater is going away, reset any options that need to be
  71. // cleared.
  72. void resetToolState();
  73. enum EInfoPanel
  74. {
  75. PANEL_GENERAL=0,
  76. PANEL_OBJECT,
  77. PANEL_FEATURES,
  78. PANEL_FACE,
  79. PANEL_CONTENTS,
  80. PANEL_COUNT
  81. };
  82. void dirty();
  83. void showPanel(EInfoPanel panel);
  84. void setStatusText(const std::string& text);
  85. static void setEditTool(void* data);
  86. void setTool(const LLSD& user_data);
  87. void saveLastTool();
  88. void onClickBtnDeleteMedia();
  89. void onClickBtnAddMedia();
  90. void onClickBtnEditMedia();
  91. void clearMediaSettings();
  92. void updateMediaTitle();
  93. void navigateToTitleMedia( const std::string url );
  94. bool selectedMediaEditable();
  95. void updateLandImpacts();
  96. private:
  97. void refresh();
  98. void refreshMedia();
  99. void getMediaState();
  100. void updateMediaSettings();
  101. static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
  102. static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
  103. static void setObjectType( LLPCode pcode );
  104. void onClickGridOptions();
  105. public:
  106. LLButton *mBtnFocus;
  107. LLButton *mBtnMove;
  108. LLButton *mBtnEdit;
  109. LLButton *mBtnCreate;
  110. LLButton *mBtnLand;
  111. LLTextBox *mTextStatus;
  112. // Focus buttons
  113. LLRadioGroup* mRadioGroupFocus;
  114. // Move buttons
  115. LLRadioGroup* mRadioGroupMove;
  116. // Edit buttons
  117. LLRadioGroup* mRadioGroupEdit;
  118. LLCheckBoxCtrl *mCheckSelectIndividual;
  119. LLButton* mBtnLink;
  120. LLButton* mBtnUnlink;
  121. LLCheckBoxCtrl* mCheckSnapToGrid;
  122. LLButton* mBtnGridOptions;
  123. LLCheckBoxCtrl* mCheckStretchUniform;
  124. LLCheckBoxCtrl* mCheckStretchTexture;
  125. // !HACK! Replacement of mCheckStretchUniform label because LLCheckBoxCtrl
  126. // doesn't support word_wrap of its label. Need to fix truncation bug EXT-6658
  127. LLTextBox* mCheckStretchUniformLabel;
  128. LLButton *mBtnRotateLeft;
  129. LLButton *mBtnRotateReset;
  130. LLButton *mBtnRotateRight;
  131. LLButton *mBtnDelete;
  132. LLButton *mBtnDuplicate;
  133. LLButton *mBtnDuplicateInPlace;
  134. // Create buttons
  135. LLCheckBoxCtrl *mCheckSticky;
  136. LLCheckBoxCtrl *mCheckCopySelection;
  137. LLCheckBoxCtrl *mCheckCopyCenters;
  138. LLCheckBoxCtrl *mCheckCopyRotates;
  139. // Land buttons
  140. LLRadioGroup* mRadioGroupLand;
  141. LLSlider *mSliderDozerSize;
  142. LLSlider *mSliderDozerForce;
  143. LLButton *mBtnApplyToSelection;
  144. std::vector<LLButton*> mButtons;//[ 15 ];
  145. LLTabContainer *mTab;
  146. LLPanelPermissions *mPanelPermissions;
  147. LLPanelObject *mPanelObject;
  148. LLPanelVolume *mPanelVolume;
  149. LLPanelContents *mPanelContents;
  150. LLPanelFace *mPanelFace;
  151. LLPanelLandInfo *mPanelLandInfo;
  152. LLViewBorder* mCostTextBorder;
  153. LLTabContainer* mTabLand;
  154. LLLandImpactsObserver* mLandImpactsObserver;
  155. LLParcelSelectionHandle mParcelSelection;
  156. LLObjectSelectionHandle mObjectSelection;
  157. LLMediaCtrl *mTitleMedia;
  158. bool mNeedMediaTitle;
  159. private:
  160. BOOL mDirty;
  161. std::map<std::string, std::string> mStatusText;
  162. protected:
  163. LLSD mMediaSettings;
  164. public:
  165. static bool sShowObjectCost;
  166. };
  167. extern LLFloaterTools *gFloaterTools;
  168. #endif