LibreOffice Module winaccessibility (master) 1
AccValue.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/XAccessibleValue.hpp>
26#include "UNOXWrapper.h"
27
31class CAccValue :
32 public CComObjectRoot,
33 public CComCoClass<CAccValue,&CLSID_AccValue>,
34 public IAccessibleValue,
35 public CUNOXWrapper
36{
37public:
39 {
40 }
41 virtual ~CAccValue()
42 {
43 }
44
45 BEGIN_COM_MAP(CAccValue)
46 COM_INTERFACE_ENTRY(IAccessibleValue)
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<CAccValue*>(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 // IAccessibleValue
75
76 // Returns the value of this object as a number.
77 STDMETHOD(get_currentValue)(VARIANT *currentValue) override;
78
79 // Sets the value of this object to the given number.
80 STDMETHOD(setCurrentValue)(VARIANT value) override;
81
82 // Returns the maximal value that can be represented by this object.
83 STDMETHOD(get_maximumValue)(VARIANT *maximumValue) override;
84
85 // Returns the minimal value that can be represented by this object.
86 STDMETHOD(get_minimumValue)(VARIANT *minimumValue) override;
87
88 // Override of IUNOXWrapper.
89 STDMETHOD(put_XInterface)(hyper pXInterface) override;
90
91private:
92
93 css::uno::Reference<css::accessibility::XAccessibleValue> pRXVal;
94
95 css::accessibility::XAccessibleValue* GetXInterface()
96 {
97 return pRXVal.get();
98 }
99
100};
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CAccValue implements IAccessibleValue interface.
Definition: AccValue.h:36
STDMETHOD() setCurrentValue(VARIANT value) override
Set current value.
Definition: AccValue.cxx:69
virtual ~CAccValue()
Definition: AccValue.h:41
STDMETHOD() get_maximumValue(VARIANT *maximumValue) override
Get maximum value.
Definition: AccValue.cxx:151
STDMETHOD() get_minimumValue(VARIANT *minimumValue) override
Get minimum value.
Definition: AccValue.cxx:180
CAccValue()
Definition: AccValue.h:38
STDMETHOD() get_currentValue(VARIANT *currentValue) override
Get current value.
Definition: AccValue.cxx:39
STDMETHOD() put_XInterface(hyper pXInterface) override
Put valid UNO interface into com class.
Definition: AccValue.cxx:209
static HRESULT WINAPI SmartQI_(void *pv, REFIID iid, void **ppvObject, DWORD_PTR)
Definition: AccValue.h:58
css::accessibility::XAccessibleValue * GetXInterface()
Definition: AccValue.h:95
HRESULT SmartQI(REFIID iid, void **ppvObject)
Definition: AccValue.h:64
css::uno::Reference< css::accessibility::XAccessibleValue > pRXVal
Definition: AccValue.h:93
CUNOXWrapper implements IUNOXWrapper interface.
Definition: UNOXWrapper.h:32
This interface gives access to a single numerical value.
VARIANT maximumValue
Returns the maximal value that can be represented by this object.
VARIANT minimumValue
Returns the minimal value that can be represented by this object.
VARIANT currentValue
Returns the value of this object as a number.