Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsWindowsHooks Class Reference

#include <nsWindowsHooks.h>

Inheritance diagram for nsWindowsHooks:
Inheritance graph
[legend]
Collaboration diagram for nsWindowsHooks:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsWindowsHooks ()
virtual ~nsWindowsHooks ()
boolean checkSettings (in nsIDOMWindowInternal aParent)
boolean isOptionEnabled (in string option)
 Returns true if command is in the "(appname) QuickLaunch" value in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run key.
void startupAddOption (in string option)
 Adds the option to the "(appname) QuickLaunch" value to the key mentioned above, with data "(path\to\app.exe) option", if not done already.
void startupRemoveOption (in string option)
 Removes the commnand from the "(appname) QuickLaunch" value from the key mentioned above, if not done already.
void setImageAsWallpaper (in nsIDOMElement aImageElement, in boolean useBackground)
 Accepts an element, either an HTML img element or an element with a background image, serializes the image to a bitmap file in the windows directory, and sets it to be the desktop wallpaper.

Public Attributes

attribute nsIWindowsHooksSettings settings

Protected Member Functions

NS_IMETHOD GetSettings (nsWindowsHooksSettings **)
NS_IMETHOD SetRegistry ()

Protected Attributes

char mShortcutPath [MAX_BUF]
char mShortcutName [MAX_BUF]
char mShortcutBase [MAX_BUF]
char mShortcutProg [MAX_BUF]

Detailed Description

Definition at line 113 of file nsWindowsHooks.h.


Constructor & Destructor Documentation

Definition at line 184 of file nsWindowsHooks.cpp.

                               {
}

Definition at line 187 of file nsWindowsHooks.cpp.

                                {
}

Member Function Documentation

Definition at line 192 of file nsWindowsHooks.cpp.

                                                             {
    nsresult rv = NS_OK;

    // Validate input arg.
    NS_ENSURE_ARG( result );

    // Allocate prefs object.
    nsWindowsHooksSettings *prefs = *result = new nsWindowsHooksSettings;
    NS_ENSURE_TRUE( prefs, NS_ERROR_OUT_OF_MEMORY );

    // Got it, increment ref count.
    NS_ADDREF( prefs );

    // Get each registry value and copy to prefs structure.
    prefs->mHandleHTTP   = BoolRegistryEntry( "isHandlingHTTP"   );
    prefs->mHandleHTTPS  = BoolRegistryEntry( "isHandlingHTTPS"  );
    prefs->mHandleFTP    = BoolRegistryEntry( "isHandlingFTP"    );
    prefs->mHandleCHROME = BoolRegistryEntry( "isHandlingCHROME" );
    prefs->mHandleGOPHER = BoolRegistryEntry( "isHandlingGOPHER" );
    prefs->mHandleHTML   = BoolRegistryEntry( "isHandlingHTML"   );
    prefs->mHandleJPEG   = BoolRegistryEntry( "isHandlingJPEG"   );
    prefs->mHandleGIF    = BoolRegistryEntry( "isHandlingGIF"    );
    prefs->mHandlePNG    = BoolRegistryEntry( "isHandlingPNG"    );
    prefs->mHandleMNG    = BoolRegistryEntry( "isHandlingMNG"    );
    prefs->mHandleXBM    = BoolRegistryEntry( "isHandlingXBM"    );
    prefs->mHandleBMP    = BoolRegistryEntry( "isHandlingBMP"    );
    prefs->mHandleICO    = BoolRegistryEntry( "isHandlingICO"    );
    prefs->mHandleXML    = BoolRegistryEntry( "isHandlingXML"    );
    prefs->mHandleXHTML  = BoolRegistryEntry( "isHandlingXHTML"  );
    prefs->mHandleXUL    = BoolRegistryEntry( "isHandlingXUL"    );
    prefs->mShowDialog   = BoolRegistryEntry( "showDialog"       );
    prefs->mHaveBeenSet  = BoolRegistryEntry( "haveBeenSet"      );

#ifdef DEBUG_law
NS_WARN_IF_FALSE( NS_SUCCEEDED( rv ), "GetPreferences failed" );
#endif

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if command is in the "(appname) QuickLaunch" value in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run key.

void nsIWindowsHooks::setImageAsWallpaper ( in nsIDOMElement  aImageElement,
in boolean  useBackground 
) [inherited]

Accepts an element, either an HTML img element or an element with a background image, serializes the image to a bitmap file in the windows directory, and sets it to be the desktop wallpaper.

Definition at line 590 of file nsWindowsHooks.cpp.

                            {
    nsresult rv = NS_OK;

    // Get raw prefs object.
    nsWindowsHooksSettings *prefs;
    rv = this->GetSettings( &prefs );

    NS_ENSURE_TRUE( NS_SUCCEEDED( rv ), rv );

    if ( prefs->mHandleHTML ) {
        (void) mozillaMarkup.set();
    } else {
        (void) mozillaMarkup.reset();
    }
    if ( prefs->mHandleJPEG ) {
        (void) jpg.set();
    } else {
        (void) jpg.reset();
    }
    if ( prefs->mHandleGIF ) {
        (void) gif.set();
    } else {
        (void) gif.reset();
    }
    if ( prefs->mHandlePNG ) {
        (void) png.set();
    } else {
        (void) png.reset();
    }
    if ( prefs->mHandleMNG ) {
        (void) mng.set();
    } else {
        (void) mng.reset();
    }
    if ( prefs->mHandleXBM ) {
        (void) xbm.set();
    } else {
        (void) xbm.reset();
    }
    if ( prefs->mHandleBMP ) {
        (void) bmp.set();
    } else {
        (void) bmp.reset();
    }
    if ( prefs->mHandleICO ) {
        (void) ico.set();
    } else {
        (void) ico.reset();
    }
    if ( prefs->mHandleXML ) {
        (void) xml.set();
    } else {
        (void) xml.reset();
    }
    if ( prefs->mHandleXHTML ) {
        (void) xhtml.set();
    } else {
        (void) xhtml.reset();
    }
    if ( prefs->mHandleXUL ) {
        (void) xul.set();
    } else {
        (void) xul.reset();
    }
    if ( prefs->mHandleHTTP ) {
        (void) http.set();
    } else {
        (void) http.reset();
    }
    if ( prefs->mHandleHTTPS ) {
        (void) https.set();
    } else {
        (void) https.reset();
    }
    if ( prefs->mHandleFTP ) {
        (void) ftp.set();
    } else {
        (void) ftp.reset();
    }
    if ( prefs->mHandleCHROME ) {
        (void) chrome.set();
    } else {
        (void) chrome.reset();
    }
    if ( prefs->mHandleGOPHER ) {
        (void) gopher.set();
    } else {
        (void) gopher.reset();
    }

    // Call SHChangeNotify() to notify the windows shell that file
    // associations changed, and that an update of the icons need to occur.
    SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);

    return NS_OK;
}

Here is the call graph for this function:

Adds the option to the "(appname) QuickLaunch" value to the key mentioned above, with data "(path\to\app.exe) option", if not done already.

Removes the commnand from the "(appname) QuickLaunch" value from the key mentioned above, if not done already.

And deletes the "(appname) QuickLaunch" value entirely if there are no options left


Member Data Documentation

Definition at line 131 of file nsWindowsHooks.h.

Definition at line 130 of file nsWindowsHooks.h.

Definition at line 129 of file nsWindowsHooks.h.

Definition at line 132 of file nsWindowsHooks.h.

Definition at line 169 of file nsIWindowsHooks.idl.


The documentation for this class was generated from the following files: