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 PPPOPTIMIZER_HXX
25 #define PPPOPTIMIZER_HXX
26 
27 #include <cppuhelper/implbase4.hxx>
28 #include <com/sun/star/frame/XDispatch.hpp>
29 #include <com/sun/star/frame/XDispatchProvider.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/frame/XController.hpp>
35 
36 // ----------------
37 // - PPPOptimizer -
38 // ----------------
39 
40 class PPPOptimizer : public cppu::WeakImplHelper4<
41 									com::sun::star::lang::XInitialization,
42 									com::sun::star::lang::XServiceInfo,
43 									com::sun::star::frame::XDispatchProvider,
44 									com::sun::star::frame::XDispatch >
45 {
46 	com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
47 	com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
48 
49 public:
50 
51 				PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
52 	virtual		~PPPOptimizer();
53 
54 	// XInitialization
55 	void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
56 		throw( com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException );
57 
58 	// XServiceInfo
59     virtual ::rtl::OUString SAL_CALL getImplementationName()
60         throw( com::sun::star::uno::RuntimeException );
61 
62     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
63         throw( com::sun::star::uno::RuntimeException );
64 
65 	virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
66         throw( com::sun::star::uno::RuntimeException );
67 
68 	// XDispatchProvider
69 	virtual com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(
70 		const com::sun::star::util::URL& aURL, const rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags )
71 			throw(com::sun::star::uno::RuntimeException);
72 
73 	virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(
74 		const com::sun::star::uno::Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( com::sun::star::uno::RuntimeException );
75 
76     // XDispatch
77     virtual void SAL_CALL dispatch( const com::sun::star::util::URL& aURL,
78 										const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lArguments )
79         throw( com::sun::star::uno::RuntimeException );
80 
81     virtual void SAL_CALL addStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener,
82 												const com::sun::star::util::URL& aURL )
83         throw( com::sun::star::uno::RuntimeException );
84     virtual void SAL_CALL removeStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener,
85 												const com::sun::star::util::URL& aURL )
86         throw( com::sun::star::uno::RuntimeException );
87 
88 	static sal_Int64 GetFileSize( const rtl::OUString& rURL );
89 };
90 
91 rtl::OUString PPPOptimizer_getImplementationName();
92 com::sun::star::uno::Sequence< rtl::OUString > PPPOptimizer_getSupportedServiceNames();
93 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > PPPOptimizer_createInstance( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rSMgr )
94 	throw( com::sun::star::uno::Exception );
95 
96 #endif // PPPOPTIMIZER_HXX
97