|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: Handle state changed events |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "BrCtlApiTestContainer.h" |
|
21 #include "BrCtlApiTestStateChangeObserver.h" |
|
22 |
|
23 // ================= MEMBER FUNCTIONS ======================= |
|
24 |
|
25 // --------------------------------------------------------- |
|
26 // CBrCtlApiTestStateChangeObserver::StateChanged |
|
27 // --------------------------------------------------------- |
|
28 // |
|
29 void |
|
30 CBrCtlApiTestStateChangeObserver::StateChanged(TBrCtlDefs::TBrCtlState /* aState */, |
|
31 TInt /* aValue */) |
|
32 { |
|
33 // Here we are creating a string to be displayed on the screen, but you would |
|
34 // implement this method to have code that would be executed when the observer |
|
35 // receives state changed events. |
|
36 TBuf16<256> tgt; |
|
37 TPoint point(0, 120); |
|
38 |
|
39 // _LIT(KHandleBrowserStateChange, "State Change event = %d, value = %d"); |
|
40 |
|
41 // tgt.AppendFormat(KHandleBrowserStateChange, aState, aValue); |
|
42 |
|
43 // iContainer->SetPoint(point); |
|
44 // iContainer->SetText(tgt); |
|
45 |
|
46 iContainer->DrawNow(); |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------- |
|
50 // CBrCtlApiTestStateChangeObserver::ConstructL |
|
51 // --------------------------------------------------------- |
|
52 // |
|
53 void |
|
54 CBrCtlApiTestStateChangeObserver::ConstructL(CBrCtlApiTestContainer* aContainer) |
|
55 { |
|
56 iContainer = aContainer; |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------- |
|
60 // CBrCtlApiTestStateChangeObserver::~CBrCtlApiTestStateChangeObserver |
|
61 // --------------------------------------------------------- |
|
62 // |
|
63 CBrCtlApiTestStateChangeObserver::~CBrCtlApiTestStateChangeObserver() |
|
64 { |
|
65 } |
|
66 |
|
67 |
|
68 // --------------------------------------------------------- |
|
69 // CBrCtlApiTestStateChangeObserver::NewL |
|
70 // --------------------------------------------------------- |
|
71 // |
|
72 CBrCtlApiTestStateChangeObserver* |
|
73 CBrCtlApiTestStateChangeObserver::NewL(CBrCtlApiTestContainer* aContainer) |
|
74 { |
|
75 CBrCtlApiTestStateChangeObserver* self = new(ELeave)CBrCtlApiTestStateChangeObserver; |
|
76 CleanupStack::PushL(self); |
|
77 self->ConstructL(aContainer); |
|
78 CleanupStack::Pop(); |
|
79 return self; |
|
80 } |
|
81 |
|
82 // End of File |
|
83 |