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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_ucbhelper.hxx" 26 27 /************************************************************************** 28 TODO 29 ************************************************************************** 30 31 *************************************************************************/ 32 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 33 #include <com/sun/star/lang/XComponent.hpp> 34 #include <com/sun/star/ucb/XContentIdentifierFactory.hpp> 35 #include <com/sun/star/ucb/XContentProvider.hpp> 36 #include <com/sun/star/ucb/XContentProviderManager.hpp> 37 #include <ucbhelper/commandenvironment.hxx> 38 39 using namespace com::sun::star::lang; 40 using namespace com::sun::star::task; 41 using namespace com::sun::star::ucb; 42 using namespace com::sun::star::uno; 43 using namespace rtl; 44 45 namespace ucbhelper 46 { 47 48 //========================================================================= 49 //========================================================================= 50 // 51 // struct CommandEnvironment_Impl. 52 // 53 //========================================================================= 54 //========================================================================= 55 56 struct CommandEnvironment_Impl 57 { 58 Reference< XInteractionHandler > m_xInteractionHandler; 59 Reference< XProgressHandler > m_xProgressHandler; 60 61 CommandEnvironment_Impl( 62 const Reference< XInteractionHandler >& rxInteractionHandler, 63 const Reference< XProgressHandler >& rxProgressHandler ) 64 : m_xInteractionHandler( rxInteractionHandler ), 65 m_xProgressHandler( rxProgressHandler ) {} 66 }; 67 68 //========================================================================= 69 //========================================================================= 70 // 71 // CommandEnvironment Implementation. 72 // 73 //========================================================================= 74 //========================================================================= 75 76 CommandEnvironment::CommandEnvironment( 77 const Reference< XInteractionHandler >& rxInteractionHandler, 78 const Reference< XProgressHandler >& rxProgressHandler ) 79 { 80 m_pImpl = new CommandEnvironment_Impl( rxInteractionHandler, 81 rxProgressHandler ); 82 } 83 84 //========================================================================= 85 // virtual 86 CommandEnvironment::~CommandEnvironment() 87 { 88 delete m_pImpl; 89 } 90 91 //========================================================================= 92 // 93 // XInterface methods 94 // 95 //========================================================================= 96 97 XINTERFACE_IMPL_2( CommandEnvironment, 98 XTypeProvider, 99 XCommandEnvironment ); 100 101 //========================================================================= 102 // 103 // XTypeProvider methods 104 // 105 //========================================================================= 106 107 XTYPEPROVIDER_IMPL_2( CommandEnvironment, 108 XTypeProvider, 109 XCommandEnvironment ); 110 111 //========================================================================= 112 // 113 // XCommandEnvironemnt methods. 114 // 115 //========================================================================= 116 117 // virtual 118 Reference< XInteractionHandler > SAL_CALL 119 CommandEnvironment::getInteractionHandler() 120 throw ( RuntimeException ) 121 { 122 return m_pImpl->m_xInteractionHandler; 123 } 124 125 //========================================================================= 126 // virtual 127 Reference< XProgressHandler > SAL_CALL 128 CommandEnvironment::getProgressHandler() 129 throw ( RuntimeException ) 130 { 131 return m_pImpl->m_xProgressHandler; 132 } 133 134 } /* namespace ucbhelper */ 135 136