toolkit/components/remote/nsXRemoteService.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:expandtab:shiftwidth=2:tabstop=8:
     3  */
     4 /* This Source Code Form is subject to the terms of the Mozilla Public
     5  * License, v. 2.0. If a copy of the MPL was not distributed with this
     6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 #ifndef NSXREMOTESERVICE_H
     9 #define NSXREMOTESERVICE_H
    11 #include "nsString.h"
    13 #include "nsIRemoteService.h"
    14 #include "nsIObserver.h"
    15 #include <X11/Xlib.h>
    16 #include <X11/X.h>
    18 class nsIDOMWindow;
    19 class nsIWeakReference;
    21 /**
    22   Base class for GTK/Qt remote service
    23 */
    24 class nsXRemoteService : public nsIRemoteService,
    25                          public nsIObserver
    26 {
    27 public:
    28     NS_DECL_NSIOBSERVER
    31 protected:
    32     nsXRemoteService();
    34     static bool HandleNewProperty(Window aWindowId,Display* aDisplay,
    35                                     Time aEventTime, Atom aChangedAtom,
    36                                     nsIWeakReference* aDomWindow);
    38     void XRemoteBaseStartup(const char *aAppName, const char *aProfileName);
    40     void HandleCommandsFor(Window aWindowId);
    41     static nsXRemoteService *sRemoteImplementation;
    42 private:
    43     void EnsureAtoms();
    44     static const char* HandleCommand(char* aCommand, nsIDOMWindow* aWindow,
    45                                      uint32_t aTimestamp);
    47     static const char* HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow,
    48                                          uint32_t aTimestamp);
    50     virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
    51                                                 uint32_t aTimestamp) = 0;
    53     nsCString mAppName;
    54     nsCString mProfileName;
    56     static Atom sMozVersionAtom;
    57     static Atom sMozLockAtom;
    58     static Atom sMozCommandAtom;
    59     static Atom sMozResponseAtom;
    60     static Atom sMozUserAtom;
    61     static Atom sMozProfileAtom;
    62     static Atom sMozProgramAtom;
    63     static Atom sMozCommandLineAtom;
    64 };
    66 #endif // NSXREMOTESERVICE_H

mercurial