2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 import com
.sun
.star
.uno
.UnoRuntime
;
20 import com
.sun
.star
.accessibility
.XAccessibleContext
;
21 import com
.sun
.star
.accessibility
.XAccessibleExtendedComponent
;
24 class AccessibleExtendedComponentHandler
27 public NodeHandler
createHandler (XAccessibleContext xContext
)
29 XAccessibleExtendedComponent xEComponent
=
30 UnoRuntime
.queryInterface (
31 XAccessibleExtendedComponent
.class, xContext
);
32 if (xEComponent
!= null)
33 return new AccessibleExtendedComponentHandler (xEComponent
);
38 public AccessibleExtendedComponentHandler ()
42 public AccessibleExtendedComponentHandler (XAccessibleExtendedComponent xEComponent
)
44 if (xEComponent
!= null)
45 maChildList
.setSize (0);
48 private static XAccessibleExtendedComponent
getComponent (AccTreeNode aNode
)
50 return UnoRuntime
.queryInterface (
51 XAccessibleExtendedComponent
.class,
56 public AccessibleTreeNode
createChild (AccessibleTreeNode aParent
, int nIndex
)
58 AccessibleTreeNode aChild
= null;
59 if (aParent
instanceof AccTreeNode
)
61 XAccessibleExtendedComponent xEComponent
= getComponent ((AccTreeNode
)aParent
);
63 if (xEComponent
!= null)
69 nColor
= xEComponent
.getForeground();
70 aChild
= new StringNode ("Depricated Foreground color: R"
72 + "G" + (nColor
>>8&0xff)
73 + "B" + (nColor
>>0&0xff)
74 + "A" + (nColor
>>24&0xff),
78 nColor
= xEComponent
.getBackground();
79 aChild
= new StringNode ("Depricated Background color: R"
81 + "G" + (nColor
>>8&0xff)
82 + "B" + (nColor
>>0&0xff)
83 + "A" + (nColor
>>24&0xff),