1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #include "AccessibilityOptTest.hxx" 29*cdf0e10cSrcweir #include "configitems/accessibilityoptions_const.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 32*cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <comphelper/configurationhelper.hxx> 35*cdf0e10cSrcweir #include <unotools/processfactory.hxx> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir namespace css = ::com::sun::star; 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir AccessibilityOptTest::AccessibilityOptTest() 40*cdf0e10cSrcweir { 41*cdf0e10cSrcweir m_xCfg = css::uno::Reference< css::container::XNameAccess >( 42*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::openConfig( 43*cdf0e10cSrcweir ::utl::getProcessServiceFactory(), 44*cdf0e10cSrcweir s_sAccessibility, 45*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::E_STANDARD), 46*cdf0e10cSrcweir css::uno::UNO_QUERY); 47*cdf0e10cSrcweir } 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir AccessibilityOptTest::~AccessibilityOptTest() 50*cdf0e10cSrcweir { 51*cdf0e10cSrcweir if (m_xCfg.is()) 52*cdf0e10cSrcweir m_xCfg.clear(); 53*cdf0e10cSrcweir } 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir //============================================================================= 56*cdf0e10cSrcweir //test GetAutoDetectSystemHC() 57*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetAutoDetectSystemHC() 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 60*cdf0e10cSrcweir sal_Bool bAutoDetectSystemHC; 61*cdf0e10cSrcweir sal_Bool bAutoDetectSystemHC_; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir bAutoDetectSystemHC = aAccessibilityOpt.GetAutoDetectSystemHC(); 64*cdf0e10cSrcweir xSet->setPropertyValue( s_sAutoDetectSystemHC, css::uno::makeAny(bAutoDetectSystemHC ? sal_False:sal_True) ); 65*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 66*cdf0e10cSrcweir bAutoDetectSystemHC_ = aAccessibilityOpt.GetAutoDetectSystemHC(); 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will not throw error 69*cdf0e10cSrcweir throw css::uno::RuntimeException( 70*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetAutoDetectSystemHC() error!")), 0); 71*cdf0e10cSrcweir } 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir //============================================================================= 74*cdf0e10cSrcweir //test GetIsForPagePreviews() 75*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsForPagePreviews() 76*cdf0e10cSrcweir { 77*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 78*cdf0e10cSrcweir sal_Bool bIsForPagePreviews ; 79*cdf0e10cSrcweir sal_Bool bIsForPagePreviews_; 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir bIsForPagePreviews = aAccessibilityOpt.GetIsForPagePreviews(); 82*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsForPagePreviews, css::uno::makeAny(bIsForPagePreviews ? sal_False:sal_True) ); 83*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 84*cdf0e10cSrcweir bIsForPagePreviews_ = aAccessibilityOpt.GetIsForPagePreviews(); 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will not throw error 87*cdf0e10cSrcweir throw css::uno::RuntimeException( 88*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsForPagePreviews() error!")), 0); 89*cdf0e10cSrcweir } 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir //============================================================================= 92*cdf0e10cSrcweir //test impl_checkGetIsHelpTipsDisappear() 93*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsHelpTipsDisappear() 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 96*cdf0e10cSrcweir sal_Bool bIsHelpTipsDisappear ; 97*cdf0e10cSrcweir sal_Bool bIsHelpTipsDisappear_; 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir bIsHelpTipsDisappear = aAccessibilityOpt.GetIsHelpTipsDisappear(); 100*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsHelpTipsDisappear, css::uno::makeAny(bIsHelpTipsDisappear ? sal_False:sal_True) ); 101*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 102*cdf0e10cSrcweir bIsHelpTipsDisappear_ = aAccessibilityOpt.GetIsHelpTipsDisappear(); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will not throw error 105*cdf0e10cSrcweir throw css::uno::RuntimeException( 106*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsHelpTipsDisappear() error!")), 0); 107*cdf0e10cSrcweir } 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir //============================================================================= 110*cdf0e10cSrcweir //test impl_checkGetIsAllowAnimatedGraphics() 111*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAllowAnimatedGraphics() 112*cdf0e10cSrcweir { 113*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 114*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedGraphics ; 115*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedGraphics_; 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir bIsAllowAnimatedGraphics = aAccessibilityOpt.GetIsAllowAnimatedGraphics(); 118*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsAllowAnimatedGraphics, css::uno::makeAny(bIsAllowAnimatedGraphics ? sal_False:sal_True) ); 119*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 120*cdf0e10cSrcweir bIsAllowAnimatedGraphics_ = aAccessibilityOpt.GetIsAllowAnimatedGraphics(); 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will not throw error 123*cdf0e10cSrcweir throw css::uno::RuntimeException( 124*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedGraphics() error!")), 0); 125*cdf0e10cSrcweir } 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir //============================================================================= 128*cdf0e10cSrcweir //test impl_checkGetIsAllowAnimatedText() 129*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAllowAnimatedText() 130*cdf0e10cSrcweir { 131*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 132*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedText ; 133*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedText_; 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir bIsAllowAnimatedText = aAccessibilityOpt.GetIsAllowAnimatedText(); 136*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsAllowAnimatedText, css::uno::makeAny(bIsAllowAnimatedText ? sal_False:sal_True) ); 137*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 138*cdf0e10cSrcweir bIsAllowAnimatedText_ = aAccessibilityOpt.GetIsAllowAnimatedText(); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will not throw error 141*cdf0e10cSrcweir throw css::uno::RuntimeException( 142*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedText() error!")), 0); 143*cdf0e10cSrcweir } 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir //============================================================================= 146*cdf0e10cSrcweir //test impl_checkGetIsAutomaticFontColor() 147*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsAutomaticFontColor() 148*cdf0e10cSrcweir { 149*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 150*cdf0e10cSrcweir sal_Bool bIsAutomaticFontColor ; 151*cdf0e10cSrcweir sal_Bool bIsAutomaticFontColor_; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir bIsAutomaticFontColor = aAccessibilityOpt.GetIsAutomaticFontColor(); 154*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsAutomaticFontColor, css::uno::makeAny(bIsAutomaticFontColor ? sal_False:sal_True) ); 155*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 156*cdf0e10cSrcweir bIsAutomaticFontColor_ = aAccessibilityOpt.GetIsAutomaticFontColor(); 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will not throw error 159*cdf0e10cSrcweir throw css::uno::RuntimeException( 160*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAutomaticFontColor() error!")), 0); 161*cdf0e10cSrcweir } 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir //============================================================================= 164*cdf0e10cSrcweir //test impl_checkGetIsSystemFont() 165*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetIsSystemFont() 166*cdf0e10cSrcweir { 167*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 168*cdf0e10cSrcweir sal_Bool bIsSystemFont ; 169*cdf0e10cSrcweir sal_Bool bIsSystemFont_; 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir bIsSystemFont = aAccessibilityOpt.GetIsSystemFont(); 172*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsSystemFont, css::uno::makeAny(bIsSystemFont ? sal_False:sal_True) ); 173*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 174*cdf0e10cSrcweir bIsSystemFont_ = aAccessibilityOpt.GetIsSystemFont(); 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir if ( bIsSystemFont_ == bIsSystemFont )//old config item will not throw error 177*cdf0e10cSrcweir throw css::uno::RuntimeException( 178*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsSystemFont() error!")), 0); 179*cdf0e10cSrcweir } 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir //============================================================================= 182*cdf0e10cSrcweir //test impl_checkGetHelpTipSeconds() 183*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkGetHelpTipSeconds() 184*cdf0e10cSrcweir { 185*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 186*cdf0e10cSrcweir sal_Int16 nHelpTipSeconds ; 187*cdf0e10cSrcweir sal_Int16 nHelpTipSeconds_; 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir nHelpTipSeconds = aAccessibilityOpt.GetHelpTipSeconds(); 190*cdf0e10cSrcweir xSet->setPropertyValue( s_sHelpTipSeconds, css::uno::makeAny(sal_Int16(nHelpTipSeconds+1)) ); 191*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 192*cdf0e10cSrcweir nHelpTipSeconds_ = aAccessibilityOpt.GetHelpTipSeconds(); 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will not throw error 195*cdf0e10cSrcweir throw css::uno::RuntimeException( 196*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetHelpTipSeconds() error!")), 0); 197*cdf0e10cSrcweir } 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir //============================================================================= 200*cdf0e10cSrcweir //test impl_checkIsSelectionInReadonly() 201*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkIsSelectionInReadonly() 202*cdf0e10cSrcweir { 203*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 204*cdf0e10cSrcweir sal_Bool bIsSelectionInReadonly ; 205*cdf0e10cSrcweir sal_Bool bIsSelectionInReadonly_; 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir bIsSelectionInReadonly = aAccessibilityOpt.IsSelectionInReadonly(); 208*cdf0e10cSrcweir xSet->setPropertyValue( s_sIsSelectionInReadonly, css::uno::makeAny(bIsSelectionInReadonly ? sal_False:sal_True) ); 209*cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg); 210*cdf0e10cSrcweir bIsSelectionInReadonly_ = aAccessibilityOpt.IsSelectionInReadonly(); 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will not throw error 213*cdf0e10cSrcweir throw css::uno::RuntimeException( 214*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsSelectionInReadonly() error!")), 0); 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir //============================================================================= 218*cdf0e10cSrcweir //test SetAutoDetectSystemHC() 219*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetAutoDetectSystemHC() 220*cdf0e10cSrcweir { 221*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 222*cdf0e10cSrcweir sal_Bool bAutoDetectSystemHC; 223*cdf0e10cSrcweir sal_Bool bAutoDetectSystemHC_; 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC; 226*cdf0e10cSrcweir aAccessibilityOpt.SetAutoDetectSystemHC( bAutoDetectSystemHC ? sal_False:sal_True ); 227*cdf0e10cSrcweir xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC_; 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will throw error 230*cdf0e10cSrcweir throw css::uno::RuntimeException( 231*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetAutoDetectSystemHC() error!")), 0); 232*cdf0e10cSrcweir } 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir //============================================================================= 235*cdf0e10cSrcweir //test SetIsForPagePreviews() 236*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsForPagePreviews() 237*cdf0e10cSrcweir { 238*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 239*cdf0e10cSrcweir sal_Bool bIsForPagePreviews ; 240*cdf0e10cSrcweir sal_Bool bIsForPagePreviews_; 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews; 243*cdf0e10cSrcweir aAccessibilityOpt.SetIsForPagePreviews( bIsForPagePreviews ? sal_False:sal_True ); 244*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews_; 245*cdf0e10cSrcweir 246*cdf0e10cSrcweir if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will throw error 247*cdf0e10cSrcweir throw css::uno::RuntimeException( 248*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsForPagePreviews() error!")), 0); 249*cdf0e10cSrcweir } 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir //============================================================================= 252*cdf0e10cSrcweir //test impl_checkSetIsHelpTipsDisappear() 253*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsHelpTipsDisappear() 254*cdf0e10cSrcweir { 255*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 256*cdf0e10cSrcweir sal_Bool bIsHelpTipsDisappear ; 257*cdf0e10cSrcweir sal_Bool bIsHelpTipsDisappear_; 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear; 260*cdf0e10cSrcweir aAccessibilityOpt.SetIsHelpTipsDisappear( bIsHelpTipsDisappear ? sal_False:sal_True ); 261*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear_; 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will throw error 264*cdf0e10cSrcweir throw css::uno::RuntimeException( 265*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsHelpTipsDisappear() error!")), 0); 266*cdf0e10cSrcweir } 267*cdf0e10cSrcweir 268*cdf0e10cSrcweir //============================================================================= 269*cdf0e10cSrcweir //test impl_checkSetIsAllowAnimatedGraphics() 270*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAllowAnimatedGraphics() 271*cdf0e10cSrcweir { 272*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 273*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedGraphics ; 274*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedGraphics_; 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics; 277*cdf0e10cSrcweir aAccessibilityOpt.SetIsAllowAnimatedGraphics( bIsAllowAnimatedGraphics ? sal_False:sal_True ); 278*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics_; 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will throw error 281*cdf0e10cSrcweir throw css::uno::RuntimeException( 282*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedGraphics() error!")), 0); 283*cdf0e10cSrcweir } 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir //============================================================================= 286*cdf0e10cSrcweir //test impl_checkSetIsAllowAnimatedText() 287*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAllowAnimatedText() 288*cdf0e10cSrcweir { 289*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 290*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedText ; 291*cdf0e10cSrcweir sal_Bool bIsAllowAnimatedText_; 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText; 294*cdf0e10cSrcweir aAccessibilityOpt.SetIsAllowAnimatedText( bIsAllowAnimatedText ? sal_False:sal_True ); 295*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText_; 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will throw error 298*cdf0e10cSrcweir throw css::uno::RuntimeException( 299*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedText() error!")), 0); 300*cdf0e10cSrcweir } 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir //============================================================================= 303*cdf0e10cSrcweir //test impl_checkSetIsAutomaticFontColor() 304*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsAutomaticFontColor() 305*cdf0e10cSrcweir { 306*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 307*cdf0e10cSrcweir sal_Bool bIsAutomaticFontColor ; 308*cdf0e10cSrcweir sal_Bool bIsAutomaticFontColor_; 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor; 311*cdf0e10cSrcweir aAccessibilityOpt.SetIsAutomaticFontColor( bIsAutomaticFontColor ? sal_False:sal_True ); 312*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor_; 313*cdf0e10cSrcweir 314*cdf0e10cSrcweir if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will throw error 315*cdf0e10cSrcweir throw css::uno::RuntimeException( 316*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAutomaticFontColor() error!")), 0); 317*cdf0e10cSrcweir } 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir //============================================================================= 320*cdf0e10cSrcweir //test impl_checkSetIsSystemFont() 321*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetIsSystemFont() 322*cdf0e10cSrcweir { 323*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 324*cdf0e10cSrcweir sal_Bool bIsSystemFont ; 325*cdf0e10cSrcweir sal_Bool bIsSystemFont_; 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont; 328*cdf0e10cSrcweir aAccessibilityOpt.SetIsSystemFont( bIsSystemFont ? sal_False:sal_True ); 329*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont_; 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir if ( bIsSystemFont_ == bIsSystemFont )//old config item will throw error 332*cdf0e10cSrcweir throw css::uno::RuntimeException( 333*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsSystemFont() error!")), 0); 334*cdf0e10cSrcweir } 335*cdf0e10cSrcweir 336*cdf0e10cSrcweir //============================================================================= 337*cdf0e10cSrcweir //test impl_checkSetHelpTipSeconds() 338*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetHelpTipSeconds() 339*cdf0e10cSrcweir { 340*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 341*cdf0e10cSrcweir sal_Int16 nHelpTipSeconds ; 342*cdf0e10cSrcweir sal_Int16 nHelpTipSeconds_; 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds; 345*cdf0e10cSrcweir aAccessibilityOpt.SetHelpTipSeconds( sal_Int16(nHelpTipSeconds+1) ); 346*cdf0e10cSrcweir xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds_; 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will throw error 349*cdf0e10cSrcweir throw css::uno::RuntimeException( 350*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetHelpTipSeconds() error!")), 0); 351*cdf0e10cSrcweir } 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir //============================================================================= 354*cdf0e10cSrcweir //test impl_checkSetSelectionInReadonly() 355*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkSetSelectionInReadonly() 356*cdf0e10cSrcweir { 357*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); 358*cdf0e10cSrcweir sal_Bool bIsSelectionInReadonly ; 359*cdf0e10cSrcweir sal_Bool bIsSelectionInReadonly_; 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly; 362*cdf0e10cSrcweir aAccessibilityOpt.SetSelectionInReadonly( bIsSelectionInReadonly ? sal_False:sal_True ); 363*cdf0e10cSrcweir xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly_; 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will throw error 366*cdf0e10cSrcweir throw css::uno::RuntimeException( 367*cdf0e10cSrcweir ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSelectionInReadonly() error!")), 0); 368*cdf0e10cSrcweir } 369*cdf0e10cSrcweir 370*cdf0e10cSrcweir //============================================================================= 371*cdf0e10cSrcweir void AccessibilityOptTest::impl_checkAccessibilityOptions() 372*cdf0e10cSrcweir { 373*cdf0e10cSrcweir impl_checkGetAutoDetectSystemHC(); 374*cdf0e10cSrcweir impl_checkGetIsForPagePreviews(); 375*cdf0e10cSrcweir impl_checkGetIsHelpTipsDisappear(); 376*cdf0e10cSrcweir impl_checkGetIsAllowAnimatedGraphics(); 377*cdf0e10cSrcweir impl_checkGetIsAllowAnimatedText(); 378*cdf0e10cSrcweir impl_checkGetIsAutomaticFontColor(); 379*cdf0e10cSrcweir impl_checkGetIsSystemFont(); 380*cdf0e10cSrcweir impl_checkGetHelpTipSeconds(); 381*cdf0e10cSrcweir impl_checkIsSelectionInReadonly(); 382*cdf0e10cSrcweir 383*cdf0e10cSrcweir impl_checkSetAutoDetectSystemHC(); 384*cdf0e10cSrcweir impl_checkSetIsForPagePreviews(); 385*cdf0e10cSrcweir impl_checkSetIsHelpTipsDisappear(); 386*cdf0e10cSrcweir impl_checkSetIsAllowAnimatedGraphics(); 387*cdf0e10cSrcweir impl_checkSetIsAllowAnimatedText(); 388*cdf0e10cSrcweir impl_checkSetIsAutomaticFontColor(); 389*cdf0e10cSrcweir impl_checkSetIsSystemFont(); 390*cdf0e10cSrcweir impl_checkSetHelpTipSeconds(); 391*cdf0e10cSrcweir impl_checkSetSelectionInReadonly(); 392*cdf0e10cSrcweir } 393