Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccEditableText.h
blob62bfc662d3b4035ff2a69f9c1f29df6dc9b83fbf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCEDITABLETEXT_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCEDITABLETEXT_H
23 #include "Resource.h"
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
26 #include "UNOXWrapper.h"
28 /**
29 * CAccEditableText implements IAccessibleEditableText interface.
31 class CAccEditableText :
32 public CComObjectRoot,
33 public CComCoClass<CAccEditableText,&CLSID_AccEditableText>,
34 public IAccessibleEditableText,
35 public CUNOXWrapper
37 public:
38 CAccEditableText()
42 virtual ~CAccEditableText()
47 BEGIN_COM_MAP(CAccEditableText)
48 COM_INTERFACE_ENTRY(IAccessibleEditableText)
49 COM_INTERFACE_ENTRY(IUNOXWrapper)
50 COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,SmartQI_)
51 #if defined __clang__
52 #pragma clang diagnostic push
53 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
54 #endif
55 END_COM_MAP()
56 #if defined __clang__
57 #pragma clang diagnostic pop
58 #endif
60 static HRESULT WINAPI SmartQI_(void* pv,
61 REFIID iid, void** ppvObject, DWORD_PTR)
63 return static_cast<CAccEditableText*>(pv)->SmartQI(iid,ppvObject);
66 HRESULT SmartQI(REFIID iid, void** ppvObject)
68 if( m_pOuterUnknown )
69 return OuterQueryInterface(iid,ppvObject);
70 return E_FAIL;
73 DECLARE_NO_REGISTRY()
75 public:
76 // IAccessibleEditableText
78 // Copies a range of text to the clipboard.
79 STDMETHOD(copyText)(long startOffset, long endOffset) override;
81 // Deletes a range of text.
82 STDMETHOD(deleteText)(long startOffset, long endOffset) override;
84 // Inserts text at a specified offset.
85 STDMETHOD(insertText)(long offset, BSTR * text) override;
87 // Cuts a range of text to the clipboard.
88 STDMETHOD(cutText)(long startOffset, long endOffset) override;
90 // Pastes text from clipboard at specified offset.
91 STDMETHOD(pasteText)(long offset) override;
93 // Replaces range of text with new text.
94 STDMETHOD(replaceText)(long startOffset, long endOffset, BSTR * text) override;
97 // Sets attributes of range of text.
98 STDMETHOD(setAttributes)(long startOffset, long endOffset, BSTR * attributes) override;
100 // Override of IUNOXWrapper.
101 STDMETHOD(put_XInterface)(hyper pXInterface) override;
103 private:
105 css::uno::Reference<css::accessibility::XAccessibleEditableText> pRXEdtTxt;
107 static void get_AnyFromOLECHAR(const OUString &ouName, const OUString &ouValue, css::uno::Any &rAny);
109 css::accessibility::XAccessibleEditableText* GetXInterface()
111 return pRXEdtTxt.get();
115 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCEDITABLETEXT_H
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */