1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "AccComponentBase.h"
22 #include <com/sun/star/accessibility/XAccessible.hpp>
23 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
24 #include <vcl/svapp.hxx>
25 #include "MAccessible.h"
27 using namespace com::sun::star::accessibility
;
28 using namespace com::sun::star::uno
;
30 // Construction/Destruction
32 CAccComponentBase::CAccComponentBase() {}
34 CAccComponentBase::~CAccComponentBase() {}
37 * Returns the location of the upper left corner of the object's bounding
38 * box relative to the parent.
40 * @param Location the upper left corner of the object's bounding box.
42 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::get_locationInParent(long* x
, long* y
)
48 if (x
== nullptr || y
== nullptr)
54 const css::awt::Point
& pt
= GetXInterface()->getLocation();
66 * Returns the location of the upper left corner of the object's bounding
69 * @param Location the upper left corner of the object's bounding
70 * box in screen coordinates.
72 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::get_locationOnScreen(long* x
, long* y
)
78 if (x
== nullptr || y
== nullptr)
84 const css::awt::Point
& pt
= GetXInterface()->getLocationOnScreen();
96 * Grabs the focus to this object.
98 * @param success the boolean result to be returned.
100 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::grabFocus(boolean
* success
)
106 if (success
== nullptr)
113 GetXInterface()->grabFocus();
125 * Returns the foreground color of this object.
127 * @param Color the color of foreground.
129 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::get_foreground(IA2Color
* foreground
)
135 if (foreground
== nullptr)
142 *foreground
= static_cast<long>(GetXInterface()->getForeground());
153 * Returns the background color of this object.
155 * @param Color the color of background.
157 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::get_background(IA2Color
* background
)
163 if (background
== nullptr)
170 *background
= static_cast<long>(GetXInterface()->getBackground());
181 * Override of IUNOXWrapper.
183 * @param pXInterface the pointer of UNO interface.
185 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccComponentBase::put_XInterface(hyper pXInterface
)
187 // internal IUNOXWrapper - no mutex meeded
191 CUNOXWrapper::put_XInterface(pXInterface
);
193 if (pUNOInterface
== nullptr)
195 Reference
<XAccessibleContext
> pRContext
= pUNOInterface
->getAccessibleContext();
200 Reference
<XAccessibleComponent
> pRXI(pRContext
, UNO_QUERY
);
204 pRXComp
= pRXI
.get();
214 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */