xref: /trunk/main/basic/inc/basic/process.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1234bd5c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3234bd5c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4234bd5c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5234bd5c5SAndrew Rist  * distributed with this work for additional information
6234bd5c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7234bd5c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8234bd5c5SAndrew Rist  * "License"); you may not use this file except in compliance
9234bd5c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11234bd5c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13234bd5c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14234bd5c5SAndrew Rist  * software distributed under the License is distributed on an
15234bd5c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16234bd5c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17234bd5c5SAndrew Rist  * specific language governing permissions and limitations
18234bd5c5SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20234bd5c5SAndrew Rist  *************************************************************/
21234bd5c5SAndrew Rist 
22234bd5c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _PROCESS_HXX
25cdf0e10cSrcweir #define _PROCESS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include <vos/process.hxx>
29*7fef15a0SDamjan Jovanovic #include "basic/basicdllapi.h"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <map>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir typedef std::map< String, String > Environment;
34cdf0e10cSrcweir typedef Environment::value_type EnvironmentVariable;
35cdf0e10cSrcweir 
36*7fef15a0SDamjan Jovanovic class BASIC_DLLPUBLIC Process
37cdf0e10cSrcweir {
38cdf0e10cSrcweir     // Internal members and methods
39cdf0e10cSrcweir     vos::OArgumentList *pArgumentList;
40cdf0e10cSrcweir     vos::OEnvironment *pEnvList;
41cdf0e10cSrcweir     vos::OProcess *pProcess;
42cdf0e10cSrcweir     sal_Bool ImplIsRunning();
43cdf0e10cSrcweir     long ImplGetExitCode();
44cdf0e10cSrcweir     sal_Bool bWasGPF;
45cdf0e10cSrcweir     sal_Bool bHasBeenStarted;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir     Process();
49cdf0e10cSrcweir     ~Process();
50cdf0e10cSrcweir     // Methoden
51cdf0e10cSrcweir     void SetImage( const String &aAppPath, const String &aAppParams, const Environment *pEnv = NULL );
52cdf0e10cSrcweir     sal_Bool Start();
53cdf0e10cSrcweir     sal_uIntPtr GetExitCode();
54cdf0e10cSrcweir     sal_Bool IsRunning();
55cdf0e10cSrcweir     sal_Bool WasGPF();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     sal_Bool Terminate();
58cdf0e10cSrcweir };
59cdf0e10cSrcweir 
60cdf0e10cSrcweir #endif
61