llfloaterreporter.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:5k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /** 
  2.  * @file llfloaterreporter.h
  3.  * @author Andrew Meadows
  4.  * @brief Abuse reports.
  5.  *
  6.  * $LicenseInfo:firstyear=2006&license=viewergpl$
  7.  * 
  8.  * Copyright (c) 2006-2010, Linden Research, Inc.
  9.  * 
  10.  * Second Life Viewer Source Code
  11.  * The source code in this file ("Source Code") is provided by Linden Lab
  12.  * to you under the terms of the GNU General Public License, version 2.0
  13.  * ("GPL"), unless you have obtained a separate licensing agreement
  14.  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  15.  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16.  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17.  * 
  18.  * There are special exceptions to the terms and conditions of the GPL as
  19.  * it is applied to this Source Code. View the full text of the exception
  20.  * in the file doc/FLOSS-exception.txt in this software distribution, or
  21.  * online at
  22.  * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23.  * 
  24.  * By copying, modifying or distributing this software, you acknowledge
  25.  * that you have read and understood your obligations described above,
  26.  * and agree to abide by those obligations.
  27.  * 
  28.  * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29.  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30.  * COMPLETENESS OR PERFORMANCE.
  31.  * $/LicenseInfo$
  32.  */
  33. #ifndef LL_LLFLOATERREPORTER_H
  34. #define LL_LLFLOATERREPORTER_H
  35. #include "llfloater.h"
  36. #include "lluuid.h"
  37. #include "v3math.h"
  38. class LLMessageSystem;
  39. class LLViewerTexture;
  40. class LLInventoryItem;
  41. class LLViewerObject;
  42. class LLAgent;
  43. class LLToolObjPicker;
  44. class LLMeanCollisionData;
  45. struct LLResourceData;
  46. // these flags are used to label info requests to the server
  47. //const U32 BUG_REPORT_REQUEST  = 0x01 << 0; // DEPRECATED
  48. const U32 COMPLAINT_REPORT_REQUEST  = 0x01 << 1;
  49. const U32 OBJECT_PAY_REQUEST = 0x01 << 2;
  50. // ************************************************************
  51. // THESE ENUMS ARE IN THE DATABASE!!!
  52. //
  53. // The process for adding a new report type is to:
  54. // 1. Issue a command to the database to insert the new value:
  55. //    insert into user_report_type (description)
  56. //                values ('${new type name}');
  57. // 2. Record the integer value assigned:
  58. //    select type from user_report_type
  59. //           where description='${new type name}';
  60. // 3. Add it here.
  61. //     ${NEW TYPE NAME}_REPORT = ${type_number};
  62. //
  63. // Failure to follow this process WILL result in incorrect
  64. // queries on user reports.
  65. // ************************************************************
  66. enum EReportType
  67. {
  68. NULL_REPORT = 0, // don't use this value anywhere
  69. UNKNOWN_REPORT = 1,
  70. //BUG_REPORT = 2, // DEPRECATED
  71. COMPLAINT_REPORT = 3,
  72. CS_REQUEST_REPORT = 4
  73. };
  74. class LLFloaterReporter
  75. : public LLFloater
  76. {
  77. public:
  78. LLFloaterReporter(const LLSD& key);
  79. /*virtual*/ ~LLFloaterReporter();
  80. /*virtual*/ BOOL postBuild();
  81. virtual void draw();
  82. void setReportType(EReportType type) { mReportType = type; }
  83. // Enables all buttons
  84. static void showFromMenu(EReportType report_type);
  85. static void showFromObject(const LLUUID& object_id);
  86. static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name);
  87. static void onClickSend (void *userdata);
  88. static void onClickCancel (void *userdata);
  89. static void onClickObjPicker (void *userdata);
  90. void onClickSelectAbuser ();
  91. static void closePickTool (void *userdata);
  92. static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status);
  93. static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
  94. static void setDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
  95. // static
  96. static void processRegionInfo(LLMessageSystem* msg);
  97. void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id);
  98. private:
  99. static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null);
  100. void takeScreenshot();
  101. void sendReportViaCaps(std::string url);
  102. void uploadImage();
  103. bool validateReport();
  104. void setReporterID();
  105. LLSD gatherReport();
  106. void sendReportViaLegacy(const LLSD & report);
  107. void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report);
  108. void setPosBox(const LLVector3d &pos);
  109. void enableControls(BOOL own_avatar);
  110. void getObjectInfo(const LLUUID& object_id);
  111. void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
  112. void setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name = LLStringUtil::null);
  113. private:
  114. EReportType mReportType;
  115. LLUUID  mObjectID;
  116. LLUUID mScreenID;
  117. LLUUID mAbuserID;
  118. // Store the real name, not the link, for upstream reporting
  119. std::string mOwnerName;
  120. BOOL mDeselectOnClose;
  121. BOOL  mPicking;
  122. LLVector3 mPosition;
  123. BOOL mCopyrightWarningSeen;
  124. std::list<LLMeanCollisionData*> mMCDList;
  125. std::string mDefaultSummary;
  126. LLResourceData* mResourceDatap;
  127. };
  128. #endif