Back to index

enigmail  1.4.3
nsIPipeTransport.idl
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public
00005  * License Version 1.1 (the "MPL"); you may not use this file
00006  * except in compliance with the MPL. You may obtain a copy of
00007  * the MPL at http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the MPL is distributed on an "AS
00010  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
00011  * implied. See the MPL for the specific language governing
00012  * rights and limitations under the MPL.
00013  *
00014  * The Original Code is protoZilla.
00015  *
00016  * The Initial Developer of the Original Code is Ramalingam Saravanan.
00017  * Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
00018  * Copyright (C) 2000 Ramalingam Saravanan. All Rights Reserved.
00019  *
00020  * Contributor(s):
00021  * Patrick Brunschwig <patrick@mozilla-enigmail.org>
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  * ***** END LICENSE BLOCK ***** */
00035 
00036 
00037 #include "nsIPipeListener.idl"
00038 #include "nsIProcess.idl"
00039 
00040 interface nsIRequest;
00041 interface nsIFile;
00042 interface nsIInputStream;
00043 interface nsIOutputStream;
00044 interface nsIStreamListener;
00045 interface nsIPipeTransportHeaders;
00046 interface nsIPipeTransportListener;
00047 interface nsIProcess;
00048 interface nsIPipeReader;
00049 
00050 %{C++
00051 
00052 #define NS_PIPETRANSPORT_CLASSNAME "Pipe Transport"
00053 #define NS_PIPETRANSPORT_CONTRACTID "@mozilla.org/ipc/pipe-transport;1"
00054 
00055 #define NS_PIPETRANSPORT_CID                     \
00056 { /* 8431e101-7ab1-11d4-8f02-a06008948af5 */     \
00057    0x8431e101, 0x7ab1, 0x11d4,                   \
00058 {0x8f, 0x02, 0xa0, 0x60, 0x08, 0x94, 0x8a, 0xf5} }
00059 
00060 %}
00061 
00091 [scriptable, uuid(8431e100-7ab1-11d4-8f02-a06008948af5)]
00092 interface nsIPipeTransport : nsIProcess
00093 {
00094 
00107     void initWithWorkDir(in nsIFile executable,
00108                          in nsIFile cwd,
00109                          in unsigned long startupFlags);
00110 
00131     void openPipe([array, size_is(argCount)] in wstring args,
00132                   in unsigned long argCount,
00133                   [array, size_is(envCount)] in wstring env,
00134                   in unsigned long envCount,
00135                   in unsigned long timeoutMS,
00136                   in string killString,
00137                   in boolean mergeStderr,
00138                   in nsIPipeListener stderrConsole);
00139 
00143     const long PROCESS_DETACHED       = 0x01;
00144     const long INHERIT_PROC_ATTRIBS   = 0x02;
00145 
00149     readonly attribute nsIPipeListener stderrConsole;
00150 
00155     readonly attribute nsIStreamListener listener;
00156 
00165     nsIOutputStream openOutputStream(in unsigned long offset,
00166                                      in unsigned long count,
00167                                      in unsigned long flags);
00168 
00169     nsIRequest readInputStream(in nsIPipeReader reader);
00170 
00180     nsIRequest asyncRead(in nsIStreamListener listener,
00181                          in nsISupports ctxt,
00182                          in unsigned long offset,
00183                          in unsigned long count,
00184                          in unsigned long flags);
00185 
00190     void join();
00191 
00195     void terminate();
00196 
00203     void writeSync(in string inputData, in unsigned long inputLength);
00204 
00212     void write(in string inputData, in unsigned long inputLength);
00213 
00217     void closeStdin();
00218 
00223     void writeAsync(in nsIInputStream aFromStream,
00224                     in unsigned long aCount,
00225                     in boolean closeAfterWrite);
00226 
00227     attribute unsigned long bufferSegmentSize;
00228     attribute unsigned long bufferMaxSize;
00229     attribute unsigned long headersMaxSize;
00230 };
00231 
00232 
00238 [scriptable, uuid(8431e110-7ab1-11d4-8f02-006008948af5)]
00239 interface nsIPipeTransportHeaders : nsISupports
00240 {
00246   long parseMimeHeaders(in string mimeHeaders, in unsigned long count);
00247 };
00248 
00249 
00254 [scriptable, uuid(8431e120-7ab1-11d4-8f02-006008948af5)]
00255 interface nsIPipeTransportListener : nsIPipeTransportHeaders
00256 {
00261   void startRequest();
00262 
00266   void stopRequest(in nsresult status);
00267 };
00268 
00269 
00270 
00271 [scriptable, uuid(8441e110-7ab1-11d4-8f02-007658948af5)]
00272 interface nsIPipeReader : nsISupports
00273 {
00274   // Process data
00275   void readData(in string data, in unsigned long count);
00276 
00277   void stopRequest(in unsigned long status);
00278 
00279 };