CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / widget / src / xremoteclient / nsRemoteClient.h
blob34ab0eaf22b8cd475ac00aaa7a0951c548880e85
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
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 Christopher Blizzard.
20 * Portions created by the Initial Developer are Copyright (C) 2001
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
24 * Benjamin Smedberg <benjamin@smedbergs.us>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #ifndef nsRemoteClient_h__
41 #define nsRemoteClient_h__
43 #include "nscore.h"
45 /**
46 * Pure-virtual common base class for remoting implementations.
49 class nsRemoteClient
51 public:
52 /**
53 * Initializes the client
55 virtual nsresult Init() = 0;
57 /**
58 * Sends a command to a running instance.
60 * @param aProgram This is the preferred program that we want to use
61 * for this particular command.
63 * @param aNoProgramFallback This boolean attribute tells the client
64 * code that if the preferred program isn't found that it should
65 * fail not send the command to another server.
67 * @param aUsername This allows someone to only talk to an instance
68 * of the server that's running under a particular username. If
69 * this isn't specified here it's pulled from the LOGNAME
70 * environmental variable if it's set.
72 * @param aProfile This allows you to specify a particular server
73 * running under a named profile. If it is not specified the
74 * profile is not checked.
76 * @param aCommand This is the command that is passed to the server.
77 * Please see the additional information located at:
78 * http://www.mozilla.org/unix/remote.html
80 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
81 * variable defined by the Startup Notification specification
82 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
84 * @param aResponse If there is a response, it will be here. This
85 * includes error messages. The string is allocated using stdlib
86 * string functions, so free it with free().
88 * @return true if succeeded, false if no running instance was found.
90 virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
91 const char *aProfile, const char *aCommand,
92 const char* aDesktopStartupID,
93 char **aResponse, PRBool *aSucceeded) = 0;
95 /**
96 * Send a complete command line to a running instance.
98 * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
99 * variable defined by the Startup Notification specification
100 * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
102 * @see sendCommand
103 * @param argc The number of command-line arguments.
106 virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
107 const char *aProfile,
108 PRInt32 argc, char **argv,
109 const char* aDesktopStartupID,
110 char **aResponse, PRBool *aSucceeded) = 0;
113 #endif // nsRemoteClient_h__