Bug 452317 - FeedConverter.js: QueryInterface should throw NS_ERROR_NO_INTERFACE...
[wine-gecko.git] / toolkit / components / remote / nsQtRemoteService.cpp
blobedfb427190525419958f19058cf0906646b6af56
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=2:tabstop=8:
3 */
4 /* ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 * for the specific language governing rights and limitations under the
15 * License.
17 * The Original Code is mozilla.org code.
19 * The Initial Developer of the Original Code is
20 * Christopher Blizzard.
21 * Portions created by the Initial Developer are Copyright (C) 2001
22 * the Initial Developer. All Rights Reserved.
24 * Contributor(s):
25 * Christopher Blizzard <blizzard@mozilla.org>
26 * Benjamin Smedberg <benjamin@smedbergs.us>
28 * Alternatively, the contents of this file may be used under the terms of
29 * either the GNU General Public License Version 2 or later (the "GPL"), or
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
40 * ***** END LICENSE BLOCK ***** */
42 #include "nsQtRemoteService.h"
44 #include <X11/Xatom.h> // for XA_STRING
45 #include <stdlib.h>
47 #include "nsIBaseWindow.h"
48 #include "nsIDocShell.h"
49 #include "nsPIDOMWindow.h"
50 #include "nsIGenericFactory.h"
51 #include "nsILocalFile.h"
52 #include "nsIObserverService.h"
53 #include "nsIServiceManager.h"
54 #include "nsIWeakReference.h"
55 #include "nsIWidget.h"
56 #include "nsIAppShellService.h"
57 #include "nsAppShellCID.h"
59 #include "nsCOMPtr.h"
60 #include "nsString.h"
61 #include "prprf.h"
62 #include "prenv.h"
63 #include "nsCRT.h"
65 #ifdef MOZ_WIDGET_GTK2
66 //#include "nsGTKToolkit.h"
67 #endif
69 #include "nsICommandLineRunner.h"
70 #include "nsXULAppAPI.h"
72 #define MOZILLA_VERSION_PROP "_MOZILLA_VERSION"
73 #define MOZILLA_LOCK_PROP "_MOZILLA_LOCK"
74 #define MOZILLA_COMMAND_PROP "_MOZILLA_COMMAND"
75 #define MOZILLA_RESPONSE_PROP "_MOZILLA_RESPONSE"
76 #define MOZILLA_USER_PROP "_MOZILLA_USER"
77 #define MOZILLA_PROFILE_PROP "_MOZILLA_PROFILE"
78 #define MOZILLA_PROGRAM_PROP "_MOZILLA_PROGRAM"
79 #define MOZILLA_COMMANDLINE_PROP "_MOZILLA_COMMANDLINE"
81 #ifdef IS_BIG_ENDIAN
82 #define TO_LITTLE_ENDIAN32(x) \
83 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
84 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
85 #else
86 #define TO_LITTLE_ENDIAN32(x) (x)
87 #endif
89 const unsigned char kRemoteVersion[] = "5.1";
91 NS_IMPL_ISUPPORTS2(nsQtRemoteService,
92 nsIRemoteService,
93 nsIObserver)
95 NS_IMETHODIMP
96 nsQtRemoteService::Startup(const char* aAppName, const char* aProfileName)
98 return NS_ERROR_NOT_IMPLEMENTED;
101 // #ifdef MOZ_WIDGET_GTK2
102 // static nsGTKToolkit* GetGTKToolkit()
103 // {
104 // nsCOMPtr<nsIAppShellService> svc = do_GetService(NS_APPSHELLSERVICE_CONTRACTID);
105 // if (!svc)
106 // return nsnull;
107 // nsCOMPtr<nsIDOMWindowInternal> window;
108 // svc->GetHiddenDOMWindow(getter_AddRefs(window));
109 // if (!window)
110 // return nsnull;
111 // nsIWidget* widget = GetMainWidget(window);
112 // if (!widget)
113 // return nsnull;
114 // nsIToolkit* toolkit = widget->GetToolkit();
115 // if (!toolkit)
116 // return nsnull;
117 // return static_cast<nsGTKToolkit*>(toolkit);
118 // }
119 // #endif
121 NS_IMETHODIMP
122 nsQtRemoteService::RegisterWindow(nsIDOMWindow* aWindow)
124 return NS_ERROR_NOT_IMPLEMENTED;
127 NS_IMETHODIMP
128 nsQtRemoteService::Shutdown()
130 return NS_ERROR_NOT_IMPLEMENTED;
133 NS_IMETHODIMP
134 nsQtRemoteService::Observe(nsISupports* aSubject,
135 const char *aTopic,
136 const PRUnichar *aData)
138 return NS_OK;
141 // {C0773E90-5799-4eff-AD03-3EBCD85624AC}
142 #define NS_REMOTESERVICE_CID \
143 { 0xc0773e90, 0x5799, 0x4eff, { 0xad, 0x3, 0x3e, 0xbc, 0xd8, 0x56, 0x24, 0xac } }
145 NS_GENERIC_FACTORY_CONSTRUCTOR(nsQtRemoteService)
147 static const nsModuleComponentInfo components[] =
149 { "Remote Service",
150 NS_REMOTESERVICE_CID,
151 "@mozilla.org/toolkit/remote-service;1",
152 nsQtRemoteServiceConstructor
156 NS_IMPL_NSGETMODULE(RemoteServiceModule, components)