|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef nsXREAppData_h |
|
7 #define nsXREAppData_h |
|
8 |
|
9 #include <stdint.h> |
|
10 |
|
11 class nsIFile; |
|
12 |
|
13 /** |
|
14 * Application-specific data needed to start the apprunner. |
|
15 * |
|
16 * @note When this structure is allocated and manipulated by XRE_CreateAppData, |
|
17 * string fields will be allocated with NS_Alloc, and interface pointers |
|
18 * are strong references. |
|
19 */ |
|
20 struct nsXREAppData |
|
21 { |
|
22 /** |
|
23 * This should be set to sizeof(nsXREAppData). This structure may be |
|
24 * extended in future releases, and this ensures that binary compatibility |
|
25 * is maintained. |
|
26 */ |
|
27 uint32_t size; |
|
28 |
|
29 /** |
|
30 * The directory of the application to be run. May be null if the |
|
31 * xulrunner and the app are installed into the same directory. |
|
32 */ |
|
33 nsIFile* directory; |
|
34 |
|
35 /** |
|
36 * The name of the application vendor. This must be ASCII, and is normally |
|
37 * mixed-case, e.g. "Mozilla". Optional (may be null), but highly |
|
38 * recommended. Must not be the empty string. |
|
39 */ |
|
40 const char *vendor; |
|
41 |
|
42 /** |
|
43 * The name of the application. This must be ASCII, and is normally |
|
44 * mixed-case, e.g. "Firefox". Required (must not be null or an empty |
|
45 * string). |
|
46 */ |
|
47 const char *name; |
|
48 |
|
49 /** |
|
50 * The major version, e.g. "0.8.0+". Optional (may be null), but |
|
51 * required for advanced application features such as the extension |
|
52 * manager and update service. Must not be the empty string. |
|
53 */ |
|
54 const char *version; |
|
55 |
|
56 /** |
|
57 * The application's build identifier, e.g. "2004051604" |
|
58 */ |
|
59 const char *buildID; |
|
60 |
|
61 /** |
|
62 * The application's UUID. Used by the extension manager to determine |
|
63 * compatible extensions. Optional, but required for advanced application |
|
64 * features such as the extension manager and update service. |
|
65 * |
|
66 * This has traditionally been in the form |
|
67 * "{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}" but for new applications |
|
68 * a more readable form is encouraged: "appname@vendor.tld". Only |
|
69 * the following characters are allowed: a-z A-Z 0-9 - . @ _ { } * |
|
70 */ |
|
71 const char *ID; |
|
72 |
|
73 /** |
|
74 * The copyright information to print for the -h commandline flag, |
|
75 * e.g. "Copyright (c) 2003 mozilla.org". |
|
76 */ |
|
77 const char *copyright; |
|
78 |
|
79 /** |
|
80 * Combination of NS_XRE_ prefixed flags (defined below). |
|
81 */ |
|
82 uint32_t flags; |
|
83 |
|
84 /** |
|
85 * The location of the XRE. XRE_main may not be able to figure this out |
|
86 * programatically. |
|
87 */ |
|
88 nsIFile* xreDirectory; |
|
89 |
|
90 /** |
|
91 * The minimum/maximum compatible XRE version. |
|
92 */ |
|
93 const char *minVersion; |
|
94 const char *maxVersion; |
|
95 |
|
96 /** |
|
97 * The server URL to send crash reports to. |
|
98 */ |
|
99 const char *crashReporterURL; |
|
100 |
|
101 /** |
|
102 * The profile directory that will be used. Optional (may be null). Must not |
|
103 * be the empty string, must be ASCII. The path is split into components |
|
104 * along the path separator characters '/' and '\'. |
|
105 * |
|
106 * The application data directory ("UAppData", see below) is normally |
|
107 * composed as follows, where $HOME is platform-specific: |
|
108 * |
|
109 * UAppData = $HOME[/$vendor]/$name |
|
110 * |
|
111 * If present, the 'profile' string will be used instead of the combination of |
|
112 * vendor and name as follows: |
|
113 * |
|
114 * UAppData = $HOME/$profile |
|
115 */ |
|
116 const char *profile; |
|
117 |
|
118 /** |
|
119 * The application name to use in the User Agent string. |
|
120 */ |
|
121 const char *UAName; |
|
122 }; |
|
123 |
|
124 /** |
|
125 * Indicates whether or not the profile migrator service may be |
|
126 * invoked at startup when creating a profile. |
|
127 */ |
|
128 #define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1) |
|
129 |
|
130 /** |
|
131 * Indicates whether or not the extension manager service should be |
|
132 * initialized at startup. |
|
133 */ |
|
134 #define NS_XRE_ENABLE_EXTENSION_MANAGER (1 << 2) |
|
135 |
|
136 /** |
|
137 * Indicates whether or not to use Breakpad crash reporting. |
|
138 */ |
|
139 #define NS_XRE_ENABLE_CRASH_REPORTER (1 << 3) |
|
140 |
|
141 #endif // nsXREAppData_h |