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