LibreOffice Module winaccessibility (master) 1
AccImage.h
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
20#pragma once
21
22#include "Resource.h" // main symbols
23
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/accessibility/XAccessibleImage.hpp>
26#include "UNOXWrapper.h"
27
31class ATL_NO_VTABLE CAccImage :
32 public CComObjectRoot,
33 public CComCoClass<CAccImage,&CLSID_AccImage>,
34 public IAccessibleImage,
35 public CUNOXWrapper
36{
37public:
39 {
40 }
41 virtual ~CAccImage()
42 {
43 }
44 BEGIN_COM_MAP(CAccImage)
45 COM_INTERFACE_ENTRY(IAccessibleImage)
46 COM_INTERFACE_ENTRY(IUNOXWrapper)
47 COM_INTERFACE_ENTRY_FUNC_BLIND(0,SmartQI_)
48#if defined __clang__
49#pragma clang diagnostic push
50#pragma clang diagnostic ignored "-Winconsistent-missing-override"
51#endif
52 END_COM_MAP()
53#if defined __clang__
54#pragma clang diagnostic pop
55#endif
56
57 static HRESULT WINAPI SmartQI_(void* pv,
58 REFIID iid, void** ppvObject, DWORD_PTR)
59 {
60 return static_cast<CAccImage*>(pv)->SmartQI(iid,ppvObject);
61 }
62
63 HRESULT SmartQI(REFIID iid, void** ppvObject)
64 {
65 if( m_pOuterUnknown )
66 return OuterQueryInterface(iid,ppvObject);
67 return E_FAIL;
68 }
69
70 DECLARE_NO_REGISTRY()
71
72public:
73 // IAccessibleImage
74
75 // Gets the description of the image.
76 STDMETHOD(get_description)(BSTR * description) override;
77
78 STDMETHOD(get_imagePosition)( enum IA2CoordinateType coordinateType,
79 long __RPC_FAR *x,
80 long __RPC_FAR *y) override;
81
82 STDMETHOD(get_imageSize)(
83 long __RPC_FAR *height,
84 long __RPC_FAR *width) override;
85
86 // Override of IUNOXWrapper.
87 STDMETHOD(put_XInterface)(hyper pXInterface) override;
88
89private:
90
91 css::uno::Reference<css::accessibility::XAccessibleImage> pRXImg;
92
93 css::accessibility::XAccessibleImage* GetXInterface()
94 {
95 return pRXImg.get();
96 }
97};
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CAccImage implements IAccessibleImage interface.
Definition: AccImage.h:36
static HRESULT WINAPI SmartQI_(void *pv, REFIID iid, void **ppvObject, DWORD_PTR)
Definition: AccImage.h:57
HRESULT SmartQI(REFIID iid, void **ppvObject)
Definition: AccImage.h:63
virtual ~CAccImage()
Definition: AccImage.h:41
CAccImage()
Definition: AccImage.h:38
CUNOXWrapper implements IUNOXWrapper interface.
Definition: UNOXWrapper.h:32
IA2CoordinateType
These constants define which coordinate system a point is located in.
This interface represents images and icons.