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: #include "nsISupports.idl"
michael@0:
michael@0: interface nsIDOMElement;
michael@0: interface nsIFile;
michael@0:
michael@0: [scriptable, uuid(99d2e9f1-3c86-40f7-81fd-3060c18489f0)]
michael@0: interface nsIShellService : nsISupports
michael@0: {
michael@0: /**
michael@0: * Determines whether or not Firefox is the "Default Browser."
michael@0: * This is simply whether or not Firefox is registered to handle
michael@0: * http links.
michael@0: *
michael@0: * @param aStartupCheck true if this is the check being performed
michael@0: * by the first browser window at startup,
michael@0: * false otherwise.
michael@0: * @param aForAllTypes true if the check should be made for HTTP and HTML.
michael@0: * false if the check should be made for HTTP only.
michael@0: * This parameter may be ignored on some platforms.
michael@0: */
michael@0: boolean isDefaultBrowser(in boolean aStartupCheck,
michael@0: [optional] in boolean aForAllTypes);
michael@0:
michael@0: /**
michael@0: * Registers Firefox as the "Default Browser."
michael@0: *
michael@0: * @param aClaimAllTypes Register Firefox as the handler for
michael@0: * additional protocols (ftp, chrome etc)
michael@0: * and web documents (.html, .xhtml etc).
michael@0: * @param aForAllUsers Whether or not Firefox should attempt
michael@0: * to become the default browser for all
michael@0: * users on a multi-user system.
michael@0: */
michael@0: void setDefaultBrowser(in boolean aClaimAllTypes, in boolean aForAllUsers);
michael@0:
michael@0: /**
michael@0: * Used to determine whether or not to show a "Set Default Browser"
michael@0: * query dialog. This attribute is true if the application is starting
michael@0: * up and "browser.shell.checkDefaultBrowser" is true, otherwise it
michael@0: * is false.
michael@0: */
michael@0: attribute boolean shouldCheckDefaultBrowser;
michael@0:
michael@0: /**
michael@0: * Used to determine whether or not to offer "Set as desktop background"
michael@0: * functionality. Even if shell service is available it is not
michael@0: * guaranteed that it is able to set the background for every desktop
michael@0: * which is especially true for Linux with its many different desktop
michael@0: * environments.
michael@0: */
michael@0: readonly attribute boolean canSetDesktopBackground;
michael@0:
michael@0: /**
michael@0: * Flags for positioning/sizing of the Desktop Background image.
michael@0: */
michael@0: const long BACKGROUND_TILE = 1;
michael@0: const long BACKGROUND_STRETCH = 2;
michael@0: const long BACKGROUND_CENTER = 3;
michael@0: const long BACKGROUND_FILL = 4;
michael@0: const long BACKGROUND_FIT = 5;
michael@0:
michael@0: /**
michael@0: * Sets the desktop background image using either the HTML
michael@0: * element supplied or the background image of the element supplied.
michael@0: *
michael@0: * @param aImageElement Either a HTML
element or an element with
michael@0: * a background image from which to source the
michael@0: * background image.
michael@0: * @param aPosition How to place the image on the desktop
michael@0: */
michael@0: void setDesktopBackground(in nsIDOMElement aElement, in long aPosition);
michael@0:
michael@0: /**
michael@0: * Constants identifying applications that can be opened with
michael@0: * openApplication.
michael@0: */
michael@0: const long APPLICATION_MAIL = 0;
michael@0: const long APPLICATION_NEWS = 1;
michael@0:
michael@0: /**
michael@0: * Opens the application specified. If more than one application of the
michael@0: * given type is available on the system, the default or "preferred"
michael@0: * application is used.
michael@0: */
michael@0: void openApplication(in long aApplication);
michael@0:
michael@0: /**
michael@0: * The desktop background color, visible when no background image is
michael@0: * used, or if the background image is centered and does not fill the
michael@0: * entire screen. A rgb value, where (r << 16 | g << 8 | b)
michael@0: */
michael@0: attribute unsigned long desktopBackgroundColor;
michael@0:
michael@0: /**
michael@0: * Opens an application with a specific URI to load.
michael@0: * @param application
michael@0: * The application file (or bundle directory, on OS X)
michael@0: * @param uri
michael@0: * The uri to be loaded by the application
michael@0: */
michael@0: void openApplicationWithURI(in nsIFile aApplication, in ACString aURI);
michael@0:
michael@0: /**
michael@0: * The default system handler for web feeds
michael@0: */
michael@0: readonly attribute nsIFile defaultFeedReader;
michael@0: };