|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_a11y_sdnTextAccessible_h_ |
|
8 #define mozilla_a11y_sdnTextAccessible_h_ |
|
9 |
|
10 #include "ISimpleDOMText.h" |
|
11 #include "IUnknownImpl.h" |
|
12 |
|
13 #include "AccessibleWrap.h" |
|
14 |
|
15 class nsIFrame; |
|
16 class nsPoint; |
|
17 |
|
18 namespace mozilla { |
|
19 namespace a11y { |
|
20 |
|
21 class sdnTextAccessible MOZ_FINAL : public ISimpleDOMText |
|
22 { |
|
23 public: |
|
24 sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {}; |
|
25 ~sdnTextAccessible() {} |
|
26 |
|
27 DECL_IUNKNOWN |
|
28 |
|
29 // ISimpleDOMText |
|
30 |
|
31 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_domText( |
|
32 /* [retval][out] */ BSTR __RPC_FAR *aText); |
|
33 |
|
34 virtual HRESULT STDMETHODCALLTYPE get_clippedSubstringBounds( |
|
35 /* [in] */ unsigned int startIndex, |
|
36 /* [in] */ unsigned int endIndex, |
|
37 /* [out] */ int __RPC_FAR* aX, |
|
38 /* [out] */ int __RPC_FAR* aY, |
|
39 /* [out] */ int __RPC_FAR* aWidth, |
|
40 /* [out] */ int __RPC_FAR* aHeight); |
|
41 |
|
42 virtual HRESULT STDMETHODCALLTYPE get_unclippedSubstringBounds( |
|
43 /* [in] */ unsigned int aStartIndex, |
|
44 /* [in] */ unsigned int aEndIndex, |
|
45 /* [out] */ int __RPC_FAR* aX, |
|
46 /* [out] */ int __RPC_FAR* aY, |
|
47 /* [out] */ int __RPC_FAR* aWidth, |
|
48 /* [out] */ int __RPC_FAR* aHeight); |
|
49 |
|
50 virtual HRESULT STDMETHODCALLTYPE scrollToSubstring( |
|
51 /* [in] */ unsigned int aStartIndex, |
|
52 /* [in] */ unsigned int aEndIndex); |
|
53 |
|
54 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_fontFamily( |
|
55 /* [retval][out] */ BSTR __RPC_FAR* aFontFamily); |
|
56 |
|
57 private: |
|
58 /** |
|
59 * Return child frame containing offset on success. |
|
60 */ |
|
61 nsIFrame* GetPointFromOffset(nsIFrame* aContainingFrame, |
|
62 int32_t aOffset, bool aPreferNext, |
|
63 nsPoint& aOutPoint); |
|
64 |
|
65 nsRefPtr<AccessibleWrap> mAccessible; |
|
66 }; |
|
67 |
|
68 } // namespace a11y |
|
69 } // namespace mozilla |
|
70 |
|
71 #endif |