michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_sdnTextAccessible_h_ michael@0: #define mozilla_a11y_sdnTextAccessible_h_ michael@0: michael@0: #include "ISimpleDOMText.h" michael@0: #include "IUnknownImpl.h" michael@0: michael@0: #include "AccessibleWrap.h" michael@0: michael@0: class nsIFrame; michael@0: class nsPoint; michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: class sdnTextAccessible MOZ_FINAL : public ISimpleDOMText michael@0: { michael@0: public: michael@0: sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {}; michael@0: ~sdnTextAccessible() {} michael@0: michael@0: DECL_IUNKNOWN michael@0: michael@0: // ISimpleDOMText michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_domText( michael@0: /* [retval][out] */ BSTR __RPC_FAR *aText); michael@0: michael@0: virtual HRESULT STDMETHODCALLTYPE get_clippedSubstringBounds( michael@0: /* [in] */ unsigned int startIndex, michael@0: /* [in] */ unsigned int endIndex, michael@0: /* [out] */ int __RPC_FAR* aX, michael@0: /* [out] */ int __RPC_FAR* aY, michael@0: /* [out] */ int __RPC_FAR* aWidth, michael@0: /* [out] */ int __RPC_FAR* aHeight); michael@0: michael@0: virtual HRESULT STDMETHODCALLTYPE get_unclippedSubstringBounds( michael@0: /* [in] */ unsigned int aStartIndex, michael@0: /* [in] */ unsigned int aEndIndex, michael@0: /* [out] */ int __RPC_FAR* aX, michael@0: /* [out] */ int __RPC_FAR* aY, michael@0: /* [out] */ int __RPC_FAR* aWidth, michael@0: /* [out] */ int __RPC_FAR* aHeight); michael@0: michael@0: virtual HRESULT STDMETHODCALLTYPE scrollToSubstring( michael@0: /* [in] */ unsigned int aStartIndex, michael@0: /* [in] */ unsigned int aEndIndex); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_fontFamily( michael@0: /* [retval][out] */ BSTR __RPC_FAR* aFontFamily); michael@0: michael@0: private: michael@0: /** michael@0: * Return child frame containing offset on success. michael@0: */ michael@0: nsIFrame* GetPointFromOffset(nsIFrame* aContainingFrame, michael@0: int32_t aOffset, bool aPreferNext, michael@0: nsPoint& aOutPoint); michael@0: michael@0: nsRefPtr mAccessible; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif