xref: /trunk/main/accessibility/inc/accessibility/extended/listboxaccessible.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*a462bbb7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a462bbb7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a462bbb7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a462bbb7SAndrew Rist  * distributed with this work for additional information
6*a462bbb7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a462bbb7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a462bbb7SAndrew Rist  * "License"); you may not use this file except in compliance
9*a462bbb7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*a462bbb7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*a462bbb7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a462bbb7SAndrew Rist  * software distributed under the License is distributed on an
15*a462bbb7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a462bbb7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*a462bbb7SAndrew Rist  * specific language governing permissions and limitations
18*a462bbb7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*a462bbb7SAndrew Rist  *************************************************************/
21*a462bbb7SAndrew Rist 
22*a462bbb7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_LISTBOX_ACCESSIBLE
25cdf0e10cSrcweir #define ACCESSIBILITY_EXT_LISTBOX_ACCESSIBLE
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp>
28cdf0e10cSrcweir #include <tools/link.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SvTreeListBox;
31cdf0e10cSrcweir class VclSimpleEvent;
32cdf0e10cSrcweir class VclWindowEvent;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir //........................................................................
35cdf0e10cSrcweir namespace accessibility
36cdf0e10cSrcweir {
37cdf0e10cSrcweir //........................................................................
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     //====================================================================
40cdf0e10cSrcweir     //= ListBoxAccessibleBase
41cdf0e10cSrcweir     //====================================================================
42cdf0e10cSrcweir     /** helper class which couples it's life time to the life time of an
43cdf0e10cSrcweir         SvTreeListBox
44cdf0e10cSrcweir     */
45cdf0e10cSrcweir     class ListBoxAccessibleBase
46cdf0e10cSrcweir     {
47cdf0e10cSrcweir     private:
48cdf0e10cSrcweir         SvTreeListBox* m_pWindow;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     protected:
getListBox() const51cdf0e10cSrcweir         inline SvTreeListBox*       getListBox() const
52cdf0e10cSrcweir         {
53cdf0e10cSrcweir             return  const_cast< ListBoxAccessibleBase* >( this )->m_pWindow;
54cdf0e10cSrcweir         }
55cdf0e10cSrcweir 
isAlive() const56cdf0e10cSrcweir         inline  bool                    isAlive() const     { return NULL != m_pWindow; }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     public:
59cdf0e10cSrcweir         ListBoxAccessibleBase( SvTreeListBox& _rWindow );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     protected:
62cdf0e10cSrcweir         virtual ~ListBoxAccessibleBase( );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir         // own overridables
65cdf0e10cSrcweir         /// will be called for any VclWindowEvent events broadcasted by our VCL window
66cdf0e10cSrcweir         virtual void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         /** will be called when our window broadcasts the VCLEVENT_OBJECT_DYING event
69cdf0e10cSrcweir 
70cdf0e10cSrcweir             <p>Usually, you derive your class from both ListBoxAccessibleBase and XComponent,
71cdf0e10cSrcweir             and call XComponent::dispose here.</p>
72cdf0e10cSrcweir         */
73cdf0e10cSrcweir         virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException ) = 0;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         /// to be called in the dispose method of your derived class
76cdf0e10cSrcweir         void disposing();
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     private:
79cdf0e10cSrcweir         DECL_LINK( WindowEventListener, VclSimpleEvent* );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     private:
82cdf0e10cSrcweir         ListBoxAccessibleBase( );                                           // never implemented
83cdf0e10cSrcweir         ListBoxAccessibleBase( const ListBoxAccessibleBase& );              // never implemented
84cdf0e10cSrcweir         ListBoxAccessibleBase& operator=( const ListBoxAccessibleBase& );   // never implemented
85cdf0e10cSrcweir     };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //........................................................................
88cdf0e10cSrcweir }   // namespace accessibility
89cdf0e10cSrcweir //........................................................................
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif // ACCESSIBILITY_EXT_LISTBOX_ACCESSIBLE
92