PageRenderTime 103ms CodeModel.GetById 40ms app.highlight 10ms RepoModel.GetById 30ms app.codeStats 20ms

/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
  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
 28#ifndef LL_LLFLOATERREPORTER_H
 29#define LL_LLFLOATERREPORTER_H
 30
 31#include "llfloater.h"
 32#include "lluuid.h"
 33#include "v3math.h"
 34
 35class LLAvatarName;
 36class LLMessageSystem;
 37class LLViewerTexture;
 38class LLInventoryItem;
 39class LLViewerObject;
 40class LLAgent;
 41class LLToolObjPicker;
 42class LLMeanCollisionData;
 43struct LLResourceData;
 44
 45// these flags are used to label info requests to the server
 46//const U32 BUG_REPORT_REQUEST 		= 0x01 << 0; // DEPRECATED
 47const U32 COMPLAINT_REPORT_REQUEST 	= 0x01 << 1;
 48const U32 OBJECT_PAY_REQUEST		= 0x01 << 2;
 49
 50
 51// ************************************************************
 52// THESE ENUMS ARE IN THE DATABASE!!!
 53//
 54// The process for adding a new report type is to:
 55// 1. Issue a command to the database to insert the new value:
 56//    insert into user_report_type (description)
 57//                values ('${new type name}');
 58// 2. Record the integer value assigned:
 59//    select type from user_report_type
 60//           where description='${new type name}';
 61// 3. Add it here.
 62//     ${NEW TYPE NAME}_REPORT = ${type_number};
 63//
 64// Failure to follow this process WILL result in incorrect
 65// queries on user reports.
 66// ************************************************************
 67enum EReportType
 68{
 69	NULL_REPORT = 0,		// don't use this value anywhere
 70	UNKNOWN_REPORT = 1,
 71	//BUG_REPORT = 2, // DEPRECATED
 72	COMPLAINT_REPORT = 3,
 73	CS_REQUEST_REPORT = 4
 74};
 75
 76class LLFloaterReporter
 77:	public LLFloater
 78{
 79public:
 80	LLFloaterReporter(const LLSD& key);
 81	/*virtual*/ ~LLFloaterReporter();
 82	/*virtual*/ BOOL postBuild();
 83	virtual void draw();
 84	
 85	void setReportType(EReportType type) { mReportType = type; }
 86	
 87	// Enables all buttons
 88	static void showFromMenu(EReportType report_type);
 89
 90	static void showFromObject(const LLUUID& object_id);
 91	static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name);
 92
 93	static void onClickSend			(void *userdata);
 94	static void onClickCancel		(void *userdata);
 95	static void onClickObjPicker	(void *userdata);
 96	void onClickSelectAbuser ();
 97	static void closePickTool	(void *userdata);
 98	static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status);
 99	static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
100	static void setDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
101	
102	// static
103	static void processRegionInfo(LLMessageSystem* msg);
104	
105	void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id);
106
107private:
108	static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null);
109
110	void takeScreenshot();
111	void sendReportViaCaps(std::string url);
112	void uploadImage();
113	bool validateReport();
114	void setReporterID();
115	LLSD gatherReport();
116	void sendReportViaLegacy(const LLSD & report);
117	void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report);
118	void setPosBox(const LLVector3d &pos);
119	void enableControls(BOOL own_avatar);
120	void getObjectInfo(const LLUUID& object_id);
121	void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
122	void setFromAvatarID(const LLUUID& avatar_id);
123	void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name);
124
125private:
126	EReportType		mReportType;
127	LLUUID 			mObjectID;
128	LLUUID			mScreenID;
129	LLUUID			mAbuserID;
130	// Store the real name, not the link, for upstream reporting
131	std::string		mOwnerName;
132	BOOL			mDeselectOnClose;
133	BOOL 			mPicking;
134	LLVector3		mPosition;
135	BOOL			mCopyrightWarningSeen;
136	std::list<LLMeanCollisionData*> mMCDList;
137	std::string		mDefaultSummary;
138	LLResourceData* mResourceDatap;
139};
140
141#endif