~ubuntu-branches/ubuntu/oneiric/enigmail/oneiric-updates

« back to all changes in this revision

Viewing changes to extensions/enigmail/ipc/public/nsIIPCService.idl

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2010-04-10 01:42:24 UTC
  • Revision ID: james.westby@ubuntu.com-20100410014224-fbq9ui5x3b0h2t36
Tags: 2:1.0.1-0ubuntu1
* First releaase of enigmail 1.0.1 for tbird/icedove 3
  (LP: #527138)
* redo packaging from scratch 
  + add debian/make-orig target that uses xulrunner provided
    buildsystem + enigmail tarball to produce a proper orig.tar.gz
  + use debhelper 7 with mozilla-devscripts
  + use debian source format 3.0 (quilt)
  + patch enigmail to use frozen API only
    - add debian/patches/frozen_api.diff
  + patch build system to not link against -lxul - which isnt
    available for sdks produced by all-static apps like tbird
    - add debian/patches/build_system_dont_link_libxul.diff
  + add minimal build-depends to control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Mozilla Public
 
3
 * License Version 1.1 (the "MPL"); you may not use this file
 
4
 * except in compliance with the MPL. You may obtain a copy of
 
5
 * the MPL at http://www.mozilla.org/MPL/
 
6
 *
 
7
 * Software distributed under the MPL is distributed on an "AS
 
8
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
 * implied. See the MPL for the specific language governing
 
10
 * rights and limitations under the MPL.
 
11
 *
 
12
 * The Original Code is protoZilla.
 
13
 *
 
14
 * The Initial Developer of the Original Code is Ramalingam Saravanan.
 
15
 * Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
 
16
 * Copyright (C) 2000 Ramalingam Saravanan. All Rights Reserved.
 
17
 *
 
18
 * Contributor(s):
 
19
 * Patrick Brunschwig <patrick@mozilla-enigmail.org>
 
20
 *
 
21
 * Alternatively, the contents of this file may be used under the
 
22
 * terms of the GNU General Public License (the "GPL"), in which case
 
23
 * the provisions of the GPL are applicable instead of
 
24
 * those above. If you wish to allow use of your version of this
 
25
 * file only under the terms of the GPL and not to allow
 
26
 * others to use your version of this file under the MPL, indicate
 
27
 * your decision by deleting the provisions above and replace them
 
28
 * with the notice and other provisions required by the GPL.
 
29
 * If you do not delete the provisions above, a recipient
 
30
 * may use your version of this file under either the MPL or the
 
31
 * GPL.
 
32
 */
 
33
 
 
34
#include "nsIPipeTransport.idl"
 
35
#include "nsIPipeConsole.idl"
 
36
#include "nsIFile.idl"
 
37
 
 
38
interface nsIURI;
 
39
interface nsIChannel;
 
40
interface nsIRequestObserver;
 
41
interface nsIIPCRequest;
 
42
 
 
43
%{C++
 
44
#define NS_IPCSERVICE_CLASSNAME  "IPCService"
 
45
#define NS_IPCSERVICE_CONTRACTID "@mozilla.org/process/ipc-service;1"
 
46
 
 
47
#define NS_IPCSERVICE_CID                        \
 
48
{ /* 8431e161-7ab1-11d4-8f02-006008948af5 */     \
 
49
   0x8431e161, 0x7ab1, 0x11d4,                   \
 
50
{0x8f, 0x02, 0x00, 0x60, 0x08, 0x94, 0x8a, 0xf5} }
 
51
 
 
52
%}
 
53
 
 
54
/**
 
55
 * The nsIIPCService interface provides helper services for pipe-based
 
56
 * protocols.
 
57
 */
 
58
[scriptable, uuid(8431e160-7ab1-11d4-8f02-006008948af5)]
 
59
interface nsIIPCService : nsISupports
 
60
{
 
61
 
 
62
  /* NOTE: In output string values, the NUL character is escaped as follows:
 
63
   *   NUL -> DEL '0'
 
64
   *   DEL -> DEL DEL
 
65
   * This allows raw binary data to be returned as NUL-delimited strings.
 
66
   */
 
67
 
 
68
  /**
 
69
   * Returns version of IPC Module
 
70
   */
 
71
  readonly attribute string version;
 
72
 
 
73
  /**
 
74
   * Runs executable with parameters (args[]) and returns the standard output
 
75
   * emitted by the executable as a string. No shell expansion is carried out.
 
76
   * Unquoting (stripping quotes/backaslashes) is not done.
 
77
   * This method blocks for the completion of the executable.
 
78
   */
 
79
  string run(in nsIFile executable,
 
80
             [array, size_is(argCount)] in string args,
 
81
             in unsigned long argCount);
 
82
 
 
83
  /**
 
84
   * Runs executable with parameters (args[]) and optional data for standard input,
 
85
   * and returns the exit code from the process. The standard output
 
86
   * and standard error strings are returned as "out" arguments.
 
87
   * (If outputError is null, use default console to capture error output.)
 
88
   * PreInput may be used for passphrases etc.
 
89
   * Unquoting the command (stripping quotes/backaslashes) is not done.
 
90
   * This method blocks for the completion of the command.
 
91
   */
 
92
  long runPipe (in nsIFile executable,
 
93
                [array, size_is(argCount)] in string args,
 
94
                in unsigned long argCount,
 
95
                in string preInput,
 
96
                in string inputData,
 
97
                in unsigned long inputLength,
 
98
                [array, size_is(envCount)] in string env,
 
99
                in unsigned long envCount,
 
100
                [size_is(outputCount)] out string outputData,
 
101
                out unsigned long outputCount,
 
102
                [size_is(errorCount)] out string outputError,
 
103
                out unsigned long errorCount);
 
104
 
 
105
  /**
 
106
   * Runs executable, with parameters (args[]) and optional data for standard input,
 
107
   * and asynchronously captures the standard output (and standard error
 
108
   * output) in supplied console(s). This method does not block for
 
109
   * command completion, unlike the other exec methods. The nsIIPCRequest
 
110
   * object associated with the command execution is returned, and may
 
111
   * be used to determine request status or cancel it.
 
112
   * If an nsIRequestObserver object is suppled, then it is used to
 
113
   * "observe" the standard output console, and the nsIIPCRequest object
 
114
   * is automatically supplied as the context argument to the observer.
 
115
   *
 
116
   * PreInput may be used for passphrases etc.
 
117
   * Unquoting the command (stripping quotes/backslashes) is not done.
 
118
   */
 
119
  nsIIPCRequest runAsync(in nsIFile executable,
 
120
                         [array, size_is(argCount)] in string args,
 
121
                         in unsigned long argCount,
 
122
                         in string preInput,
 
123
                         in string inputData,
 
124
                         in unsigned long inputLength,
 
125
                         [array, size_is(envCount)] in string env,
 
126
                         in unsigned long envCount,
 
127
                         in nsIPipeListener outConsole,
 
128
                         in nsIPipeListener errConsole,
 
129
                         in nsIRequestObserver requestObserver);
 
130
 
 
131
  /**
 
132
   * Returns console object used to capture STDERR by default
 
133
   */
 
134
  readonly attribute nsIPipeConsole console;
 
135
 
 
136
  /**
 
137
   * Returns secret random cookie used for security
 
138
   */
 
139
  readonly attribute string cookie;
 
140
  
 
141
  /**
 
142
   * Creates scriptable string channel from input string data.
 
143
   */
 
144
  nsIChannel newStringChannel(in nsIURI uri, in AUTF8String contentType,
 
145
                              in AUTF8String contentCharset,
 
146
                              in string channelData);
 
147
};
 
148
 
 
149
[scriptable, uuid(8431e1A0-7ab1-11d4-8f02-006008948af5)]
 
150
interface nsIIPCRequest : nsISupports
 
151
{
 
152
  void init(in string executable, in nsIPipeTransport pipeTransport,
 
153
            in nsIPipeListener stdoutConsole, in nsIPipeListener stderrConsole);
 
154
 
 
155
  /**
 
156
   * Returns true if the request is still pending
 
157
   */
 
158
  boolean isPending();
 
159
 
 
160
  /**
 
161
   * Terminates the pipeTransport associated with the request.
 
162
   * If CloseConsoles is true, the stdout/stderr consoles are also closed.
 
163
   */
 
164
  void close(in boolean closeConsoles);
 
165
 
 
166
  readonly attribute string executable;
 
167
 
 
168
  readonly attribute nsIPipeTransport pipeTransport;
 
169
 
 
170
  readonly attribute nsIPipeListener stdoutConsole;
 
171
  readonly attribute nsIPipeListener stderrConsole;
 
172
};
 
173
 
 
174
///////////////////////////////////////////////////////////////////////////////