Back to index

lightning-sunbird  0.9+nobinonly
nsWidgetFactory.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; 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  * Christopher Blizzard.
00019  * Portions created by the Initial Developer are Copyright (C) 2000
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Christopher Blizzzard <blizzard@mozilla.org>
00024  *   Stuart Parmenter <pavlov@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsIGenericFactory.h"
00041 #include "nsIModule.h"
00042 #include "nsCOMPtr.h"
00043 #include "nsWidgetsCID.h"
00044 
00045 #include "nsWindow.h"
00046 #include "nsAppShell.h"
00047 #include "nsToolkit.h"
00048 #include "nsLookAndFeel.h"
00049 #include "nsTransferable.h"
00050 #include "nsClipboard.h"
00051 #include "nsClipboardHelper.h"
00052 #include "nsHTMLFormatConverter.h"
00053 #ifdef PHOTON_DND
00054 #include "nsDragService.h"
00055 #endif
00056 #include "nsSound.h"
00057 #ifdef IBMBIDI
00058 #include "nsBidiKeyboard.h"
00059 #endif
00060 
00061 #include "nsFilePicker.h"
00062 
00063 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
00064 NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
00065 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell)
00066 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
00067 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
00068 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
00069 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
00070 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
00071 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
00072 #ifdef PHOTON_DND
00073 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
00074 #endif
00075 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
00076 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
00077 
00078 #ifdef IBMBIDI
00079 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
00080 #endif
00081 
00082 static nsModuleComponentInfo components[] =
00083 {
00084   { "Ph nsWindow",
00085     NS_WINDOW_CID,
00086     "@mozilla.org/widgets/window/ph;1",
00087     nsWindowConstructor },
00088   { "Ph Child nsWindow",
00089     NS_CHILD_CID,
00090     "@mozilla.org/widgets/child_window/ph;1",
00091     ChildWindowConstructor },
00092   { "Ph AppShell",
00093     NS_APPSHELL_CID,
00094     "@mozilla.org/widget/appshell/ph;1",
00095     nsAppShellConstructor },
00096   { "Ph Toolkit",
00097     NS_TOOLKIT_CID,
00098     "@mozilla.org/widget/toolkit/ph;1",
00099     nsToolkitConstructor },
00100   { "Ph Look And Feel",
00101     NS_LOOKANDFEEL_CID,
00102     "@mozilla.org/widget/lookandfeel;1",
00103     nsLookAndFeelConstructor },
00104   { "Transferrable",
00105     NS_TRANSFERABLE_CID,
00106     "@mozilla.org/widget/transferable;1",
00107     nsTransferableConstructor },
00108   { "Ph Clipboard",
00109     NS_CLIPBOARD_CID,
00110     "@mozilla.org/widget/clipboard;1",
00111     nsClipboardConstructor },
00112   { "Clipboard Helper",
00113     NS_CLIPBOARDHELPER_CID,
00114     "@mozilla.org/widget/clipboardhelper;1",
00115     nsClipboardHelperConstructor },
00116   { "HTML Format Converter",
00117     NS_HTMLFORMATCONVERTER_CID,
00118     "@mozilla.org/widget/htmlformatconverter;1",
00119     nsHTMLFormatConverterConstructor },
00120 #ifdef PHOTON_DND
00121   { "Ph Drag Service",
00122     NS_DRAGSERVICE_CID,
00123     "@mozilla.org/widget/dragservice;1",
00124     nsDragServiceConstructor },
00125 #endif
00126   { "Ph Sound",
00127     NS_SOUND_CID,
00128     "@mozilla.org/sound;1",
00129     nsSoundConstructor },
00130 #ifdef IBMBIDI
00131     { "Gtk Bidi Keyboard",
00132     NS_BIDIKEYBOARD_CID,
00133     "@mozilla.org/widget/bidikeyboard;1",
00134     nsBidiKeyboardConstructor },
00135 #endif // IBMBIDI
00136 
00137   { "Photon File Picker",
00138     NS_FILEPICKER_CID,
00139     "@mozilla.org/filepicker;1",
00140     nsFilePickerConstructor },
00141 };
00142 
00143 PR_STATIC_CALLBACK(void)
00144 nsWidgetPhModuleDtor(nsIModule *self)
00145 {
00146 //     nsPhIMEHelper::Shutdown();
00147 }
00148 
00149 NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetPhModule,
00150                                                  components,
00151                                                  nsWidgetPhModuleDtor)