llfloaterreporter.h

Go to the documentation of this file.
00001 
00033 #ifndef LL_LLFLOATERREPORTER_H
00034 #define LL_LLFLOATERREPORTER_H
00035 
00036 #include "llfloater.h"
00037 #include "lluuid.h"
00038 #include "v3math.h"
00039 
00040 class LLMessageSystem;
00041 class LLViewerImage;
00042 class LLInventoryItem;
00043 class LLViewerObject;
00044 class LLAgent;
00045 class LLToolObjPicker;
00046 class LLMeanCollisionData;
00047 struct LLResourceData;
00048 
00049 // these flags are used to label info requests to the server
00050 const U32 BUG_REPORT_REQUEST            = 0x01 << 0;
00051 const U32 COMPLAINT_REPORT_REQUEST      = 0x01 << 1;
00052 
00053 // ************************************************************
00054 // THESE ENUMS ARE IN THE DATABASE!!!
00055 //
00056 // The process for adding a new report type is to:
00057 // 1. Issue a command to the database to insert the new value:
00058 //    insert into user_report_type (description)
00059 //                values ('${new type name}');
00060 // 2. Record the integer value assigned:
00061 //    select type from user_report_type
00062 //           where description='${new type name}';
00063 // 3. Add it here.
00064 //     ${NEW TYPE NAME}_REPORT = ${type_number};
00065 //
00066 // Failure to follow this process WILL result in incorrect
00067 // queries on user reports.
00068 // ************************************************************
00069 enum EReportType
00070 {
00071         NULL_REPORT = 0,                // don't use this value anywhere
00072         UNKNOWN_REPORT = 1,
00073         BUG_REPORT = 2,
00074         COMPLAINT_REPORT = 3,
00075         CS_REQUEST_REPORT = 4
00076 };
00077 
00078 class LLFloaterReporter
00079 :       public LLFloater
00080 {
00081 public:
00082         LLFloaterReporter(const std::string& name, 
00083                                           const LLRect &rect, 
00084                                           const std::string& title, 
00085                                           EReportType = UNKNOWN_REPORT);
00086         /*virtual*/ ~LLFloaterReporter();
00087 
00088         virtual void draw();
00089 
00090         // Enables all buttons
00091         static void showFromMenu(EReportType report_type);
00092 
00093         static LLFloaterReporter* showFromObject(const LLUUID& object_id, bool show = true);
00094 
00095         static void onClickSend                 (void *userdata);
00096         static void onClickCancel               (void *userdata);
00097         static void onClickObjPicker    (void *userdata);
00098         static void onClickSelectAbuser (void *userdata);
00099         static void closePickTool       (void *userdata);
00100         static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status);
00101         static void addDescription(const LLString& description, LLMeanCollisionData *mcd = NULL);
00102         static void setDescription(const LLString& description, LLMeanCollisionData *mcd = NULL);
00103         
00104         // returns a pointer to reporter of report_type
00105         static LLFloaterReporter* getReporter(EReportType report_type);
00106         static LLFloaterReporter* createNewAbuseReporter();
00107         static LLFloaterReporter* createNewBugReporter();
00108 
00109         // static
00110         static void processRegionInfo(LLMessageSystem* msg);
00111         
00112         void setPickedObjectProperties(const LLString& object_name, const LLString& owner_name, const LLUUID owner_id);
00113 
00114 private:
00115         void takeScreenshot();
00116         void sendReportViaCaps(std::string url);
00117         void uploadImage();
00118         bool validateReport();
00119         void setReporterID();
00120         LLSD gatherReport();
00121         void sendReportViaLegacy(const LLSD & report);
00122         void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report);
00123         void setPosBox(const LLVector3d &pos);
00124         void enableControls(BOOL own_avatar);
00125         void getObjectInfo(const LLUUID& object_id);
00126         static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
00127 
00128 private:
00129         EReportType             mReportType;
00130         LLUUID                  mObjectID;
00131         LLUUID                  mScreenID;
00132         LLUUID                  mAbuserID;
00133         BOOL                    mDeselectOnClose;
00134         BOOL                    mPicking;
00135         LLVector3               mPosition;
00136         BOOL                    mCopyrightWarningSeen;
00137         std::list<LLMeanCollisionData*> mMCDList;
00138         LLString                mDefaultSummary;
00139         LLResourceData* mResourceDatap;
00140 };
00141 
00142 #endif

Generated on Thu Jul 1 06:08:36 2010 for Second Life Viewer by  doxygen 1.4.7