xref: /aoo4110/main/ucb/source/core/cmdenv.hxx (revision b1cdbd2c)
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 INCLUDED_CMDENV_HXX
25 #define INCLUDED_CMDENV_HXX
26 
27 #include "cppuhelper/implbase3.hxx"
28 
29 #include "com/sun/star/lang/XInitialization.hpp"
30 #include "com/sun/star/lang/XServiceInfo.hpp"
31 #include "com/sun/star/lang/XSingleServiceFactory.hpp"
32 #include "com/sun/star/ucb/XCommandEnvironment.hpp"
33 
34 namespace ucb_cmdenv {
35 
36 class UcbCommandEnvironment :
37         public cppu::WeakImplHelper3< com::sun::star::lang::XInitialization,
38                                       com::sun::star::lang::XServiceInfo,
39                                       com::sun::star::ucb::XCommandEnvironment >
40 {
41     com::sun::star::uno::Reference<
42         com::sun::star::task::XInteractionHandler > m_xIH;
43     com::sun::star::uno::Reference<
44         com::sun::star::ucb::XProgressHandler >     m_xPH;
45 
46 public:
47     UcbCommandEnvironment(
48         const com::sun::star::uno::Reference<
49             com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
50     virtual ~UcbCommandEnvironment();
51 
52     // XInitialization
53     virtual void SAL_CALL
54     initialize( const com::sun::star::uno::Sequence<
55                         com::sun::star::uno::Any >& aArguments )
56         throw( com::sun::star::uno::Exception,
57                com::sun::star::uno::RuntimeException );
58 
59     // XServiceInfo
60     virtual ::rtl::OUString SAL_CALL getImplementationName()
61         throw ( com::sun::star::uno::RuntimeException );
62 
63     virtual sal_Bool SAL_CALL
64     supportsService( const ::rtl::OUString& ServiceName )
65         throw ( com::sun::star::uno::RuntimeException );
66 
67     virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
68     getSupportedServiceNames()
69         throw ( com::sun::star::uno::RuntimeException );
70 
71     // XCommandEnvironment
72     virtual com::sun::star::uno::Reference<
73         com::sun::star::task::XInteractionHandler > SAL_CALL
74     getInteractionHandler()
75         throw ( com::sun::star::uno::RuntimeException );
76     virtual com::sun::star::uno::Reference<
77         com::sun::star::ucb::XProgressHandler > SAL_CALL
78     getProgressHandler()
79         throw ( com::sun::star::uno::RuntimeException );
80 
81     // Non-UNO interfaces
82     static rtl::OUString
83     getImplementationName_Static();
84     static com::sun::star::uno::Sequence< rtl::OUString >
85     getSupportedServiceNames_Static();
86 
87     static com::sun::star::uno::Reference<
88             com::sun::star::lang::XSingleServiceFactory >
89     createServiceFactory( const com::sun::star::uno::Reference<
90             com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr );
91 private:
92     //com::sun::star::uno::Reference<
93     //    com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
94 };
95 
96 } // namespace ucb_cmdenv
97 
98 #endif // INCLUDED_CMDENV_HXX
99