LibreOffice Module svx (master) 1
svxpixelctlaccessiblecontext.hxx
Go to the documentation of this file.
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 */
19#ifndef INCLUDED_SVX_SOURCE_INC_SVXPIXELCTLACCESSIBLECONTEXT_HXX
20#define INCLUDED_SVX_SOURCE_INC_SVXPIXELCTLACCESSIBLECONTEXT_HXX
21
22#include <com/sun/star/accessibility/XAccessible.hpp>
23#include <com/sun/star/accessibility/XAccessibleContext.hpp>
24
25#include <com/sun/star/uno/Reference.hxx>
28
29#include <rtl/ref.hxx>
30#include <tools/gen.hxx>
31
32
33namespace com::sun::star::awt {
34 struct Point;
35 struct Rectangle;
36 struct Size;
37 class XFocusListener;
38}
39class SvxPixelCtl;
41
42typedef ::cppu::ImplHelper1<css::accessibility::XAccessible> OAccessibleHelper_Base;
43
46{
47public:
49 SvxPixelCtl& rWindow,
50 bool bPixelColorOrBG,
51 const tools::Rectangle& rBounds,
53 tools::Long nIndexInParent );
54
57
58 //XAccessibleComponent
59 virtual void SAL_CALL grabFocus( ) override;
60 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
61
62 //XAccessibleContext
63 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
64 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
65 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
66 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
67 virtual OUString SAL_CALL getAccessibleDescription( ) override;
68 virtual OUString SAL_CALL getAccessibleName( ) override;
69 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
70 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
71
72 //XAccessible
73 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
74
75 virtual sal_Int32 SAL_CALL getForeground( ) override;
76 virtual sal_Int32 SAL_CALL getBackground( ) override;
77
78 void CheckChild();
79 void SelectChild( bool bSelect);
80 void ChangePixelColorOrBG(bool bPixelColorOrBG){ m_bPixelColorOrBG = bPixelColorOrBG ;}
81 OUString GetName() const;
82
83private:
84 virtual ~SvxPixelCtlAccessibleChild() override;
85
86 virtual void SAL_CALL disposing() override;
87
88 // OCommonAccessibleComponent
90 virtual css::awt::Rectangle implGetBounds( ) override;
91
94 bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color
98};
99
100class SvxPixelCtlAccessible final : public ::comphelper::OAccessibleSelectionHelper,
102{
103public:
105
108
109 //XAccessibleComponent
110 virtual void SAL_CALL grabFocus( ) override;
111 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
112
113 //XAccessible
114 //XAccessibleContext
115 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
116 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
117 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
118 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
119 virtual OUString SAL_CALL getAccessibleDescription( ) override;
120 virtual OUString SAL_CALL getAccessibleName( ) override;
121 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
122 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
123
124 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
125 virtual sal_Int32 SAL_CALL getForeground( ) override;
126 virtual sal_Int32 SAL_CALL getBackground( ) override;
127
128 css::uno::Reference< css::accessibility::XAccessible >
130
131private:
132 virtual ~SvxPixelCtlAccessible() override;
133
134 // OCommonAccessibleSelection
135 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
136 virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override;
137
138 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
139 virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override;
140
141 // OCommonAccessibleComponent
142 virtual css::awt::Rectangle implGetBounds() override;
143
144 virtual void SAL_CALL disposing() override;
145
147 css::uno::Reference< css::accessibility::XAccessible> m_xCurChild;
148
149public:
150 void NotifyChild(tools::Long nIndex, bool bSelect, bool bCheck);
151};
152
153#endif
154
155/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual void SAL_CALL grabFocus() override
tools::Long mnIndexInParent
index of child in parent
rtl::Reference< SvxPixelCtlAccessible > mxParent
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual OUString SAL_CALL getAccessibleDescription() override
SvxPixelCtlAccessibleChild(SvxPixelCtl &rWindow, bool bPixelColorOrBG, const tools::Rectangle &rBounds, rtl::Reference< SvxPixelCtlAccessible > xParent, tools::Long nIndexInParent)
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual void SAL_CALL disposing() override
void ChangePixelColorOrBG(bool bPixelColorOrBG)
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return empty uno::Reference to indicate that the relation set is not supported.
virtual sal_Int32 SAL_CALL getForeground() override
virtual OUString SAL_CALL getAccessibleName() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual void SAL_CALL grabFocus() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual void SAL_CALL disposing() override
virtual css::awt::Rectangle implGetBounds() override
SvxPixelCtlAccessible(SvxPixelCtl *pPixelCtl)
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
css::uno::Reference< css::accessibility::XAccessible > CreateChild(tools::Long nIndex, Point mPoint)
css::uno::Reference< css::accessibility::XAccessible > m_xCurChild
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
void NotifyChild(tools::Long nIndex, bool bSelect, bool bCheck)
virtual OUString SAL_CALL getAccessibleName() override
sal_Int32 nIndex
int i
long Long
::cppu::ImplHelper1< css::accessibility::XAccessible > OAccessibleHelper_Base
#define DECLARE_XTYPEPROVIDER()
#define DECLARE_XINTERFACE()