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 "AccessibleFilterTopWindow.hxx"
31 : : #include "AccessibleFilterMenu.hxx"
32 : : #include "checklistmenu.hxx"
33 : :
34 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
35 : :
36 : : using namespace ::com::sun::star;
37 : : using namespace ::com::sun::star::accessibility;
38 : : using ::com::sun::star::lang::IndexOutOfBoundsException;
39 : : using ::com::sun::star::uno::Reference;
40 : : using ::com::sun::star::uno::RuntimeException;
41 : : using ::rtl::OUString;
42 : :
43 : 0 : ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow(
44 : : const Reference<XAccessible>& rxParent, ScCheckListMenuWindow* pWin, const OUString& rName, ScDocument* pDoc) :
45 : : ScAccessibleFilterMenu(rxParent, pWin, rName, ScMenuFloatingWindow::MENU_NOT_SELECTED, pDoc),
46 : : mpWindow(pWin),
47 : 0 : mpDoc(pDoc)
48 : : {
49 : 0 : SetName(rName);
50 : 0 : }
51 : :
52 : 0 : ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow()
53 : : {
54 [ # # ]: 0 : }
55 : :
56 : : // XAccessibleContext
57 : :
58 : 0 : sal_Int32 ScAccessibleFilterTopWindow::getAccessibleChildCount() throw (RuntimeException)
59 : : {
60 : 0 : sal_Int32 nMenuCount = getMenuItemCount();
61 : 0 : return nMenuCount + 6;
62 : : }
63 : :
64 : 0 : Reference<XAccessible> ScAccessibleFilterTopWindow::getAccessibleChild(
65 : : sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException)
66 : : {
67 [ # # ]: 0 : if (nIndex >= getAccessibleChildCount())
68 [ # # ]: 0 : throw IndexOutOfBoundsException();
69 : :
70 : 0 : sal_Int32 nMenuCount = getMenuItemCount();
71 [ # # ]: 0 : if (nIndex < nMenuCount)
72 : 0 : return ScAccessibleFilterMenu::getAccessibleChild(nIndex);
73 : :
74 : 0 : nIndex -= nMenuCount;
75 [ # # # # : 0 : switch (nIndex)
# # # ]
76 : : {
77 : : case 0:
78 : 0 : return mxAccListBox;
79 : : case 1:
80 : 0 : return mxAccToggleAll;
81 : : case 2:
82 : 0 : return mxAccSingleOnBtn;
83 : : case 3:
84 : 0 : return mxAccSingleOffBtn;
85 : : case 4:
86 : 0 : return mxAccOkBtn;
87 : : case 5:
88 : 0 : return mxAccCancelBtn;
89 : : default:
90 : : ;
91 : : }
92 : :
93 : 0 : return Reference<XAccessible>();
94 : : }
95 : :
96 : 0 : OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeException)
97 : : {
98 : 0 : return OUString(RTL_CONSTASCII_USTRINGPARAM("ScAccessibleFilterTopWindow"));
99 : : }
100 : :
101 : 0 : void ScAccessibleFilterTopWindow::setAccessibleChild(
102 : : const Reference<XAccessible>& rAccessible, ChildControlType eType)
103 : : {
104 [ # # # # : 0 : switch (eType)
# # # ]
105 : : {
106 : : case LISTBOX:
107 : 0 : mxAccListBox = rAccessible;
108 : 0 : break;
109 : : case TOGGLE_ALL:
110 : 0 : mxAccToggleAll = rAccessible;
111 : 0 : break;
112 : : case SINGLE_ON_BTN:
113 : 0 : mxAccSingleOnBtn = rAccessible;
114 : 0 : break;
115 : : case SINGLE_OFF_BTN:
116 : 0 : mxAccSingleOffBtn = rAccessible;
117 : 0 : break;
118 : : case OK_BTN:
119 : 0 : mxAccOkBtn = rAccessible;
120 : 0 : break;
121 : : case CANCEL_BTN:
122 : 0 : mxAccCancelBtn = rAccessible;
123 : 0 : break;
124 : : }
125 : 0 : }
126 : :
127 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|