Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "accessibility/extended/AccessibleGridControlHeaderCell.hxx"
31 : : #include <svtools/accessibletable.hxx>
32 : : #include "accessibility/extended/AccessibleGridControl.hxx"
33 : :
34 : : namespace accessibility
35 : : {
36 : : using namespace ::com::sun::star::accessibility;
37 : : using namespace ::com::sun::star::lang;
38 : : using namespace ::com::sun::star::uno;
39 : : using namespace ::svt;
40 : : using namespace ::svt::table;
41 : :
42 : 0 : AccessibleGridControlHeaderCell::AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId,
43 : : const Reference< XAccessible >& rxParent,
44 : : IAccessibleTable& rTable,
45 : : AccessibleTableControlObjType eObjType)
46 : : : AccessibleGridControlCell( rxParent, rTable, _nColumnRowId, 0, eObjType)
47 : 0 : , m_nColumnRowId(_nColumnRowId)
48 : : {
49 : 0 : }
50 : : /** Creates a new AccessibleStateSetHelper and fills it with states of the
51 : : current object.
52 : : @return
53 : : A filled AccessibleStateSetHelper.
54 : : */
55 : 0 : ::utl::AccessibleStateSetHelper* AccessibleGridControlHeaderCell::implCreateStateSetHelper()
56 : : {
57 [ # # ]: 0 : ::osl::MutexGuard aGuard( getOslMutex() );
58 : : ::utl::AccessibleStateSetHelper*
59 [ # # ]: 0 : pStateSetHelper = new ::utl::AccessibleStateSetHelper;
60 : :
61 [ # # ][ # # ]: 0 : if( isAlive() )
62 : : {
63 : : // SHOWING done with mxParent
64 [ # # ][ # # ]: 0 : if( implIsShowing() )
65 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::SHOWING );
66 : :
67 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
68 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
69 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
70 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
71 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
72 : :
73 [ # # ][ # # ]: 0 : if ( m_aTable.IsRowSelected(m_nColumnRowId) )
74 [ # # ][ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::SELECTED );
75 : : }
76 : : else
77 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
78 : :
79 [ # # ]: 0 : return pStateSetHelper;
80 : : }
81 : : // -----------------------------------------------------------------------------
82 : : /** @return
83 : : The count of visible children.
84 : : */
85 : 0 : sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChildCount()
86 : : throw ( RuntimeException )
87 : : {
88 : 0 : return 0;
89 : : }
90 : : // -----------------------------------------------------------------------------
91 : :
92 : : /** @return
93 : : The XAccessible interface of the specified child.
94 : : */
95 : 0 : Reference<XAccessible > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChild( sal_Int32 )
96 : : throw ( IndexOutOfBoundsException,RuntimeException )
97 : : {
98 [ # # ]: 0 : throw IndexOutOfBoundsException();
99 : : }
100 : : // XInterface -------------------------------------------------------------
101 : :
102 : : /** Queries for a new interface. */
103 : 0 : ::com::sun::star::uno::Any SAL_CALL AccessibleGridControlHeaderCell::queryInterface(
104 : : const ::com::sun::star::uno::Type& rType )
105 : : throw ( ::com::sun::star::uno::RuntimeException )
106 : : {
107 : 0 : Any aRet = AccessibleGridControlCell::queryInterface(rType);
108 : 0 : return aRet;
109 : : }
110 : :
111 : : /** Aquires the object (calls acquire() on base class). */
112 : 0 : void SAL_CALL AccessibleGridControlHeaderCell::acquire() throw ()
113 : : {
114 : 0 : AccessibleGridControlCell::acquire();
115 : 0 : }
116 : :
117 : : /** Releases the object (calls release() on base class). */
118 : 0 : void SAL_CALL AccessibleGridControlHeaderCell::release() throw ()
119 : : {
120 : 0 : AccessibleGridControlCell::release();
121 : 0 : }
122 : : /** @return The XAccessibleContext interface of this object. */
123 : 0 : Reference< com::sun::star::accessibility::XAccessibleContext > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleContext() throw ( RuntimeException )
124 : : {
125 : 0 : ensureIsAlive();
126 : 0 : return this;
127 : : }
128 : :
129 : : // -----------------------------------------------------------------------------
130 : :
131 : : /** Grabs the focus to the column header. */
132 : 0 : void SAL_CALL AccessibleGridControlHeaderCell::grabFocus()
133 : : throw ( ::com::sun::star::uno::RuntimeException )
134 : : {
135 : 0 : }
136 : : // -----------------------------------------------------------------------------
137 : : /** @return
138 : : The name of this class.
139 : : */
140 : 0 : ::rtl::OUString SAL_CALL AccessibleGridControlHeaderCell::getImplementationName()
141 : : throw ( ::com::sun::star::uno::RuntimeException )
142 : : {
143 : 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlHeaderCell" ) );
144 : : }
145 : : // -----------------------------------------------------------------------------
146 : 0 : Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox()
147 : : {
148 [ # # ]: 0 : return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
149 : : }
150 : : // -----------------------------------------------------------------------------
151 : :
152 : 0 : Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen()
153 : : {
154 [ # # ]: 0 : return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
155 : : }
156 : : // -----------------------------------------------------------------------------
157 : 0 : sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleIndexInParent()
158 : : throw ( RuntimeException )
159 : : {
160 [ # # ]: 0 : ::osl::MutexGuard aGuard( getOslMutex() );
161 [ # # ]: 0 : ensureIsAlive();
162 : 0 : sal_Int32 nIndex = m_nColumnRowId;
163 [ # # ]: 0 : return nIndex;
164 : : }
165 : : // -----------------------------------------------------------------------------
166 : : } // namespace accessibility
167 : : // -----------------------------------------------------------------------------
168 : :
169 : :
170 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|