PageRenderTime 107ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloaterreporter.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 141 lines | 76 code | 17 blank | 48 comment | 0 complexity | 2ec9435afd44c1d521472559dff855a4 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloaterreporter.h
  3. * @author Andrew Meadows
  4. * @brief Abuse reports.
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLFLOATERREPORTER_H
  28. #define LL_LLFLOATERREPORTER_H
  29. #include "llfloater.h"
  30. #include "lluuid.h"
  31. #include "v3math.h"
  32. class LLAvatarName;
  33. class LLMessageSystem;
  34. class LLViewerTexture;
  35. class LLInventoryItem;
  36. class LLViewerObject;
  37. class LLAgent;
  38. class LLToolObjPicker;
  39. class LLMeanCollisionData;
  40. struct LLResourceData;
  41. // these flags are used to label info requests to the server
  42. //const U32 BUG_REPORT_REQUEST = 0x01 << 0; // DEPRECATED
  43. const U32 COMPLAINT_REPORT_REQUEST = 0x01 << 1;
  44. const U32 OBJECT_PAY_REQUEST = 0x01 << 2;
  45. // ************************************************************
  46. // THESE ENUMS ARE IN THE DATABASE!!!
  47. //
  48. // The process for adding a new report type is to:
  49. // 1. Issue a command to the database to insert the new value:
  50. // insert into user_report_type (description)
  51. // values ('${new type name}');
  52. // 2. Record the integer value assigned:
  53. // select type from user_report_type
  54. // where description='${new type name}';
  55. // 3. Add it here.
  56. // ${NEW TYPE NAME}_REPORT = ${type_number};
  57. //
  58. // Failure to follow this process WILL result in incorrect
  59. // queries on user reports.
  60. // ************************************************************
  61. enum EReportType
  62. {
  63. NULL_REPORT = 0, // don't use this value anywhere
  64. UNKNOWN_REPORT = 1,
  65. //BUG_REPORT = 2, // DEPRECATED
  66. COMPLAINT_REPORT = 3,
  67. CS_REQUEST_REPORT = 4
  68. };
  69. class LLFloaterReporter
  70. : public LLFloater
  71. {
  72. public:
  73. LLFloaterReporter(const LLSD& key);
  74. /*virtual*/ ~LLFloaterReporter();
  75. /*virtual*/ BOOL postBuild();
  76. virtual void draw();
  77. void setReportType(EReportType type) { mReportType = type; }
  78. // Enables all buttons
  79. static void showFromMenu(EReportType report_type);
  80. static void showFromObject(const LLUUID& object_id);
  81. static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name);
  82. static void onClickSend (void *userdata);
  83. static void onClickCancel (void *userdata);
  84. static void onClickObjPicker (void *userdata);
  85. void onClickSelectAbuser ();
  86. static void closePickTool (void *userdata);
  87. static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status);
  88. static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
  89. static void setDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
  90. // static
  91. static void processRegionInfo(LLMessageSystem* msg);
  92. void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id);
  93. private:
  94. static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null);
  95. void takeScreenshot();
  96. void sendReportViaCaps(std::string url);
  97. void uploadImage();
  98. bool validateReport();
  99. void setReporterID();
  100. LLSD gatherReport();
  101. void sendReportViaLegacy(const LLSD & report);
  102. void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report);
  103. void setPosBox(const LLVector3d &pos);
  104. void enableControls(BOOL own_avatar);
  105. void getObjectInfo(const LLUUID& object_id);
  106. void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
  107. void setFromAvatarID(const LLUUID& avatar_id);
  108. void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name);
  109. private:
  110. EReportType mReportType;
  111. LLUUID mObjectID;
  112. LLUUID mScreenID;
  113. LLUUID mAbuserID;
  114. // Store the real name, not the link, for upstream reporting
  115. std::string mOwnerName;
  116. BOOL mDeselectOnClose;
  117. BOOL mPicking;
  118. LLVector3 mPosition;
  119. BOOL mCopyrightWarningSeen;
  120. std::list<LLMeanCollisionData*> mMCDList;
  121. std::string mDefaultSummary;
  122. LLResourceData* mResourceDatap;
  123. };
  124. #endif