xref: /AOO41X/main/winaccessibility/inc/AccEventListener.hxx (revision ffad8df045fe8db79e3e50f731c1fa6ab6501c83)
1*3a700b0aSSteve Yin /**************************************************************
25fdc4257SSteve Yin  *
3*3a700b0aSSteve Yin  * Licensed to the Apache Software Foundation (ASF) under one
4*3a700b0aSSteve Yin  * or more contributor license agreements.  See the NOTICE file
5*3a700b0aSSteve Yin  * distributed with this work for additional information
6*3a700b0aSSteve Yin  * regarding copyright ownership.  The ASF licenses this file
7*3a700b0aSSteve Yin  * to you under the Apache License, Version 2.0 (the
8*3a700b0aSSteve Yin  * "License"); you may not use this file except in compliance
9*3a700b0aSSteve Yin  * with the License.  You may obtain a copy of the License at
105fdc4257SSteve Yin  *
11*3a700b0aSSteve Yin  *   http://www.apache.org/licenses/LICENSE-2.0
125fdc4257SSteve Yin  *
13*3a700b0aSSteve Yin  * Unless required by applicable law or agreed to in writing,
14*3a700b0aSSteve Yin  * software distributed under the License is distributed on an
15*3a700b0aSSteve Yin  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3a700b0aSSteve Yin  * KIND, either express or implied.  See the License for the
17*3a700b0aSSteve Yin  * specific language governing permissions and limitations
18*3a700b0aSSteve Yin  * under the License.
195fdc4257SSteve Yin  *
20*3a700b0aSSteve Yin  *************************************************************/
215fdc4257SSteve Yin 
225fdc4257SSteve Yin #ifndef __ACCEVENTLISTENER_HXX
235fdc4257SSteve Yin #define __ACCEVENTLISTENER_HXX
245fdc4257SSteve Yin 
255fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
265fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessible.hpp>
275fdc4257SSteve Yin #include <cppuhelper/weak.hxx>
285fdc4257SSteve Yin #include <vos/mutex.hxx>
295fdc4257SSteve Yin 
305fdc4257SSteve Yin class AccObjectManagerAgent;
315fdc4257SSteve Yin using namespace ::com::sun::star::uno;
325fdc4257SSteve Yin /**
335fdc4257SSteve Yin  * AccEventListener is the general event listener for all controls. It defines the
345fdc4257SSteve Yin  * procedure of all the event handling and provides the basic support for some simple
355fdc4257SSteve Yin  * methods.
365fdc4257SSteve Yin  */
375fdc4257SSteve Yin class AccEventListener:
385fdc4257SSteve Yin             public com::sun::star::accessibility::XAccessibleEventListener,
395fdc4257SSteve Yin             public ::cppu::OWeakObject
405fdc4257SSteve Yin {
415fdc4257SSteve Yin private:
425fdc4257SSteve Yin     oslInterlockedCount m_refcount;
435fdc4257SSteve Yin protected:
445fdc4257SSteve Yin     //accessible owner's pointer
455fdc4257SSteve Yin     com::sun::star::accessibility::XAccessible* pAccessible;
465fdc4257SSteve Yin     //agent pointer for objects' manager
475fdc4257SSteve Yin     AccObjectManagerAgent* pAgent;
485fdc4257SSteve Yin     //disposed state indicator
495fdc4257SSteve Yin     bool  m_isDisposed;
505fdc4257SSteve Yin     mutable ::vos::OMutex aRemoveMutex;
515fdc4257SSteve Yin public:
525fdc4257SSteve Yin     AccEventListener( com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
535fdc4257SSteve Yin     virtual ~AccEventListener();
545fdc4257SSteve Yin 
555fdc4257SSteve Yin     //AccessibleEventListener
565fdc4257SSteve Yin     virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
575fdc4257SSteve Yin 
585fdc4257SSteve Yin     //for name changed event
595fdc4257SSteve Yin     virtual void SAL_CALL handleNameChangedEvent(Any name);
605fdc4257SSteve Yin 
615fdc4257SSteve Yin     //for description changed event
625fdc4257SSteve Yin     virtual void SAL_CALL handleDescriptionChangedEvent(Any desc);
635fdc4257SSteve Yin 
645fdc4257SSteve Yin     //for state changed event
655fdc4257SSteve Yin     virtual void SAL_CALL handleStateChangedEvent (Any oldValue, Any newValue);
665fdc4257SSteve Yin     virtual void SAL_CALL setComponentState(short state, bool enable);
675fdc4257SSteve Yin     virtual void SAL_CALL fireStatePropertyChange(short state, bool set
685fdc4257SSteve Yin                                                      );
695fdc4257SSteve Yin     virtual void SAL_CALL fireStateFocusdChange(bool enable);
705fdc4257SSteve Yin 
715fdc4257SSteve Yin     //for bound rect changed event
725fdc4257SSteve Yin     virtual void SAL_CALL handleBoundrectChangedEvent();
735fdc4257SSteve Yin 
745fdc4257SSteve Yin     //for visible data changed event
755fdc4257SSteve Yin     virtual void SAL_CALL handleVisibleDataChangedEvent();
765fdc4257SSteve Yin 
775fdc4257SSteve Yin     //for interface
785fdc4257SSteve Yin     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
795fdc4257SSteve Yin     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
805fdc4257SSteve Yin     virtual void SAL_CALL acquire() throw ();
815fdc4257SSteve Yin     virtual void SAL_CALL release() throw ();
825fdc4257SSteve Yin     //get the accessible role of pAccessible
835fdc4257SSteve Yin     virtual short SAL_CALL getRole();
845fdc4257SSteve Yin     //get the accessible parent's role
855fdc4257SSteve Yin     virtual short SAL_CALL getParentRole();
865fdc4257SSteve Yin public:
875fdc4257SSteve Yin     void removeMeFromBroadcaster();
885fdc4257SSteve Yin };
895fdc4257SSteve Yin 
905fdc4257SSteve Yin #endif
91