1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
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 nsRemoteClient_h__
9 #define nsRemoteClient_h__
14 * Pure-virtual common base class for remoting implementations.
21 * Initializes the client
23 virtual nsresult
Init() = 0;
26 * Sends a command to a running instance.
28 * @param aProgram This is the preferred program that we want to use
29 * for this particular command.
31 * @param aNoProgramFallback This boolean attribute tells the client
32 * code that if the preferred program isn't found that it should
33 * fail not send the command to another server.
35 * @param aUsername This allows someone to only talk to an instance
36 * of the server that's running under a particular username. If
37 * this isn't specified here it's pulled from the LOGNAME
38 * environmental variable if it's set.
40 * @param aProfile This allows you to specify a particular server
41 * running under a named profile. If it is not specified the
42 * profile is not checked.
44 * @param aCommand This is the command that is passed to the server.
45 * Please see the additional information located at:
46 * http://www.mozilla.org/unix/remote.html
48 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
49 * variable defined by the Startup Notification specification
50 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
52 * @param aResponse If there is a response, it will be here. This
53 * includes error messages. The string is allocated using stdlib
54 * string functions, so free it with free().
56 * @return true if succeeded, false if no running instance was found.
58 virtual nsresult
SendCommand(const char *aProgram
, const char *aUsername
,
59 const char *aProfile
, const char *aCommand
,
60 const char* aDesktopStartupID
,
61 char **aResponse
, bool *aSucceeded
) = 0;
64 * Send a complete command line to a running instance.
66 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
67 * variable defined by the Startup Notification specification
68 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
71 * @param argc The number of command-line arguments.
74 virtual nsresult
SendCommandLine(const char *aProgram
, const char *aUsername
,
76 int32_t argc
, char **argv
,
77 const char* aDesktopStartupID
,
78 char **aResponse
, bool *aSucceeded
) = 0;
81 #endif // nsRemoteClient_h__