calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / vcl / osx / a11ywrapperscrollarea.mm
blob22037220d409d3a7d936c183ca84d59af97dfe6f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
21 #include <vcl/svapp.hxx>
22 #include <osx/salinst.h>
24 #include "a11ywrapperscrollarea.h"
25 #include "a11ywrapperscrollbar.h"
26 #include "a11yrolehelper.h"
28 // Wrapper for AXScrollArea role
30 @implementation AquaA11yWrapperScrollArea : AquaA11yWrapper
32 -(id)scrollBarWithOrientation:(NSString *)orientation {
33     AquaA11yWrapper * theScrollBar = nil;
34     NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
35     NSArray * elementChildren = [ self accessibilityAttributeValue: NSAccessibilityChildrenAttribute ];
36     if ( [ elementChildren count ] > 0 ) {
37         NSEnumerator * enumerator = [ elementChildren objectEnumerator ];
38         id child;
39         while ( ( child = [ enumerator nextObject ] ) ) {
40             AquaA11yWrapper * element = static_cast<AquaA11yWrapper *>(child);
41             if ( [ element isKindOfClass: [ AquaA11yWrapperScrollBar class ] ] ) { 
42                 AquaA11yWrapperScrollBar * scrollBar = static_cast<AquaA11yWrapperScrollBar *>(element);
43                 if ( [ [ scrollBar orientationAttribute ] isEqualToString: orientation ] ) {
44                     theScrollBar = scrollBar;
45                     break;
46                 }
47             }
48         }
49     }
50     [ pool release ];
51     return theScrollBar;
54 -(id)verticalScrollBarAttribute {
55     return [ self scrollBarWithOrientation: NSAccessibilityVerticalOrientationValue ];
58 -(id)horizontalScrollBarAttribute {
59     return [ self scrollBarWithOrientation: NSAccessibilityHorizontalOrientationValue ];
62 -(NSArray *)accessibilityAttributeNames {
63     // Related: tdf#148453 Acquire solar mutex during native accessibility calls
64     SolarMutexGuard aGuard;
66     // Default Attributes
67     NSMutableArray * attributeNames = [ NSMutableArray arrayWithArray: [ super accessibilityAttributeNames ] ];
68     // Special Attributes and removing unwanted attributes depending on role
69     [ attributeNames removeObject: NSAccessibilityEnabledAttribute ];
70     [ attributeNames addObjectsFromArray: [ NSArray arrayWithObjects:
71             NSAccessibilityContentsAttribute, 
72             NSAccessibilityVerticalScrollBarAttribute, 
73             NSAccessibilityHorizontalScrollBarAttribute, 
74             nil ]
75     ];
76     return attributeNames;
79 @end
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */