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

Generated on Fri May 16 08:33:30 2008 for SecondLife by  doxygen 1.5.5