Back to index

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