widget/xremoteclient/nsRemoteClient.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim:expandtab:shiftwidth=4:tabstop=4:
michael@0 3 */
michael@0 4 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 7
michael@0 8 #ifndef nsRemoteClient_h__
michael@0 9 #define nsRemoteClient_h__
michael@0 10
michael@0 11 #include "nscore.h"
michael@0 12
michael@0 13 /**
michael@0 14 * Pure-virtual common base class for remoting implementations.
michael@0 15 */
michael@0 16
michael@0 17 class nsRemoteClient
michael@0 18 {
michael@0 19 public:
michael@0 20 /**
michael@0 21 * Initializes the client
michael@0 22 */
michael@0 23 virtual nsresult Init() = 0;
michael@0 24
michael@0 25 /**
michael@0 26 * Sends a command to a running instance.
michael@0 27 *
michael@0 28 * @param aProgram This is the preferred program that we want to use
michael@0 29 * for this particular command.
michael@0 30 *
michael@0 31 * @param aNoProgramFallback This boolean attribute tells the client
michael@0 32 * code that if the preferred program isn't found that it should
michael@0 33 * fail not send the command to another server.
michael@0 34 *
michael@0 35 * @param aUsername This allows someone to only talk to an instance
michael@0 36 * of the server that's running under a particular username. If
michael@0 37 * this isn't specified here it's pulled from the LOGNAME
michael@0 38 * environmental variable if it's set.
michael@0 39 *
michael@0 40 * @param aProfile This allows you to specify a particular server
michael@0 41 * running under a named profile. If it is not specified the
michael@0 42 * profile is not checked.
michael@0 43 *
michael@0 44 * @param aCommand This is the command that is passed to the server.
michael@0 45 * Please see the additional information located at:
michael@0 46 * http://www.mozilla.org/unix/remote.html
michael@0 47 *
michael@0 48 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
michael@0 49 * variable defined by the Startup Notification specification
michael@0 50 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
michael@0 51 *
michael@0 52 * @param aResponse If there is a response, it will be here. This
michael@0 53 * includes error messages. The string is allocated using stdlib
michael@0 54 * string functions, so free it with free().
michael@0 55 *
michael@0 56 * @return true if succeeded, false if no running instance was found.
michael@0 57 */
michael@0 58 virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
michael@0 59 const char *aProfile, const char *aCommand,
michael@0 60 const char* aDesktopStartupID,
michael@0 61 char **aResponse, bool *aSucceeded) = 0;
michael@0 62
michael@0 63 /**
michael@0 64 * Send a complete command line to a running instance.
michael@0 65 *
michael@0 66 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
michael@0 67 * variable defined by the Startup Notification specification
michael@0 68 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
michael@0 69 *
michael@0 70 * @see sendCommand
michael@0 71 * @param argc The number of command-line arguments.
michael@0 72 *
michael@0 73 */
michael@0 74 virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
michael@0 75 const char *aProfile,
michael@0 76 int32_t argc, char **argv,
michael@0 77 const char* aDesktopStartupID,
michael@0 78 char **aResponse, bool *aSucceeded) = 0;
michael@0 79 };
michael@0 80
michael@0 81 #endif // nsRemoteClient_h__

mercurial