LibreOffice Module winaccessibility (master) 1
AccComponent.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/accessibility/XAccessible.hpp>
25#include <com/sun/star/accessibility/XAccessibleContext.hpp>
26#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
27#include "UNOXWrapper.h"
28#include "AccComponentBase.h"
29
30
34class ATL_NO_VTABLE CAccComponent :
35 public CComObjectRoot,
36 public CComCoClass<CAccComponent,&CLSID_AccComponent>,
39{
40public:
42 {
43 }
44
45 BEGIN_COM_MAP(CAccComponent)
46 COM_INTERFACE_ENTRY(IAccessibleComponent)
47 COM_INTERFACE_ENTRY(IUNOXWrapper)
48 COM_INTERFACE_ENTRY_FUNC_BLIND(0,SmartQI_)
49#if defined __clang__
50#pragma clang diagnostic push
51#pragma clang diagnostic ignored "-Winconsistent-missing-override"
52#endif
53 END_COM_MAP()
54#if defined __clang__
55#pragma clang diagnostic pop
56#endif
57
58 static HRESULT WINAPI SmartQI_(void* pv,
59 REFIID iid, void** ppvObject, DWORD_PTR)
60 {
61 return static_cast<CAccComponent*>(pv)->SmartQI(iid,ppvObject);
62 }
63
64 HRESULT SmartQI(REFIID iid, void** ppvObject)
65 {
66 if( m_pOuterUnknown )
67 return OuterQueryInterface(iid,ppvObject);
68 return E_FAIL;
69 }
70
71 DECLARE_NO_REGISTRY()
72
73public:
74 // IAccessibleComponent
75
76 // Returns the location of the upper left corner of the object's bounding
77 // box relative to the parent.
78 STDMETHOD(get_locationInParent)(long *x, long *y) override;
79
80 // Returns the foreground color of this object.
81 STDMETHOD(get_foreground)(IA2Color * foreground) override;
82
83 // Returns the background color of this object.
84 STDMETHOD(get_background)(IA2Color * background) override;
85};
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CAccComponent implements IAccessibleComponent interface.
Definition: AccComponent.h:39
HRESULT SmartQI(REFIID iid, void **ppvObject)
Definition: AccComponent.h:64
static HRESULT WINAPI SmartQI_(void *pv, REFIID iid, void **ppvObject, DWORD_PTR)
Definition: AccComponent.h:58
long IA2Color
A value specifying a color in ARGB format, where each 8 bit color component specifies alpha,...
This interface is implemented by any object that can be rendered on the screen.