michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsXREAppData_h michael@0: #define nsXREAppData_h michael@0: michael@0: #include michael@0: michael@0: class nsIFile; michael@0: michael@0: /** michael@0: * Application-specific data needed to start the apprunner. michael@0: * michael@0: * @note When this structure is allocated and manipulated by XRE_CreateAppData, michael@0: * string fields will be allocated with NS_Alloc, and interface pointers michael@0: * are strong references. michael@0: */ michael@0: struct nsXREAppData michael@0: { michael@0: /** michael@0: * This should be set to sizeof(nsXREAppData). This structure may be michael@0: * extended in future releases, and this ensures that binary compatibility michael@0: * is maintained. michael@0: */ michael@0: uint32_t size; michael@0: michael@0: /** michael@0: * The directory of the application to be run. May be null if the michael@0: * xulrunner and the app are installed into the same directory. michael@0: */ michael@0: nsIFile* directory; michael@0: michael@0: /** michael@0: * The name of the application vendor. This must be ASCII, and is normally michael@0: * mixed-case, e.g. "Mozilla". Optional (may be null), but highly michael@0: * recommended. Must not be the empty string. michael@0: */ michael@0: const char *vendor; michael@0: michael@0: /** michael@0: * The name of the application. This must be ASCII, and is normally michael@0: * mixed-case, e.g. "Firefox". Required (must not be null or an empty michael@0: * string). michael@0: */ michael@0: const char *name; michael@0: michael@0: /** michael@0: * The major version, e.g. "0.8.0+". Optional (may be null), but michael@0: * required for advanced application features such as the extension michael@0: * manager and update service. Must not be the empty string. michael@0: */ michael@0: const char *version; michael@0: michael@0: /** michael@0: * The application's build identifier, e.g. "2004051604" michael@0: */ michael@0: const char *buildID; michael@0: michael@0: /** michael@0: * The application's UUID. Used by the extension manager to determine michael@0: * compatible extensions. Optional, but required for advanced application michael@0: * features such as the extension manager and update service. michael@0: * michael@0: * This has traditionally been in the form michael@0: * "{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}" but for new applications michael@0: * a more readable form is encouraged: "appname@vendor.tld". Only michael@0: * the following characters are allowed: a-z A-Z 0-9 - . @ _ { } * michael@0: */ michael@0: const char *ID; michael@0: michael@0: /** michael@0: * The copyright information to print for the -h commandline flag, michael@0: * e.g. "Copyright (c) 2003 mozilla.org". michael@0: */ michael@0: const char *copyright; michael@0: michael@0: /** michael@0: * Combination of NS_XRE_ prefixed flags (defined below). michael@0: */ michael@0: uint32_t flags; michael@0: michael@0: /** michael@0: * The location of the XRE. XRE_main may not be able to figure this out michael@0: * programatically. michael@0: */ michael@0: nsIFile* xreDirectory; michael@0: michael@0: /** michael@0: * The minimum/maximum compatible XRE version. michael@0: */ michael@0: const char *minVersion; michael@0: const char *maxVersion; michael@0: michael@0: /** michael@0: * The server URL to send crash reports to. michael@0: */ michael@0: const char *crashReporterURL; michael@0: michael@0: /** michael@0: * The profile directory that will be used. Optional (may be null). Must not michael@0: * be the empty string, must be ASCII. The path is split into components michael@0: * along the path separator characters '/' and '\'. michael@0: * michael@0: * The application data directory ("UAppData", see below) is normally michael@0: * composed as follows, where $HOME is platform-specific: michael@0: * michael@0: * UAppData = $HOME[/$vendor]/$name michael@0: * michael@0: * If present, the 'profile' string will be used instead of the combination of michael@0: * vendor and name as follows: michael@0: * michael@0: * UAppData = $HOME/$profile michael@0: */ michael@0: const char *profile; michael@0: michael@0: /** michael@0: * The application name to use in the User Agent string. michael@0: */ michael@0: const char *UAName; michael@0: }; michael@0: michael@0: /** michael@0: * Indicates whether or not the profile migrator service may be michael@0: * invoked at startup when creating a profile. michael@0: */ michael@0: #define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1) michael@0: michael@0: /** michael@0: * Indicates whether or not the extension manager service should be michael@0: * initialized at startup. michael@0: */ michael@0: #define NS_XRE_ENABLE_EXTENSION_MANAGER (1 << 2) michael@0: michael@0: /** michael@0: * Indicates whether or not to use Breakpad crash reporting. michael@0: */ michael@0: #define NS_XRE_ENABLE_CRASH_REPORTER (1 << 3) michael@0: michael@0: #endif // nsXREAppData_h