ToolMap
Loading...
Searching...
No Matches
lscrashreport.h
1/***************************************************************************
2 lscrashreport.h
3 -------------------
4 copyright : (C) 2012 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef _LSCRASHREPORT_H_
16#define _LSCRASHREPORT_H_
17
18// For compilers that support precompilation, includes "wx/wx.h".
19#include "wx/wxprec.h"
20
21// Include wxWidgets' headers
22#ifndef WX_PRECOMP
23#include <wx/wx.h>
24#endif
25
26#include <curl/curl.h>
27#include <wx/debugrpt.h>
28#include <wx/filename.h>
29#include <wx/hyperlink.h>
30#include <wx/mstream.h>
31#include <wx/sstream.h>
32
33class lsCrashReport_DLG : public wxDialog {
34 private:
35 wxStaticText* m_InfoTextCtrl;
36 wxTextCtrl* m_CrashEmailCtrl;
37 wxTextCtrl* m_CrashDescCtrl;
38 wxHyperlinkCtrl* m_DisplayInfoLinkCtrl;
39 wxString m_CrashDirectory;
40
41 void OnLinkClicked(wxHyperlinkEvent& event);
42
43 void _CreateControls();
44
45 public:
46 lsCrashReport_DLG(wxWindow* parent, const wxString& softname, const wxString& tempdirectory,
47 wxWindowID id = wxID_ANY, const wxString& title = _("Fatal exception"),
48 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
49 long style = wxDEFAULT_DIALOG_STYLE);
50
52
53 wxString GetEmail();
54
55 wxString GetDescription();
56};
57
58/*************************************************************************************/
64 private:
65 wxString m_SoftName;
66 wxString m_ReportZipName;
67 bool m_Silent;
68 wxArrayString m_AddedFileNames;
69 wxDebugReportCompress* m_Report;
70
71 wxString _CreateStyleSheet();
72
73 wxString _CreateGeneralInfo();
74
75 wxString _CreateAddInfo(const wxString& email, const wxString& description);
76
77 public:
78 lsCrashReport(const wxString& softname);
79
80 virtual ~lsCrashReport();
81
82 void AddFileToReport(const wxString& filename);
83
84 bool PrepareReport(wxDebugReport::Context ctx, bool silent = false);
85
86 bool SendReportWeb(const wxString& serverurl, const wxString& proxy = wxEmptyString);
87
88 bool SaveReportFile(const wxString& directory);
89 wxString BuildReportBaseName() const;
90};
91
92// CALLBACK FOR CURL
93size_t wxcurl_string_write(void* ptr, size_t size, size_t nmemb, void* stream);
94
95#endif
Definition lscrashreport.h:33
Crash report class.
Definition lscrashreport.h:63