|
1 /* |
|
2 * Copyright (c) 2006 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: Editor indicator controller |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "CCAEditIndicator.h" |
|
22 #include "CCAMessageEditor.h" |
|
23 |
|
24 // CONSTANTS |
|
25 // 3000000(3 sec) is good enough time to view the edit indicator. |
|
26 // if the indicator display has to be more this value can be increased. |
|
27 const TInt KMsgIndicatorTimeOut = 3000000; |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CCAEditIndicator::CCAEditIndicator() |
|
31 // (other items were commented in a header). |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CCAEditIndicator::CCAEditIndicator( CCAMessageEditor& aEditor ) |
|
35 : CActive( 0 ), |
|
36 iEditor( aEditor ) |
|
37 { |
|
38 iTimer.CreateLocal(); |
|
39 CActiveScheduler::Add( this ); |
|
40 |
|
41 } |
|
42 |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CCAEditIndicator::NewL() |
|
46 // (other items were commented in a header). |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 CCAEditIndicator* CCAEditIndicator::NewL( CCAMessageEditor& aEditor ) |
|
50 |
|
51 { |
|
52 CCAEditIndicator* self = new( ELeave ) CCAEditIndicator( aEditor ); |
|
53 return self; |
|
54 } |
|
55 |
|
56 |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CCAEditIndicator::DoCancel() |
|
60 // (other items were commented in a header). |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 void CCAEditIndicator::DoCancel() |
|
64 { |
|
65 iTimer.Cancel(); |
|
66 } |
|
67 |
|
68 |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CCAEditIndicator::RunL() |
|
72 // (other items were commented in a header). |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 void CCAEditIndicator::RunL() |
|
76 { |
|
77 iEditor.HideIndicator(); |
|
78 |
|
79 iEditor.ReSetActiveObject(); |
|
80 iTimer.Cancel(); |
|
81 } |
|
82 |
|
83 |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CCAEditIndicator::~CCAEditIndicator() |
|
87 // (other items were commented in a header). |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 CCAEditIndicator::~CCAEditIndicator() |
|
91 { |
|
92 iEditor.ReSetActiveObject(); |
|
93 Cancel(); |
|
94 iTimer.Close(); |
|
95 } |
|
96 |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CCAEditIndicator::StartTimer() |
|
100 // (other items were commented in a header). |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 void CCAEditIndicator::StartTimer() |
|
104 { |
|
105 iEditor.SetActiveObject( this ); |
|
106 iEditor.ShowIndicator(); |
|
107 |
|
108 // 3000000(3 sec) is good enough time to view the edit indicator. |
|
109 // if the indicator display has to be more this value can be increased. |
|
110 iTimer.After( iStatus, TTimeIntervalMicroSeconds32( KMsgIndicatorTimeOut ) ); |
|
111 if ( !IsActive() ) |
|
112 { |
|
113 SetActive(); |
|
114 } |
|
115 } |
|
116 |
|
117 |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CCAEditIndicator::IsIndicatorActive() |
|
121 // (other items were commented in a header). |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 TBool CCAEditIndicator::IsIndicatorActive() |
|
125 { |
|
126 return IsActive(); |
|
127 } |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |