diff -r 000000000000 -r 2f259fa3e83a commonuisupport/uikon/test/tStaticSettingsInit/staticsettingsinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commonuisupport/uikon/test/tStaticSettingsInit/staticsettingsinit.cpp Tue Feb 02 01:00:49 2010 +0200 @@ -0,0 +1,93 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalComponent - Internal Symbian test code +*/ + +#include +#include +#include +#include +#include + +#include "appfwk_test_utils.h" + +#include "Staticsettingsinit.hrh" + + + + +class CStaticSettingsInit : public CEikLibrary2 + { + public: + ~CStaticSettingsInit(); + + private: // from CEikLibrary + void InitializeL(); + CArrayFix* ResourceFileArrayL() const {return 0;}; + CArrayFix* ControlFactoryArrayL() const {return 0;} + }; + +CStaticSettingsInit::~CStaticSettingsInit() + { + } + +void CStaticSettingsInit::InitializeL() + { + // Whether we set the default focus/default parent to ETrue or EFalse + // depends on the presence of certain files on the C: drive + RSmlTestUtils utils; + User::LeaveIfError(utils.Connect()); + CleanupClosePushL(utils); + + _LIT(KFileFocus, "c:\\focus.txt"); + _LIT(KFileParent, "c:\\parent.txt"); + + TBool focusPresent = EFalse; + TBool parentPresent = EFalse; + + utils.IsFilePresent(KFileFocus, focusPresent); + utils.IsFilePresent(KFileParent, parentPresent); + + CleanupStack::PopAndDestroy(&utils); + + // If the focus file exists the default will be non focusing + CCoeControlStaticSettings::SetFocusedByDefaultL(!focusPresent); + + // If the parent file exits, the default will be to set the parent + CCoeControlStaticSettings::SetParentByDefaultL(parentPresent); + } + +CEikLibrary* NewLibraryL() + { + CStaticSettingsInit* initDlls = new (ELeave) CStaticSettingsInit(); + + return initDlls; + } + +//Adding ECOM SUPPORT + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KStaticSettImplUid, NewLibraryL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ; + return ImplementationTable; + }