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
42class SvxPixelCtlAccessibleChild final : public cppu::ImplInheritanceHelper<
43 ::comphelper::OAccessibleComponentHelper,
44 css::accessibility::XAccessible>
45{
46public:
48 SvxPixelCtl& rWindow,
49 bool bPixelColorOrBG,
50 const tools::Rectangle& rBounds,
52 tools::Long nIndexInParent );
53
54 //XAccessibleComponent
55 virtual void SAL_CALL grabFocus( ) override;
56 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
57
58 //XAccessibleContext
59 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
60 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
61 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
62 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
63 virtual OUString SAL_CALL getAccessibleDescription( ) override;
64 virtual OUString SAL_CALL getAccessibleName( ) override;
65 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
66 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
67
68 //XAccessible
69 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
70
71 virtual sal_Int32 SAL_CALL getForeground( ) override;
72 virtual sal_Int32 SAL_CALL getBackground( ) override;
73
74 void CheckChild();
75 void SelectChild( bool bSelect);
76 void ChangePixelColorOrBG(bool bPixelColorOrBG){ m_bPixelColorOrBG = bPixelColorOrBG ;}
77 OUString GetName() const;
78
79private:
80 virtual ~SvxPixelCtlAccessibleChild() override;
81
82 virtual void SAL_CALL disposing() override;
83
84 // OCommonAccessibleComponent
86 virtual css::awt::Rectangle implGetBounds( ) override;
87
90 bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color
94};
95
96class SvxPixelCtlAccessible final : public cppu::ImplInheritanceHelper<
97 ::comphelper::OAccessibleSelectionHelper,
98 css::accessibility::XAccessible>
99{
100public:
102
103 //XAccessibleComponent
104 virtual void SAL_CALL grabFocus( ) override;
105 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
106
107 //XAccessible
108 //XAccessibleContext
109 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
110 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
111 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
112 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
113 virtual OUString SAL_CALL getAccessibleDescription( ) override;
114 virtual OUString SAL_CALL getAccessibleName( ) override;
115 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
116 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
117
118 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
119 virtual sal_Int32 SAL_CALL getForeground( ) override;
120 virtual sal_Int32 SAL_CALL getBackground( ) override;
121
122 css::uno::Reference< css::accessibility::XAccessible >
124
125private:
126 virtual ~SvxPixelCtlAccessible() override;
127
128 // OCommonAccessibleSelection
129 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
130 virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override;
131
132 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
133 virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override;
134
135 // OCommonAccessibleComponent
136 virtual css::awt::Rectangle implGetBounds() override;
137
138 virtual void SAL_CALL disposing() override;
139
141 css::uno::Reference< css::accessibility::XAccessible> m_xCurChild;
142
143public:
144 void NotifyChild(tools::Long nIndex, bool bSelect, bool bCheck);
145};
146
147#endif
148
149/* 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