|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #include <coecntrl.h> |
|
22 #include <coecntss.h> |
|
23 #include <eiklibry.h> |
|
24 #include <ecom/ecom.h> |
|
25 #include <ecom/implementationproxy.h> |
|
26 |
|
27 #include "appfwk_test_utils.h" |
|
28 |
|
29 #include "Staticsettingsinit.hrh" |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 class CStaticSettingsInit : public CEikLibrary2 |
|
35 { |
|
36 public: |
|
37 ~CStaticSettingsInit(); |
|
38 |
|
39 private: // from CEikLibrary |
|
40 void InitializeL(); |
|
41 CArrayFix<TFileName>* ResourceFileArrayL() const {return 0;}; |
|
42 CArrayFix<TCreateByTypeFunction>* ControlFactoryArrayL() const {return 0;} |
|
43 }; |
|
44 |
|
45 CStaticSettingsInit::~CStaticSettingsInit() |
|
46 { |
|
47 } |
|
48 |
|
49 void CStaticSettingsInit::InitializeL() |
|
50 { |
|
51 // Whether we set the default focus/default parent to ETrue or EFalse |
|
52 // depends on the presence of certain files on the C: drive |
|
53 RSmlTestUtils utils; |
|
54 User::LeaveIfError(utils.Connect()); |
|
55 CleanupClosePushL(utils); |
|
56 |
|
57 _LIT(KFileFocus, "c:\\focus.txt"); |
|
58 _LIT(KFileParent, "c:\\parent.txt"); |
|
59 |
|
60 TBool focusPresent = EFalse; |
|
61 TBool parentPresent = EFalse; |
|
62 |
|
63 utils.IsFilePresent(KFileFocus, focusPresent); |
|
64 utils.IsFilePresent(KFileParent, parentPresent); |
|
65 |
|
66 CleanupStack::PopAndDestroy(&utils); |
|
67 |
|
68 // If the focus file exists the default will be non focusing |
|
69 CCoeControlStaticSettings::SetFocusedByDefaultL(!focusPresent); |
|
70 |
|
71 // If the parent file exits, the default will be to set the parent |
|
72 CCoeControlStaticSettings::SetParentByDefaultL(parentPresent); |
|
73 } |
|
74 |
|
75 CEikLibrary* NewLibraryL() |
|
76 { |
|
77 CStaticSettingsInit* initDlls = new (ELeave) CStaticSettingsInit(); |
|
78 |
|
79 return initDlls; |
|
80 } |
|
81 |
|
82 //Adding ECOM SUPPORT |
|
83 |
|
84 const TImplementationProxy ImplementationTable[] = |
|
85 { |
|
86 IMPLEMENTATION_PROXY_ENTRY(KStaticSettImplUid, NewLibraryL) |
|
87 }; |
|
88 |
|
89 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
90 { |
|
91 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ; |
|
92 return ImplementationTable; |
|
93 } |