Update ooo320-m1
[ooovba.git] / basic / source / app / processw.hxx
blobce8d0dcde0ff853e409453d1acb257e7de22d1ef
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: processw.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PROCESSW_HXX
32 #define _PROCESSW_HXX
34 #include <basic/sbxfac.hxx>
35 #ifndef __SBX_SBXVARIABLE_HXX //autogen
36 #include <basic/sbxvar.hxx>
37 #endif
38 #include <basic/sbxobj.hxx>
39 #include <basic/process.hxx>
41 class ProcessWrapper : public SbxObject
43 using SbxVariable::GetInfo;
44 // Definition of a table entry. This is done here because
45 // through this methods and property can declared as private.
46 #if defined ( ICC ) || defined ( HPUX ) || defined ( C50 ) || defined ( C52 )
47 public:
48 #endif
49 typedef void( ProcessWrapper::*pMeth )
50 ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite );
51 #if defined ( ICC ) || defined ( HPUX )
52 private:
53 #endif
55 struct Methods {
56 const char* pName; // Name of the entry
57 SbxDataType eType; // Data type
58 pMeth pFunc; // Function Pointer
59 short nArgs; // Arguments and flags
61 static Methods aProcessMethods[]; // Method table
62 Methods *pMethods; // Current method table
64 void PSetImage( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
65 void PStart( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
66 void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
67 void PIsRunning( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
68 void PWasGPF( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
70 // Internal members and methods
71 Process *pProcess;
73 // Fill info block
74 SbxInfo* GetInfo( short nIdx );
76 // Broadcaster Notification
77 virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
78 const SfxHint& rHint, const TypeId& rHintType );
79 public:
80 ProcessWrapper();
81 ~ProcessWrapper();
82 // Search for an element
83 virtual SbxVariable* Find( const String&, SbxClassType );
86 // Factory
87 class ProcessFactory : public SbxFactory
89 public:
90 virtual SbxObject* CreateObject( const String& );
93 #endif