michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:expandtab:shiftwidth=2:tabstop=8: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef NSXREMOTESERVICE_H michael@0: #define NSXREMOTESERVICE_H michael@0: michael@0: #include "nsString.h" michael@0: michael@0: #include "nsIRemoteService.h" michael@0: #include "nsIObserver.h" michael@0: #include michael@0: #include michael@0: michael@0: class nsIDOMWindow; michael@0: class nsIWeakReference; michael@0: michael@0: /** michael@0: Base class for GTK/Qt remote service michael@0: */ michael@0: class nsXRemoteService : public nsIRemoteService, michael@0: public nsIObserver michael@0: { michael@0: public: michael@0: NS_DECL_NSIOBSERVER michael@0: michael@0: michael@0: protected: michael@0: nsXRemoteService(); michael@0: michael@0: static bool HandleNewProperty(Window aWindowId,Display* aDisplay, michael@0: Time aEventTime, Atom aChangedAtom, michael@0: nsIWeakReference* aDomWindow); michael@0: michael@0: void XRemoteBaseStartup(const char *aAppName, const char *aProfileName); michael@0: michael@0: void HandleCommandsFor(Window aWindowId); michael@0: static nsXRemoteService *sRemoteImplementation; michael@0: private: michael@0: void EnsureAtoms(); michael@0: static const char* HandleCommand(char* aCommand, nsIDOMWindow* aWindow, michael@0: uint32_t aTimestamp); michael@0: michael@0: static const char* HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow, michael@0: uint32_t aTimestamp); michael@0: michael@0: virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID, michael@0: uint32_t aTimestamp) = 0; michael@0: michael@0: nsCString mAppName; michael@0: nsCString mProfileName; michael@0: michael@0: static Atom sMozVersionAtom; michael@0: static Atom sMozLockAtom; michael@0: static Atom sMozCommandAtom; michael@0: static Atom sMozResponseAtom; michael@0: static Atom sMozUserAtom; michael@0: static Atom sMozProfileAtom; michael@0: static Atom sMozProgramAtom; michael@0: static Atom sMozCommandLineAtom; michael@0: }; michael@0: michael@0: #endif // NSXREMOTESERVICE_H