xref: /trunk/main/ucb/source/core/cmdenv.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_CMDENV_HXX
29 #define INCLUDED_CMDENV_HXX
30 
31 #include "cppuhelper/implbase3.hxx"
32 
33 #include "com/sun/star/lang/XInitialization.hpp"
34 #include "com/sun/star/lang/XServiceInfo.hpp"
35 #include "com/sun/star/lang/XSingleServiceFactory.hpp"
36 #include "com/sun/star/ucb/XCommandEnvironment.hpp"
37 
38 namespace ucb_cmdenv {
39 
40 class UcbCommandEnvironment :
41         public cppu::WeakImplHelper3< com::sun::star::lang::XInitialization,
42                                       com::sun::star::lang::XServiceInfo,
43                                       com::sun::star::ucb::XCommandEnvironment >
44 {
45     com::sun::star::uno::Reference<
46         com::sun::star::task::XInteractionHandler > m_xIH;
47     com::sun::star::uno::Reference<
48         com::sun::star::ucb::XProgressHandler >     m_xPH;
49 
50 public:
51     UcbCommandEnvironment(
52         const com::sun::star::uno::Reference<
53             com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
54     virtual ~UcbCommandEnvironment();
55 
56     // XInitialization
57     virtual void SAL_CALL
58     initialize( const com::sun::star::uno::Sequence<
59                         com::sun::star::uno::Any >& aArguments )
60         throw( com::sun::star::uno::Exception,
61                com::sun::star::uno::RuntimeException );
62 
63     // XServiceInfo
64     virtual ::rtl::OUString SAL_CALL getImplementationName()
65         throw ( com::sun::star::uno::RuntimeException );
66 
67     virtual sal_Bool SAL_CALL
68     supportsService( const ::rtl::OUString& ServiceName )
69         throw ( com::sun::star::uno::RuntimeException );
70 
71     virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
72     getSupportedServiceNames()
73         throw ( com::sun::star::uno::RuntimeException );
74 
75     // XCommandEnvironment
76     virtual com::sun::star::uno::Reference<
77         com::sun::star::task::XInteractionHandler > SAL_CALL
78     getInteractionHandler()
79         throw ( com::sun::star::uno::RuntimeException );
80     virtual com::sun::star::uno::Reference<
81         com::sun::star::ucb::XProgressHandler > SAL_CALL
82     getProgressHandler()
83         throw ( com::sun::star::uno::RuntimeException );
84 
85     // Non-UNO interfaces
86     static rtl::OUString
87     getImplementationName_Static();
88     static com::sun::star::uno::Sequence< rtl::OUString >
89     getSupportedServiceNames_Static();
90 
91     static com::sun::star::uno::Reference<
92             com::sun::star::lang::XSingleServiceFactory >
93     createServiceFactory( const com::sun::star::uno::Reference<
94             com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr );
95 private:
96     //com::sun::star::uno::Reference<
97     //    com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
98 };
99 
100 } // namespace ucb_cmdenv
101 
102 #endif // INCLUDED_CMDENV_HXX
103