xref: /aoo42x/main/shell/source/unix/exec/shellexec.hxx (revision ed2f6d3b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SHELLEXEC_HXX_
25 #define _SHELLEXEC_HXX_
26 
27 #include <cppuhelper/implbase2.hxx>
28 #include <osl/mutex.hxx>
29 #include <rtl/strbuf.hxx>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 
33 #ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
34 #include <com/sun/star/system/XSystemShellExecute.hpp>
35 #endif
36 
37 //----------------------------------------------------------
38 // class declaration
39 //----------------------------------------------------------
40 
41 class ShellExec : public ::cppu::WeakImplHelper2< com::sun::star::system::XSystemShellExecute, com::sun::star::lang::XServiceInfo >
42 {
43     ::rtl::OString m_aDesktopEnvironment;
44     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
45     m_xContext;
46 
47 public:
48     ShellExec(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext);
49 
50     //------------------------------------------------
51     // XSystemShellExecute
52     //------------------------------------------------
53 
54     virtual void SAL_CALL execute( const ::rtl::OUString& aCommand, const ::rtl::OUString& aParameter, sal_Int32 nFlags )
55         throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::system::SystemShellExecuteException, ::com::sun::star::uno::RuntimeException);
56 
57     //------------------------------------------------
58     // XServiceInfo
59     //------------------------------------------------
60 
61     virtual ::rtl::OUString SAL_CALL getImplementationName(	 )
62         throw(::com::sun::star::uno::RuntimeException);
63 
64     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
65         throw(::com::sun::star::uno::RuntimeException);
66 
67     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
68         throw(::com::sun::star::uno::RuntimeException);
69 };
70 
71 
72 // helper function - needed for urltest
73 void escapeForShell( rtl::OStringBuffer & rBuffer, const rtl::OString & rURL);
74 
75 #endif
76