1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/shell/public/nsIShellService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,112 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIDOMElement; 1.12 +interface nsIFile; 1.13 + 1.14 +[scriptable, uuid(99d2e9f1-3c86-40f7-81fd-3060c18489f0)] 1.15 +interface nsIShellService : nsISupports 1.16 +{ 1.17 + /** 1.18 + * Determines whether or not Firefox is the "Default Browser." 1.19 + * This is simply whether or not Firefox is registered to handle 1.20 + * http links. 1.21 + * 1.22 + * @param aStartupCheck true if this is the check being performed 1.23 + * by the first browser window at startup, 1.24 + * false otherwise. 1.25 + * @param aForAllTypes true if the check should be made for HTTP and HTML. 1.26 + * false if the check should be made for HTTP only. 1.27 + * This parameter may be ignored on some platforms. 1.28 + */ 1.29 + boolean isDefaultBrowser(in boolean aStartupCheck, 1.30 + [optional] in boolean aForAllTypes); 1.31 + 1.32 + /** 1.33 + * Registers Firefox as the "Default Browser." 1.34 + * 1.35 + * @param aClaimAllTypes Register Firefox as the handler for 1.36 + * additional protocols (ftp, chrome etc) 1.37 + * and web documents (.html, .xhtml etc). 1.38 + * @param aForAllUsers Whether or not Firefox should attempt 1.39 + * to become the default browser for all 1.40 + * users on a multi-user system. 1.41 + */ 1.42 + void setDefaultBrowser(in boolean aClaimAllTypes, in boolean aForAllUsers); 1.43 + 1.44 + /** 1.45 + * Used to determine whether or not to show a "Set Default Browser" 1.46 + * query dialog. This attribute is true if the application is starting 1.47 + * up and "browser.shell.checkDefaultBrowser" is true, otherwise it 1.48 + * is false. 1.49 + */ 1.50 + attribute boolean shouldCheckDefaultBrowser; 1.51 + 1.52 + /** 1.53 + * Used to determine whether or not to offer "Set as desktop background" 1.54 + * functionality. Even if shell service is available it is not 1.55 + * guaranteed that it is able to set the background for every desktop 1.56 + * which is especially true for Linux with its many different desktop 1.57 + * environments. 1.58 + */ 1.59 + readonly attribute boolean canSetDesktopBackground; 1.60 + 1.61 + /** 1.62 + * Flags for positioning/sizing of the Desktop Background image. 1.63 + */ 1.64 + const long BACKGROUND_TILE = 1; 1.65 + const long BACKGROUND_STRETCH = 2; 1.66 + const long BACKGROUND_CENTER = 3; 1.67 + const long BACKGROUND_FILL = 4; 1.68 + const long BACKGROUND_FIT = 5; 1.69 + 1.70 + /** 1.71 + * Sets the desktop background image using either the HTML <IMG> 1.72 + * element supplied or the background image of the element supplied. 1.73 + * 1.74 + * @param aImageElement Either a HTML <IMG> element or an element with 1.75 + * a background image from which to source the 1.76 + * background image. 1.77 + * @param aPosition How to place the image on the desktop 1.78 + */ 1.79 + void setDesktopBackground(in nsIDOMElement aElement, in long aPosition); 1.80 + 1.81 + /** 1.82 + * Constants identifying applications that can be opened with 1.83 + * openApplication. 1.84 + */ 1.85 + const long APPLICATION_MAIL = 0; 1.86 + const long APPLICATION_NEWS = 1; 1.87 + 1.88 + /** 1.89 + * Opens the application specified. If more than one application of the 1.90 + * given type is available on the system, the default or "preferred" 1.91 + * application is used. 1.92 + */ 1.93 + void openApplication(in long aApplication); 1.94 + 1.95 + /** 1.96 + * The desktop background color, visible when no background image is 1.97 + * used, or if the background image is centered and does not fill the 1.98 + * entire screen. A rgb value, where (r << 16 | g << 8 | b) 1.99 + */ 1.100 + attribute unsigned long desktopBackgroundColor; 1.101 + 1.102 + /** 1.103 + * Opens an application with a specific URI to load. 1.104 + * @param application 1.105 + * The application file (or bundle directory, on OS X) 1.106 + * @param uri 1.107 + * The uri to be loaded by the application 1.108 + */ 1.109 + void openApplicationWithURI(in nsIFile aApplication, in ACString aURI); 1.110 + 1.111 + /** 1.112 + * The default system handler for web feeds 1.113 + */ 1.114 + readonly attribute nsIFile defaultFeedReader; 1.115 +};