|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DATA_WRAPPER_BASE_H |
|
20 #define DATA_WRAPPER_BASE_H |
|
21 |
|
22 // EPOC includes |
|
23 #include <datawrapper.h> |
|
24 #define SECS_TO_MS(x) (x*1000000) |
|
25 |
|
26 _LIT(KConsname, "Test Console"); |
|
27 |
|
28 class CDataWrapperBase : public CDataWrapper |
|
29 { |
|
30 public: |
|
31 class TEnumEntryTable |
|
32 { |
|
33 public: |
|
34 const TDesC& iString; |
|
35 TInt iValue; |
|
36 }; |
|
37 |
|
38 public: |
|
39 TBool GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult); |
|
40 TBool GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult); |
|
41 TBool GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult); |
|
42 TBool GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult); |
|
43 TBool GetUintFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUint& aResult); |
|
44 TBool GetArrayRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, RPointerArray<HBufC>& aResult); |
|
45 TBool KeyPress(); |
|
46 void Timedelay(TInt aTimeoutInSecs); |
|
47 virtual void InitialiseL(); |
|
48 inline RFs& FileServer() { return iFs; } |
|
49 inline CConsoleBase* GetConsole() { return(Console::NewL(KConsname,TSize(KConsFullScreen,KConsFullScreen)));} |
|
50 TBool GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, const TEnumEntryTable* aTable, TInt& aResult); |
|
51 |
|
52 protected: |
|
53 CDataWrapperBase(); |
|
54 virtual ~CDataWrapperBase(); |
|
55 |
|
56 private: |
|
57 TBool GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult); |
|
58 TBool KeyCheck(); |
|
59 |
|
60 private: |
|
61 // Included ini files |
|
62 RPointerArray<CIniData> iInclude; |
|
63 RPointerArray<HBufC> iBuffer; |
|
64 RFs iFs; |
|
65 RTimer iTimer; |
|
66 }; |
|
67 |
|
68 #endif // DATA_WRAPPER_BASE_H |