AccessibleTextImpl.h [plain text]
#ifndef AccessibleTextImpl_h
#define AccessibleTextImpl_h
#include "AccessibleBase.h"
#include <WebCore/VisiblePosition.h>
class AccessibleText : public AccessibleBase, public IAccessibleText2, public IAccessibleEditableText {
public:
AccessibleText(WebCore::AccessibilityObject*, HWND);
virtual ~AccessibleText() { }
virtual HRESULT STDMETHODCALLTYPE addSelection(long startOffset, long endOffset);
virtual HRESULT STDMETHODCALLTYPE get_attributes(long offset, long* startOffset, long* endOffset, BSTR* textAttributes);
virtual HRESULT STDMETHODCALLTYPE get_caretOffset(long* offset);
virtual HRESULT STDMETHODCALLTYPE get_characterExtents(long offset, enum IA2CoordinateType coordType, long* x, long* y, long* width, long* height);
virtual HRESULT STDMETHODCALLTYPE get_nSelections(long* nSelections);
virtual HRESULT STDMETHODCALLTYPE get_offsetAtPoint(long x, long y, enum IA2CoordinateType coordType, long* offset);
virtual HRESULT STDMETHODCALLTYPE get_selection(long selectionIndex, long* startOffset, long* endOffset);
virtual HRESULT STDMETHODCALLTYPE get_text(long startOffset, long endOffset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE get_textBeforeOffset(long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE get_textAfterOffset(long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE get_textAtOffset(long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE removeSelection(long selectionIndex);
virtual HRESULT STDMETHODCALLTYPE setCaretOffset(long offset);
virtual HRESULT STDMETHODCALLTYPE setSelection(long selectionIndex, long startOffset, long endOffset);
virtual HRESULT STDMETHODCALLTYPE get_nCharacters(long* characters);
virtual HRESULT STDMETHODCALLTYPE scrollSubstringTo(long startIndex, long endIndex, enum IA2ScrollType scrollType);
virtual HRESULT STDMETHODCALLTYPE scrollSubstringToPoint(long startIndex, long endIndex, enum IA2CoordinateType coordinateType, long x, long y);
virtual HRESULT STDMETHODCALLTYPE get_newText(IA2TextSegment* newText);
virtual HRESULT STDMETHODCALLTYPE get_oldText(IA2TextSegment* oldText);
virtual HRESULT STDMETHODCALLTYPE get_attributeRange(long offset, BSTR filter, long* startOffset, long* endOffset, BSTR* attributeValues);
virtual HRESULT STDMETHODCALLTYPE copyText(long startOffset, long endOffset);
virtual HRESULT STDMETHODCALLTYPE deleteText(long startOffset, long endOffset);
virtual HRESULT STDMETHODCALLTYPE insertText(long offset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE cutText(long startOffset, long endOffset);
virtual HRESULT STDMETHODCALLTYPE pasteText(long offset);
virtual HRESULT STDMETHODCALLTYPE replaceText(long startOffset, long endOffset, BSTR* text);
virtual HRESULT STDMETHODCALLTYPE setAttributes(long startOffset, long endOffset, BSTR* attributes);
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
virtual ULONG STDMETHODCALLTYPE AddRef() { return ++m_refCount; }
virtual ULONG STDMETHODCALLTYPE Release();
virtual HRESULT STDMETHODCALLTYPE get_attributes(BSTR* attributes);
private:
int convertSpecialOffset(int specialOffset);
HRESULT initialCheck();
bool isInRange(WebCore::VisiblePosition& current, WebCore::VisiblePositionRange& wordRange);
};
#endif // AccessibleText_h