1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski #if !defined(AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_) 23*b1cdbd2cSJim Jagielski #define AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_ 24*b1cdbd2cSJim Jagielski 25*b1cdbd2cSJim Jagielski #if _MSC_VER > 1000 26*b1cdbd2cSJim Jagielski #pragma once 27*b1cdbd2cSJim Jagielski #endif // _MSC_VER > 1000 28*b1cdbd2cSJim Jagielski 29*b1cdbd2cSJim Jagielski #include "resource.h" // main symbols 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski 32*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/reference.hxx> 33*b1cdbd2cSJim Jagielski #include <com/sun/star/accessibility/XAccessibleValue.hpp> 34*b1cdbd2cSJim Jagielski #include "UNOXWrapper.h" 35*b1cdbd2cSJim Jagielski 36*b1cdbd2cSJim Jagielski /** 37*b1cdbd2cSJim Jagielski * CAccValue implements IAccessibleValue interface. 38*b1cdbd2cSJim Jagielski */ 39*b1cdbd2cSJim Jagielski class CAccValue : 40*b1cdbd2cSJim Jagielski public CComObjectRoot, 41*b1cdbd2cSJim Jagielski public CComCoClass<CAccValue,&CLSID_AccValue>, 42*b1cdbd2cSJim Jagielski public IAccessibleValue, 43*b1cdbd2cSJim Jagielski public CUNOXWrapper 44*b1cdbd2cSJim Jagielski { 45*b1cdbd2cSJim Jagielski public: CAccValue()46*b1cdbd2cSJim Jagielski CAccValue() 47*b1cdbd2cSJim Jagielski { 48*b1cdbd2cSJim Jagielski } ~CAccValue()49*b1cdbd2cSJim Jagielski virtual ~CAccValue() 50*b1cdbd2cSJim Jagielski { 51*b1cdbd2cSJim Jagielski } 52*b1cdbd2cSJim Jagielski 53*b1cdbd2cSJim Jagielski BEGIN_COM_MAP(CAccValue) COM_INTERFACE_ENTRY(IAccessibleValue)54*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY(IAccessibleValue) 55*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY(IUNOXWrapper) 56*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI) 57*b1cdbd2cSJim Jagielski END_COM_MAP() 58*b1cdbd2cSJim Jagielski 59*b1cdbd2cSJim Jagielski static HRESULT WINAPI _SmartQI(void* pv, 60*b1cdbd2cSJim Jagielski REFIID iid, void** ppvObject, DWORD) 61*b1cdbd2cSJim Jagielski { 62*b1cdbd2cSJim Jagielski return ((CAccValue*)pv)->SmartQI(iid,ppvObject); 63*b1cdbd2cSJim Jagielski } 64*b1cdbd2cSJim Jagielski SmartQI(REFIID iid,void ** ppvObject)65*b1cdbd2cSJim Jagielski HRESULT SmartQI(REFIID iid, void** ppvObject) 66*b1cdbd2cSJim Jagielski { 67*b1cdbd2cSJim Jagielski if( m_pOuterUnknown ) 68*b1cdbd2cSJim Jagielski return OuterQueryInterface(iid,ppvObject); 69*b1cdbd2cSJim Jagielski return E_FAIL; 70*b1cdbd2cSJim Jagielski } 71*b1cdbd2cSJim Jagielski 72*b1cdbd2cSJim Jagielski DECLARE_REGISTRY_RESOURCEID(IDR_AccValue) 73*b1cdbd2cSJim Jagielski 74*b1cdbd2cSJim Jagielski // IAccessibleValue 75*b1cdbd2cSJim Jagielski public: 76*b1cdbd2cSJim Jagielski // IAccessibleValue 77*b1cdbd2cSJim Jagielski 78*b1cdbd2cSJim Jagielski // Returns the value of this object as a number. 79*b1cdbd2cSJim Jagielski STDMETHOD(get_currentValue)(VARIANT *currentValue); 80*b1cdbd2cSJim Jagielski 81*b1cdbd2cSJim Jagielski // Sets the value of this object to the given number. 82*b1cdbd2cSJim Jagielski STDMETHOD(setCurrentValue)(VARIANT value); 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski // Returns the maximal value that can be represented by this object. 85*b1cdbd2cSJim Jagielski STDMETHOD(get_maximumValue)(VARIANT *maximumValue); 86*b1cdbd2cSJim Jagielski 87*b1cdbd2cSJim Jagielski // Returns the minimal value that can be represented by this object. 88*b1cdbd2cSJim Jagielski STDMETHOD(get_minimumValue)(VARIANT *mininumValue); 89*b1cdbd2cSJim Jagielski 90*b1cdbd2cSJim Jagielski // Overide of IUNOXWrapper. 91*b1cdbd2cSJim Jagielski STDMETHOD(put_XInterface)(long pXInterface); 92*b1cdbd2cSJim Jagielski 93*b1cdbd2cSJim Jagielski private: 94*b1cdbd2cSJim Jagielski 95*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleValue> pRXVal; 96*b1cdbd2cSJim Jagielski GetXInterface()97*b1cdbd2cSJim Jagielski inline com::sun::star::accessibility::XAccessibleValue* GetXInterface() 98*b1cdbd2cSJim Jagielski { 99*b1cdbd2cSJim Jagielski return pRXVal.get(); 100*b1cdbd2cSJim Jagielski } 101*b1cdbd2cSJim Jagielski 102*b1cdbd2cSJim Jagielski }; 103*b1cdbd2cSJim Jagielski 104*b1cdbd2cSJim Jagielski #endif // !defined(AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_) 105