lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / desktop / crashreport.hxx
blob585c0af5e1a956d7b70dca3c409b80a5b421576e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_DESKTOP_CRASHREPORT_HXX
11 #define INCLUDED_DESKTOP_CRASHREPORT_HXX
13 #include <desktop/dllapi.h>
15 #include <rtl/ustring.hxx>
16 #include <osl/mutex.hxx>
18 #include <config_features.h>
20 // vector not sort the entries
21 #include <vector>
22 #include <string>
24 namespace google_breakpad
26 class ExceptionHandler;
29 /**
30 * Provides access to the crash reporter service.
32 * Valid keys are:
33 * * AdapterVendorId
34 * * AdapterDeviceId
37 class
38 #if HAVE_FEATURE_BREAKPAD
39 // MSVC 2013 has undefined symbols for inline functions if it's exported
40 CRASHREPORT_DLLPUBLIC
41 #endif
42 /*class*/ CrashReporter
44 public:
45 typedef enum {AddItem, Write, Create} tAddKeyHandling;
46 #if HAVE_FEATURE_BREAKPAD
47 static void addKeyValue(const OUString& rKey, const OUString& rValue, tAddKeyHandling AddKeyHandling);
49 static void storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler);
51 static bool crashReportInfoExists();
53 static bool readSendConfig(std::string& response);
55 static bool IsDumpEnable();
57 private:
58 static osl::Mutex maMutex;
59 static bool mbInit;
60 typedef struct _mpair
62 OUString first;
63 OUString second;
64 _mpair(const OUString& First, const OUString& Second)
66 first = First;
67 second = Second;
69 } mpair;
71 typedef std::vector<mpair> vmaKeyValues;
72 static vmaKeyValues maKeyValues; // used to temporarily save entries before the old info has been uploaded
74 static google_breakpad::ExceptionHandler* mpExceptionHandler;
76 static std::string getIniFileName();
77 static void writeCommonInfo();
78 static void writeToFile(std::ios_base::openmode Openmode);
79 // when we create the ExceptionHandler we have no access to the user
80 // profile yet, so update when we have access
81 static void updateMinidumpLocation();
83 #else
84 // Add dummy methods for the non-breakpad case. That allows us to use
85 // // the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
86 // // everywhere we want to log something to the crash report system.
87 inline static void addKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/, SAL_UNUSED_PARAMETER tAddKeyHandling /*AddKeyHandling*/) {};
88 #endif // HAVE_FEATURE_BREAKPAD
91 #endif // INCLUDED_DESKTOP_CRASHREPORT_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */