widget/xremoteclient/nsRemoteClient.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/xremoteclient/nsRemoteClient.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,81 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:expandtab:shiftwidth=4:tabstop=4:
     1.6 + */
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifndef nsRemoteClient_h__
    1.12 +#define nsRemoteClient_h__
    1.13 +
    1.14 +#include "nscore.h"
    1.15 +
    1.16 +/**
    1.17 + * Pure-virtual common base class for remoting implementations.
    1.18 + */
    1.19 +
    1.20 +class nsRemoteClient
    1.21 +{
    1.22 +public:
    1.23 +  /**
    1.24 +   * Initializes the client
    1.25 +   */
    1.26 +  virtual nsresult Init() = 0;
    1.27 +
    1.28 +  /**
    1.29 +   * Sends a command to a running instance.
    1.30 +   *
    1.31 +   * @param aProgram This is the preferred program that we want to use
    1.32 +   * for this particular command.
    1.33 +   *
    1.34 +   * @param aNoProgramFallback This boolean attribute tells the client
    1.35 +   * code that if the preferred program isn't found that it should
    1.36 +   * fail not send the command to another server.
    1.37 +   *
    1.38 +   * @param aUsername This allows someone to only talk to an instance
    1.39 +   * of the server that's running under a particular username.  If
    1.40 +   * this isn't specified here it's pulled from the LOGNAME
    1.41 +   * environmental variable if it's set.
    1.42 +   *
    1.43 +   * @param aProfile This allows you to specify a particular server
    1.44 +   * running under a named profile.  If it is not specified the
    1.45 +   * profile is not checked.
    1.46 +   *
    1.47 +   * @param aCommand This is the command that is passed to the server.
    1.48 +   * Please see the additional information located at:
    1.49 +   * http://www.mozilla.org/unix/remote.html
    1.50 +   * 
    1.51 +   * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
    1.52 +   * variable defined by the Startup Notification specification
    1.53 +   * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
    1.54 +   *
    1.55 +   * @param aResponse If there is a response, it will be here.  This
    1.56 +   * includes error messages.  The string is allocated using stdlib
    1.57 +   * string functions, so free it with free().
    1.58 +   *
    1.59 +   * @return true if succeeded, false if no running instance was found.
    1.60 +   */
    1.61 +  virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
    1.62 +                               const char *aProfile, const char *aCommand,
    1.63 +                               const char* aDesktopStartupID,
    1.64 +                               char **aResponse, bool *aSucceeded) = 0;
    1.65 +
    1.66 +  /**
    1.67 +   * Send a complete command line to a running instance.
    1.68 +   *
    1.69 +   * @param aDesktopStartupID the contents of the DESKTOP_STARTUP_ID environment
    1.70 +   * variable defined by the Startup Notification specification
    1.71 +   * http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
    1.72 +   *
    1.73 +   * @see sendCommand
    1.74 +   * @param argc The number of command-line arguments.
    1.75 +   * 
    1.76 +   */
    1.77 +  virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
    1.78 +                                   const char *aProfile,
    1.79 +                                   int32_t argc, char **argv,
    1.80 +                                   const char* aDesktopStartupID,
    1.81 +                                   char **aResponse, bool *aSucceeded) = 0;
    1.82 +};
    1.83 +
    1.84 +#endif // nsRemoteClient_h__

mercurial