michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:expandtab:shiftwidth=4:tabstop=4: 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 nsRemoteClient_h__ michael@0: #define nsRemoteClient_h__ michael@0: michael@0: #include "nscore.h" michael@0: michael@0: /** michael@0: * Pure-virtual common base class for remoting implementations. michael@0: */ michael@0: michael@0: class nsRemoteClient michael@0: { michael@0: public: michael@0: /** michael@0: * Initializes the client michael@0: */ michael@0: virtual nsresult Init() = 0; michael@0: michael@0: /** michael@0: * Sends a command to a running instance. michael@0: * michael@0: * @param aProgram This is the preferred program that we want to use michael@0: * for this particular command. michael@0: * michael@0: * @param aNoProgramFallback This boolean attribute tells the client michael@0: * code that if the preferred program isn't found that it should michael@0: * fail not send the command to another server. michael@0: * michael@0: * @param aUsername This allows someone to only talk to an instance michael@0: * of the server that's running under a particular username. If michael@0: * this isn't specified here it's pulled from the LOGNAME michael@0: * environmental variable if it's set. michael@0: * michael@0: * @param aProfile This allows you to specify a particular server michael@0: * running under a named profile. If it is not specified the michael@0: * profile is not checked. michael@0: * michael@0: * @param aCommand This is the command that is passed to the server. michael@0: * Please see the additional information located at: michael@0: * http://www.mozilla.org/unix/remote.html michael@0: * michael@0: * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment michael@0: * variable defined by the Startup Notification specification michael@0: * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt michael@0: * michael@0: * @param aResponse If there is a response, it will be here. This michael@0: * includes error messages. The string is allocated using stdlib michael@0: * string functions, so free it with free(). michael@0: * michael@0: * @return true if succeeded, false if no running instance was found. michael@0: */ michael@0: virtual nsresult SendCommand(const char *aProgram, const char *aUsername, michael@0: const char *aProfile, const char *aCommand, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, bool *aSucceeded) = 0; michael@0: michael@0: /** michael@0: * Send a complete command line to a running instance. michael@0: * michael@0: * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment michael@0: * variable defined by the Startup Notification specification michael@0: * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt michael@0: * michael@0: * @see sendCommand michael@0: * @param argc The number of command-line arguments. michael@0: * michael@0: */ michael@0: virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername, michael@0: const char *aProfile, michael@0: int32_t argc, char **argv, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, bool *aSucceeded) = 0; michael@0: }; michael@0: michael@0: #endif // nsRemoteClient_h__