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_svx.hxx" 26 27 #include "datalistener.hxx" 28 #include "datanavi.hxx" 29 30 using namespace ::com::sun::star::container; 31 using namespace ::com::sun::star::frame; 32 using namespace ::com::sun::star::lang; 33 using namespace ::com::sun::star::uno; 34 using namespace ::com::sun::star::xml::dom::events; 35 36 //............................................................................ 37 namespace svxform 38 { 39 //............................................................................ 40 DataListener(DataNavigatorWindow * pNaviWin)41 DataListener::DataListener( DataNavigatorWindow* pNaviWin ) : 42 43 m_pNaviWin( pNaviWin ) 44 45 { 46 DBG_ASSERT( m_pNaviWin, "DataListener::Ctor(): no navigator win" ); 47 } 48 ~DataListener()49 DataListener::~DataListener() 50 { 51 } 52 53 // XContainerListener elementInserted(const ContainerEvent &)54 void SAL_CALL DataListener::elementInserted( const ContainerEvent& /*Event*/ ) throw (RuntimeException) 55 { 56 m_pNaviWin->NotifyChanges(); 57 } 58 elementRemoved(const ContainerEvent &)59 void SAL_CALL DataListener::elementRemoved( const ContainerEvent& /*Event*/ ) throw (RuntimeException) 60 { 61 m_pNaviWin->NotifyChanges(); 62 } 63 elementReplaced(const ContainerEvent &)64 void SAL_CALL DataListener::elementReplaced( const ContainerEvent& /*Event*/ ) throw (RuntimeException) 65 { 66 m_pNaviWin->NotifyChanges(); 67 } 68 69 // XFrameActionListener frameAction(const FrameActionEvent & rActionEvt)70 void SAL_CALL DataListener::frameAction( const FrameActionEvent& rActionEvt ) throw (RuntimeException) 71 { 72 if ( FrameAction_COMPONENT_ATTACHED == rActionEvt.Action || 73 FrameAction_COMPONENT_REATTACHED == rActionEvt.Action ) 74 { 75 m_pNaviWin->NotifyChanges( FrameAction_COMPONENT_REATTACHED == rActionEvt.Action ); 76 } 77 } 78 79 // xml::dom::events::XEventListener handleEvent(const Reference<XEvent> &)80 void SAL_CALL DataListener::handleEvent( const Reference< XEvent >& /*evt*/ ) throw (RuntimeException) 81 { 82 m_pNaviWin->NotifyChanges(); 83 } 84 85 // lang::XEventListener disposing(const EventObject &)86 void SAL_CALL DataListener::disposing( const EventObject& /*Source*/ ) throw (RuntimeException) 87 { 88 DBG_ERRORFILE( "disposing" ); 89 } 90 91 //............................................................................ 92 } // namespace svxform 93 //............................................................................ 94 95