Back to index

lightning-sunbird  0.9+nobinonly
nsWindowsHooks.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Aaron Kaluszka <ask@swva.net>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef nswindowshooks_h____
00040 #define nswindowshooks_h____
00041 
00042 #include "nscore.h"
00043 #include "nsIWindowsHooks.h"
00044 
00045 #ifndef MAX_BUF
00046 #define MAX_BUF 4096
00047 #endif
00048 
00049 /* c09bc130-0a71-11d4-8076-00600811a9c3 */
00050 #define NS_IWINDOWSHOOKS_CID \
00051  { 0xc09bc130, 0x0a71, 0x11d4, {0x80, 0x76, 0x00, 0x60, 0x08, 0x11, 0xa9, 0xc3} }
00052 
00053 class nsWindowsHooksSettings : public nsIWindowsHooksSettings {
00054 public:
00055     // ctor/dtor
00056     nsWindowsHooksSettings();
00057     virtual ~nsWindowsHooksSettings();
00058 
00059     // Declare all interface methods we must implement.
00060     NS_DECL_ISUPPORTS
00061     NS_DECL_NSIWINDOWSHOOKSSETTINGS
00062 
00063     // Typedef for nsIWindowsHooksSettings getter/setter member functions.
00064     typedef
00065     NS_STDCALL_FUNCPROTO(nsresult,
00066                          getter,
00067                          nsIWindowsHooksSettings, GetShowDialog, 
00068                          (PRBool*));
00069 
00070     typedef
00071     NS_STDCALL_FUNCPROTO(nsresult,
00072                          setter,
00073                          nsIWindowsHooksSettings, SetShowDialog,
00074                          (PRBool));
00075 
00076 protected:
00077     // General purpose getter.
00078     NS_IMETHOD Get( PRBool *result, PRBool nsWindowsHooksSettings::*member );
00079     // General purpose setter.
00080     NS_IMETHOD Set( PRBool value, PRBool nsWindowsHooksSettings::*member );
00081 
00082 private:
00083     // Internet shortcut protocols.
00084         PRBool mHandleHTTP;
00085         PRBool mHandleHTTPS;
00086         PRBool mHandleFTP;
00087         PRBool mHandleCHROME;
00088         PRBool mHandleGOPHER;
00089     // File types.
00090         PRBool mHandleHTML;
00091         PRBool mHandleJPEG;
00092         PRBool mHandleGIF;
00093         PRBool mHandlePNG;
00094         PRBool mHandleMNG;
00095         PRBool mHandleXBM;
00096         PRBool mHandleBMP;
00097         PRBool mHandleICO;
00098         PRBool mHandleXML;
00099         PRBool mHandleXHTML;
00100         PRBool mHandleXUL;
00101     // Dialog
00102         PRBool mShowDialog;
00103 
00104     // Special member to handle initialization.
00105     PRBool mHaveBeenSet;
00106     NS_IMETHOD GetHaveBeenSet( PRBool * );
00107     NS_IMETHOD SetHaveBeenSet( PRBool );
00108 
00109     // Give nsWindowsHooks full access.
00110     friend class nsWindowsHooks;
00111 }; // nsWindowsHooksSettings
00112 
00113 class nsWindowsHooks : public nsIWindowsHooks {
00114 public:
00115     // ctor/dtor
00116     nsWindowsHooks();
00117     virtual ~nsWindowsHooks();
00118 
00119     // Declare all interface methods we must implement.
00120     NS_DECL_ISUPPORTS
00121     NS_DECL_NSIWINDOWSHOOKS
00122 
00123 protected:
00124     // Internal flavor of GetPreferences.
00125     NS_IMETHOD GetSettings( nsWindowsHooksSettings ** );
00126 
00127     // Set registry according to settings.
00128     NS_IMETHOD SetRegistry();
00129     char mShortcutPath[MAX_BUF];
00130     char mShortcutName[MAX_BUF];
00131     char mShortcutBase[MAX_BUF];
00132     char mShortcutProg[MAX_BUF];
00133 }; // nsWindowsHooksSettings
00134 
00135 #endif // nswindowshooks_h____