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 #include "T_DataWsGraphicFrameRate.h" |
|
19 |
|
20 /*@{*/ |
|
21 /// Commands |
|
22 _LIT(KCmdnew, "new"); |
|
23 |
|
24 /// Logging |
|
25 _LIT(KLogError, "Error=%d"); |
|
26 /*@}*/ |
|
27 |
|
28 ////////////////////////////////////////////////////////////////////// |
|
29 // Construction/Destruction |
|
30 ////////////////////////////////////////////////////////////////////// |
|
31 |
|
32 CT_DataWsGraphicFrameRate::CT_DataWsGraphicFrameRate() |
|
33 : CT_DataWsGraphicMsgFixedBase() |
|
34 , iWsGraphicFrameRate(NULL) |
|
35 { |
|
36 } |
|
37 |
|
38 CT_DataWsGraphicFrameRate::~CT_DataWsGraphicFrameRate() |
|
39 { |
|
40 DestroyData(); |
|
41 } |
|
42 |
|
43 void CT_DataWsGraphicFrameRate::DestroyData() |
|
44 { |
|
45 delete iWsGraphicFrameRate; |
|
46 iWsGraphicFrameRate=NULL; |
|
47 } |
|
48 |
|
49 /** |
|
50 * Return a pointer to the object that the data wraps |
|
51 * |
|
52 * @return pointer to the object that the data wraps |
|
53 */ |
|
54 TAny* CT_DataWsGraphicFrameRate::GetObject() |
|
55 { |
|
56 return iWsGraphicFrameRate; |
|
57 } |
|
58 |
|
59 TWsGraphicMsgFixedBase* CT_DataWsGraphicFrameRate::GetWsGraphicMsgFixedBase() const |
|
60 { |
|
61 return iWsGraphicFrameRate; |
|
62 } |
|
63 |
|
64 /** |
|
65 * Process a command read from the ini file |
|
66 * |
|
67 * @param aCommand the command to process |
|
68 * @param aSection the entry in the ini file requiring the command to be processed |
|
69 * @param aAsyncErrorIndex index of command. used for async calls |
|
70 * |
|
71 * @return ETrue if the command is processed |
|
72 */ |
|
73 TBool CT_DataWsGraphicFrameRate::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex) |
|
74 { |
|
75 TBool ret=ETrue; |
|
76 |
|
77 if ( aCommand==KCmdnew ) |
|
78 { |
|
79 DoCmdnew(); |
|
80 } |
|
81 else |
|
82 { |
|
83 ret=CT_DataWsGraphicMsgFixedBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex); |
|
84 } |
|
85 |
|
86 return ret; |
|
87 } |
|
88 |
|
89 void CT_DataWsGraphicFrameRate::DoCmdnew() |
|
90 { |
|
91 INFO_PRINTF1(_L("execute new")); |
|
92 DestroyData(); |
|
93 TRAPD(err, iWsGraphicFrameRate=new (ELeave) TWsGraphicFrameRate()); |
|
94 if ( err!=KErrNone ) |
|
95 { |
|
96 ERR_PRINTF2(KLogError, err); |
|
97 SetError(err); |
|
98 } |
|
99 } |
|