Kaydet (Commit) 28ee890d authored tarafından Caolán McNamara's avatar Caolán McNamara

dead helper dir

üst 2452e28a
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SVTOOLS_ACCESSIBILITYOPTTEST_HXX
#define SVTOOLS_ACCESSIBILITYOPTTEST_HXX
#include <com/sun/star/container/XNameAccess.hpp>
#include <svl/accessibilityoptions.hxx>
namespace css = ::com::sun::star;
class AccessibilityOptTest
{
public:
AccessibilityOptTest();
~AccessibilityOptTest();
void impl_checkAccessibilityOptions();
private:
void impl_checkGetAutoDetectSystemHC();
void impl_checkGetIsForPagePreviews();
void impl_checkGetIsHelpTipsDisappear();
void impl_checkGetIsAllowAnimatedGraphics();
void impl_checkGetIsAllowAnimatedText();
void impl_checkGetIsAutomaticFontColor();
void impl_checkGetIsSystemFont();
void impl_checkGetHelpTipSeconds();
void impl_checkIsSelectionInReadonly();
void impl_checkSetAutoDetectSystemHC();
void impl_checkSetIsForPagePreviews();
void impl_checkSetIsHelpTipsDisappear();
void impl_checkSetIsAllowAnimatedGraphics();
void impl_checkSetIsAllowAnimatedText();
void impl_checkSetIsAutomaticFontColor();
void impl_checkSetIsSystemFont();
void impl_checkSetHelpTipSeconds();
void impl_checkSetSelectionInReadonly();
private:
css::uno::Reference< css::container::XNameAccess > m_xCfg;
SvtAccessibilityOptions aAccessibilityOpt;
};
#endif // #ifndef SVTOOLS_ACCESSIBILITYOPTTEST_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include "HistoryOptTest.hxx"
// #include "AccessibilityOptTest.hxx"
// #include "PrintOptTest.hxx"
#include "UserOptTest.hxx"
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/task/XJob.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implementationentry.hxx>
//=============================================================================
namespace css = ::com::sun::star;
namespace svl{
//=============================================================================
static const ::rtl::OUString PROP_TEST (RTL_CONSTASCII_USTRINGPARAM("Test"));
static const ::rtl::OUString TEST_PICKLIST (RTL_CONSTASCII_USTRINGPARAM("checkPicklist"));
static const ::rtl::OUString TEST_URLHISTORY (RTL_CONSTASCII_USTRINGPARAM("checkURLHistory"));
static const ::rtl::OUString TEST_HELPBOOKMARKS (RTL_CONSTASCII_USTRINGPARAM("checkHelpBookmarks"));
static const ::rtl::OUString TEST_USEROPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkUserOptions"));
//=============================================================================
class ConfigItemTest : public ::cppu::WeakImplHelper2< css::task::XJob ,
css::lang::XServiceInfo >
{
//-------------------------------------------------------------------------
// interface
public:
explicit ConfigItemTest(const css::uno::Reference< css::uno::XComponentContext >& xContext);
// css::task::XJob
virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue >& lArguments)
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception );
// css::lang::XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString& sServiceName)
throw (css::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException);
//-------------------------------------------------------------------------
// internal
private:
ConfigItemTest(ConfigItemTest &); // not defined
virtual ~ConfigItemTest() {}
void operator=(ConfigItemTest &); // not defined
//-------------------------------------------------------------------------
// helper for registration !
public:
static ::rtl::OUString SAL_CALL st_getImplementationName();
static css::uno::Sequence< ::rtl::OUString > SAL_CALL st_getSupportedServiceNames();
static css::uno::Reference< css::uno::XInterface > SAL_CALL st_create(const css::uno::Reference< css::uno::XComponentContext >& XContext);
//-------------------------------------------------------------------------
// member
private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
//=============================================================================
ConfigItemTest::ConfigItemTest(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: m_xContext(xContext)
{}
//=============================================================================
// css::task::XJob
css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::beans::NamedValue >& lArguments)
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception )
{
::rtl::OUString sTest;
::sal_Int32 i = 0;
::sal_Int32 c = lArguments.getLength();
for (i=0; i<c; ++i)
{
const css::beans::NamedValue& rArg = lArguments[0];
if (rArg.Name.equals(PROP_TEST))
rArg.Value >>= sTest;
}
if (sTest.equals(TEST_PICKLIST))
{
HistoryOptTest aOptTest;
aOptTest.checkPicklist();
}
else if (sTest.equals(TEST_URLHISTORY))
{
HistoryOptTest aOptTest;
aOptTest.checkURLHistory();
}
else if (sTest.equals(TEST_HELPBOOKMARKS))
{
HistoryOptTest aOptTest;
aOptTest.checkHelpBookmarks();
}
// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS))
// {
// AccessibilityOptTest aOptTest;
// aOptTest.impl_checkAccessibilityOptions();
// }
// else if (sTest.equals(TEST_PRINTOPTIONS))
// {
// PrintOptTest aOptTest;
// aOptTest.impl_checkPrint();
// }
else if (sTest.equals(TEST_USEROPTIONS))
{
UserOptTest aOptTest;
aOptTest.impl_checkUserData();
}
return css::uno::Any();
}
//=============================================================================
// com::sun::star::uno::XServiceInfo
::rtl::OUString SAL_CALL ConfigItemTest::getImplementationName()
throw (css::uno::RuntimeException)
{
return ConfigItemTest::st_getImplementationName();
}
//=============================================================================
// com::sun::star::uno::XServiceInfo
::sal_Bool SAL_CALL ConfigItemTest::supportsService(const ::rtl::OUString& sServiceName)
throw (css::uno::RuntimeException)
{
css::uno::Sequence< ::rtl::OUString > lServiceNames = ConfigItemTest::st_getSupportedServiceNames();
for (::sal_Int32 i = 0; i < lServiceNames.getLength(); ++i)
{
if (lServiceNames[i].equals(sServiceName))
return sal_True;
}
return sal_False;
}
//=============================================================================
// com::sun::star::uno::XServiceInfo
css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::getSupportedServiceNames()
throw (css::uno::RuntimeException)
{
return ConfigItemTest::st_getSupportedServiceNames();
}
//=============================================================================
::rtl::OUString SAL_CALL ConfigItemTest::st_getImplementationName()
{
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.svl.ConfigItemTest"));
}
//=============================================================================
css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::st_getSupportedServiceNames()
{
css::uno::Sequence< ::rtl::OUString > lServices(1);
lServices[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.test.ConfigItems"));
return lServices;
}
//=============================================================================
css::uno::Reference< css::uno::XInterface > SAL_CALL ConfigItemTest::st_create(const css::uno::Reference< css::uno::XComponentContext >& xContext)
{
ConfigItemTest* pObject = new ConfigItemTest(xContext);
css::uno::Reference< css::uno::XInterface > xObject (static_cast< ::cppu::OWeakObject* >(pObject));
return xObject;
}
} // namespace svl
//=============================================================================
static ::cppu::ImplementationEntry const lRegEntries[] =
{
{
&::svl::ConfigItemTest::st_create,
&::svl::ConfigItemTest::st_getImplementationName,
&::svl::ConfigItemTest::st_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0
},
{ 0, 0, 0, 0, 0, 0 }
};
//=============================================================================
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const char* sImplName ,
void* pServiceManager,
void* pRegistryKey )
{
return ::cppu::component_getFactoryHelper(sImplName, pServiceManager, pRegistryKey, lRegEntries);
}
//=============================================================================
extern "C" sal_Bool SAL_CALL component_writeInfo(void* pServiceManager,
void* pRegistryKey )
{
return ::cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, lRegEntries);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SVTOOLS_HISTORYOPTTEST_HXX
#define SVTOOLS_HISTORYOPTTEST_HXX
#include <com/sun/star/container/XNameAccess.hpp>
#include <unotools/historyoptions.hxx>
namespace css = ::com::sun::star;
class HistoryOptTest
{
public:
HistoryOptTest();
virtual ~HistoryOptTest();
//---------------------------------------------------------------------
/** unit test of picklist */
void checkPicklist();
//---------------------------------------------------------------------
/** unit test of URL list */
void checkURLHistory();
//---------------------------------------------------------------------
/** unit test of Help bookmarks */
void checkHelpBookmarks();
private:
//---------------------------------------------------------------------
/** test every well known history list in the same way.
* Only the count of created and tested items can be defined from outside
* e.g. usefull for stress tests.
*
* @param eHistory
* specify the history list for testing.
*
* @param nMaxItems
* max count of new created and tested history items.
*/
void impl_testHistory(EHistoryType eHistory ,
::sal_Int32 nMaxItems);
//---------------------------------------------------------------------
/** try to clear the whole list and check the results.
* If list could not be cleared successfully an exception is thrown.
*/
void impl_clearList();
//---------------------------------------------------------------------
/** define a new size for the current list and check the results.
* Note: The given size must match against the defined constraints.
* That must be checked before this method is called.
*
* @param nSize
* the new size.
*/
void impl_setSize(::sal_Int32 nSize);
//---------------------------------------------------------------------
/** create a new item (means it's properties using a special schema using the
* item id).
*
* Note: This method does not check if creation was successfully.
* Therefore exists more specialized method impl_existsItem()
* and impl_existsItemAtPosition().
*
* @param nItem
* id of the item
*/
void impl_appendItem(::sal_Int32 nItem);
//---------------------------------------------------------------------
/** check if an entry for given item id realy exists (in memory and xcu file).
*
* @param nItem
* id of the item
*
* @return true if item exists - false otherwise.
*/
::sal_Bool impl_existsItem(::sal_Int32 nItem);
//---------------------------------------------------------------------
/** check if an entry for given item id realy exists (in memory and xcu file).
* Further it checks if the requested item is placed at the also specified
* position inside history list.
*
* @param nItem
* id of the item
*
* @param nIndex
* expected position of item inside history list.
*
* @return true if item exists at right position - false otherwise.
*/
::sal_Bool impl_existsItemAtIndex(::sal_Int32 nItem ,
::sal_Int32 nIndex);
//---------------------------------------------------------------------
/** create an URL suitable for the given item id.
*
* @param nItem
* id of the item
*
* @return the new created URL.
*/
::rtl::OUString impl_createItemURL(::sal_Int32 nItem);
//---------------------------------------------------------------------
/** create a title suitable for the given item id.
*
* @param nItem
* id of the item
*
* @return the new created title.
*/
::rtl::OUString impl_createItemTitle(::sal_Int32 nItem);
//---------------------------------------------------------------------
/** create a password suitable for the given item id.
*
* @param nItem
* id of the item
*
* @return the new created password.
*/
::rtl::OUString impl_createItemPassword(::sal_Int32 nItem);
//---------------------------------------------------------------------
/** returns direct access to the item list inside histories.xcu
* suitable for the current defined list type (m_eList).
*
* @return reference to the item list configuration
*/
css::uno::Reference< css::container::XNameAccess > impl_getItemList();
//---------------------------------------------------------------------
/** returns direct access to the order list inside histories.xcu
* suitable for the current defined list type (m_eList).
*
* @return reference to the order list configuration
*/
css::uno::Reference< css::container::XNameAccess > impl_getOrderList();
//---------------------------------------------------------------------
/** returns direct access to the history list inside histories.xcu
* suitable for the current defined list type (m_eList).
*
* @return reference to the history list configuration
*/
css::uno::Reference< css::container::XNameAccess > impl_getNewHistory();
//---------------------------------------------------------------------
/** returns direct access to the history config inside common.xcu
* suitable for the current defined list type (m_eList).
*
* @return reference to the history configuration
*/
css::uno::Reference< css::container::XNameAccess > impl_getOldHistory();
private:
// the config item which should be tested here
SvtHistoryOptions m_aConfigItem;
// defines the special list for testing (picklist, history or url list)
EHistoryType m_eList;
// underlying configuration of the tested config items for cross over checks
css::uno::Reference< css::container::XNameAccess > m_xHistoriesXCU;
// underlying configuration of the tested config items for cross over checks
css::uno::Reference< css::container::XNameAccess > m_xCommonXCU;
};
#endif // #ifndef SVTOOLS_HISTORYOPTTEST_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SVTOOLS_PRINTOPTTEST_HXX
#define SVTOOLS_PRINTOPTTEST_HXX
#include <com/sun/star/container/XNameAccess.hpp>
#include <svl/printoptions.hxx>
namespace css = ::com::sun::star;
class PrintOptTest
{
public:
PrintOptTest();
~PrintOptTest();
void impl_checkPrint();
private: //members
SvtPrinterOptions aPrintOpt;
css::uno::Reference< css::container::XNameAccess > m_xCfg;
css::uno::Reference< css::container::XNameAccess > m_xNode;
private: // methods
sal_Bool impl_IsReduceTransparency() const ;
void impl_SetReduceTransparency( sal_Bool bState ) ;
sal_Int16 impl_GetReducedTransparencyMode() const ;
void impl_SetReducedTransparencyMode( sal_Int16 nMode ) ;
sal_Bool impl_IsReduceGradients() const ;
void impl_SetReduceGradients( sal_Bool bState ) ;
sal_Int16 impl_GetReducedGradientMode() const ;
void impl_SetReducedGradientMode( sal_Int16 nMode ) ;
sal_Int16 impl_GetReducedGradientStepCount() const ;
void impl_SetReducedGradientStepCount( sal_Int16 nStepCount );
sal_Bool impl_IsReduceBitmaps() const ;
void impl_SetReduceBitmaps( sal_Bool bState ) ;
sal_Int16 impl_GetReducedBitmapMode() const ;
void impl_SetReducedBitmapMode( sal_Int16 nMode ) ;
sal_Int16 impl_GetReducedBitmapResolution() const ;
void impl_SetReducedBitmapResolution( sal_Int16 nResolution ) ;
sal_Bool impl_IsReducedBitmapIncludesTransparency() const ;
void impl_SetReducedBitmapIncludesTransparency( sal_Bool bState ) ;
sal_Bool impl_IsConvertToGreyscales() const;
void impl_SetConvertToGreyscales( sal_Bool bState ) ;
};
#endif // #ifndef SVTOOLS_PRINTOPTTEST_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SVTOOLS_USEROPTTEST_HXX
#define SVTOOLS_USEROPTTEST_HXX
#include <com/sun/star/container/XNameAccess.hpp>
#include <unotools/useroptions.hxx>
namespace css = ::com::sun::star;
class UserOptTest
{
public:
UserOptTest();
~UserOptTest();
void impl_checkUserData();
private:
void impl_checkSetCompany( const ::rtl::OUString& sUserData );
void impl_checkSetFirstName( const ::rtl::OUString& sUserData );
void impl_checkSetLastName( const ::rtl::OUString& sUserData );
void impl_checkSetID( const ::rtl::OUString& sUserData );
void impl_checkSetStreet( const ::rtl::OUString& sUserData );
void impl_checkSetCity( const ::rtl::OUString& sUserData );
void impl_checkSetState( const ::rtl::OUString& sUserData );
void impl_checkSetZip( const ::rtl::OUString& sUserData );
void impl_checkSetCountry( const ::rtl::OUString& sUserData );
void impl_checkSetPosition( const ::rtl::OUString& sUserData );
void impl_checkSetTitle( const ::rtl::OUString& sUserData );
void impl_checkSetTelephoneHome( const ::rtl::OUString& sUserData );
void impl_checkSetTelephoneWork( const ::rtl::OUString& sUserData );
void impl_checkSetFax( const ::rtl::OUString& sUserData );
void impl_checkSetEmail( const ::rtl::OUString& sUserData );
void impl_checkSetCustomerNumber( const ::rtl::OUString& sUserData );
void impl_checkSetFathersName( const ::rtl::OUString& sUserData );
void impl_checkSetApartment( const ::rtl::OUString& sUserData );
private:
SvtUserOptions m_aConfigItem;
css::uno::Reference< css::container::XNameAccess > m_xCfg;
};
#endif // #ifndef SVTOOLS_USEROPTTEST_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment