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 _UCBHELPER_COMMANDENVIRONMENTPROXY_HXX 25 #define _UCBHELPER_COMMANDENVIRONMENTPROXY_HXX 26 27 #include <com/sun/star/lang/XTypeProvider.hpp> 28 #ifndef _COM_SUN_STAR_UCB_XCOMMMANDENVIRONMENT_HPP_ 29 #include <com/sun/star/ucb/XCommandEnvironment.hpp> 30 #endif 31 #include <cppuhelper/weak.hxx> 32 #include <ucbhelper/macros.hxx> 33 34 namespace ucbhelper 35 { 36 37 struct CommandEnvironmentProxy_Impl; 38 39 //========================================================================= 40 41 /** 42 * This class implements the interface 43 * com::sun::star::ucb::XCommandEnvironement. 44 * 45 * Instances of this class can be used to create a (local) proxy for (remote) 46 * command environment implementations. This implementation caches the 47 * (remote) interfaces supplied by the given environment in order to avoid the 48 * overhead produced by multiple (remote) calls to methods of the given 49 * (remote) command environment. 50 */ 51 class CommandEnvironmentProxy : public cppu::OWeakObject, 52 public com::sun::star::lang::XTypeProvider, 53 public com::sun::star::ucb::XCommandEnvironment 54 { 55 CommandEnvironmentProxy_Impl* m_pImpl; 56 57 private: 58 CommandEnvironmentProxy( const CommandEnvironmentProxy& ); // n.i. 59 CommandEnvironmentProxy& operator=( const CommandEnvironmentProxy& ); // n.i. 60 61 public: 62 /** 63 * Constructor. 64 * 65 * @param rxEnv is the implementation of a (remote) command environment. 66 */ 67 CommandEnvironmentProxy( 68 const com::sun::star::uno::Reference< 69 com::sun::star::ucb::XCommandEnvironment >& rxEnv ); 70 /** 71 * Destructor. 72 */ 73 virtual ~CommandEnvironmentProxy(); 74 75 // XInterface 76 XINTERFACE_DECL() 77 78 // XTypeProvider 79 XTYPEPROVIDER_DECL() 80 81 // XCommandEnvironemnt 82 virtual com::sun::star::uno::Reference< 83 com::sun::star::task::XInteractionHandler > SAL_CALL 84 getInteractionHandler() 85 throw ( com::sun::star::uno::RuntimeException ); 86 87 virtual com::sun::star::uno::Reference< 88 com::sun::star::ucb::XProgressHandler > SAL_CALL 89 getProgressHandler() 90 throw ( com::sun::star::uno::RuntimeException ); 91 }; 92 93 } /* namespace ucbhelper */ 94 95 #endif /* !_UCBHELPER_COMMANDENVIRONMENTPROXY_HXX */ 96