browser/components/shell/public/nsIShellService.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:fd636cb91eba
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 #include "nsISupports.idl"
7
8 interface nsIDOMElement;
9 interface nsIFile;
10
11 [scriptable, uuid(99d2e9f1-3c86-40f7-81fd-3060c18489f0)]
12 interface nsIShellService : nsISupports
13 {
14 /**
15 * Determines whether or not Firefox is the "Default Browser."
16 * This is simply whether or not Firefox is registered to handle
17 * http links.
18 *
19 * @param aStartupCheck true if this is the check being performed
20 * by the first browser window at startup,
21 * false otherwise.
22 * @param aForAllTypes true if the check should be made for HTTP and HTML.
23 * false if the check should be made for HTTP only.
24 * This parameter may be ignored on some platforms.
25 */
26 boolean isDefaultBrowser(in boolean aStartupCheck,
27 [optional] in boolean aForAllTypes);
28
29 /**
30 * Registers Firefox as the "Default Browser."
31 *
32 * @param aClaimAllTypes Register Firefox as the handler for
33 * additional protocols (ftp, chrome etc)
34 * and web documents (.html, .xhtml etc).
35 * @param aForAllUsers Whether or not Firefox should attempt
36 * to become the default browser for all
37 * users on a multi-user system.
38 */
39 void setDefaultBrowser(in boolean aClaimAllTypes, in boolean aForAllUsers);
40
41 /**
42 * Used to determine whether or not to show a "Set Default Browser"
43 * query dialog. This attribute is true if the application is starting
44 * up and "browser.shell.checkDefaultBrowser" is true, otherwise it
45 * is false.
46 */
47 attribute boolean shouldCheckDefaultBrowser;
48
49 /**
50 * Used to determine whether or not to offer "Set as desktop background"
51 * functionality. Even if shell service is available it is not
52 * guaranteed that it is able to set the background for every desktop
53 * which is especially true for Linux with its many different desktop
54 * environments.
55 */
56 readonly attribute boolean canSetDesktopBackground;
57
58 /**
59 * Flags for positioning/sizing of the Desktop Background image.
60 */
61 const long BACKGROUND_TILE = 1;
62 const long BACKGROUND_STRETCH = 2;
63 const long BACKGROUND_CENTER = 3;
64 const long BACKGROUND_FILL = 4;
65 const long BACKGROUND_FIT = 5;
66
67 /**
68 * Sets the desktop background image using either the HTML <IMG>
69 * element supplied or the background image of the element supplied.
70 *
71 * @param aImageElement Either a HTML <IMG> element or an element with
72 * a background image from which to source the
73 * background image.
74 * @param aPosition How to place the image on the desktop
75 */
76 void setDesktopBackground(in nsIDOMElement aElement, in long aPosition);
77
78 /**
79 * Constants identifying applications that can be opened with
80 * openApplication.
81 */
82 const long APPLICATION_MAIL = 0;
83 const long APPLICATION_NEWS = 1;
84
85 /**
86 * Opens the application specified. If more than one application of the
87 * given type is available on the system, the default or "preferred"
88 * application is used.
89 */
90 void openApplication(in long aApplication);
91
92 /**
93 * The desktop background color, visible when no background image is
94 * used, or if the background image is centered and does not fill the
95 * entire screen. A rgb value, where (r << 16 | g << 8 | b)
96 */
97 attribute unsigned long desktopBackgroundColor;
98
99 /**
100 * Opens an application with a specific URI to load.
101 * @param application
102 * The application file (or bundle directory, on OS X)
103 * @param uri
104 * The uri to be loaded by the application
105 */
106 void openApplicationWithURI(in nsIFile aApplication, in ACString aURI);
107
108 /**
109 * The default system handler for web feeds
110 */
111 readonly attribute nsIFile defaultFeedReader;
112 };

mercurial