25
|
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 "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: Implementation of CPhoneNote class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "cphonenote.h"
|
|
21 |
#include "phoneui.hrh"
|
|
22 |
#include <featmgr.h>
|
|
23 |
|
|
24 |
#include <eikcba.h>
|
|
25 |
|
|
26 |
// ================= MEMBER FUNCTIONS =======================
|
|
27 |
// C++ default constructor can NOT contain any code, that
|
|
28 |
// might leave.
|
|
29 |
//
|
|
30 |
CPhoneNote::CPhoneNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver ) :
|
|
31 |
CAknNoteDialog( aSelfPtr ),
|
|
32 |
iCommandObserver( aCommandObserver )
|
|
33 |
{
|
|
34 |
}
|
|
35 |
|
|
36 |
// ---------------------------------------------------------
|
|
37 |
// Destructor
|
|
38 |
// ---------------------------------------------------------
|
|
39 |
//
|
|
40 |
CPhoneNote::~CPhoneNote()
|
|
41 |
{
|
|
42 |
}
|
|
43 |
|
|
44 |
// ---------------------------------------------------------
|
|
45 |
// CPhoneNote::PreLayoutDynInitL
|
|
46 |
// ---------------------------------------------------------
|
|
47 |
//
|
|
48 |
void CPhoneNote::PreLayoutDynInitL()
|
|
49 |
{
|
|
50 |
CEikButtonGroupContainer& cba = ButtonGroupContainer();
|
|
51 |
CEikCba* eikCba = static_cast< CEikCba* >( cba.ButtonGroup() );
|
|
52 |
|
|
53 |
if ( eikCba )
|
|
54 |
{
|
|
55 |
eikCba->EnableItemSpecificSoftkey( EFalse );
|
|
56 |
}
|
|
57 |
|
|
58 |
CAknNoteDialog::PreLayoutDynInitL();
|
|
59 |
}
|
|
60 |
|
|
61 |
// ---------------------------------------------------------
|
|
62 |
// CPhoneNote::OfferKeyEventL
|
|
63 |
// ---------------------------------------------------------
|
|
64 |
//
|
|
65 |
TKeyResponse CPhoneNote::OfferKeyEventL(
|
|
66 |
const TKeyEvent& aKeyEvent,
|
|
67 |
TEventCode /*aType*/ )
|
|
68 |
{
|
|
69 |
if ( ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo )
|
|
70 |
&& iNoteType != EPhoneNoteSecurity )
|
|
71 |
{
|
|
72 |
OkToExitL( EPhoneCmdWaitNoteOk );
|
|
73 |
return EKeyWasNotConsumed;
|
|
74 |
}
|
|
75 |
else
|
|
76 |
{
|
|
77 |
// Let key events be handled by the application
|
|
78 |
return EKeyWasNotConsumed;
|
|
79 |
}
|
|
80 |
}
|
|
81 |
|
|
82 |
// ---------------------------------------------------------
|
|
83 |
// CPhoneNote::OkToExitL
|
|
84 |
// ---------------------------------------------------------
|
|
85 |
//
|
|
86 |
TBool CPhoneNote::OkToExitL( TInt aCommand )
|
|
87 |
{
|
|
88 |
// Let the command observer process the command
|
|
89 |
iCommandObserver.ProcessCommandL( aCommand );
|
|
90 |
|
|
91 |
// So that the dialog will not disappear, or must disappear
|
|
92 |
// EPhoneInCallCmdDtmfManualQuery since it can be already deleted.
|
|
93 |
return ( aCommand == EPhoneInCallCmdDtmfManualQuery );
|
|
94 |
}
|
|
95 |
|
|
96 |
// ---------------------------------------------------------
|
|
97 |
// CPhoneNote::SetNoteType
|
|
98 |
// ---------------------------------------------------------
|
|
99 |
//
|
|
100 |
void CPhoneNote::SetNoteType( TPhoneNoteType aNoteType )
|
|
101 |
{
|
|
102 |
iNoteType = aNoteType;
|
|
103 |
}
|
|
104 |
|
|
105 |
// ---------------------------------------------------------
|
|
106 |
// CPhoneNote::NoteType
|
|
107 |
// ---------------------------------------------------------
|
|
108 |
//
|
|
109 |
TPhoneNoteType CPhoneNote::NoteType()
|
|
110 |
{
|
|
111 |
return iNoteType;
|
|
112 |
}
|
|
113 |
|
|
114 |
// ---------------------------------------------------------
|
|
115 |
// CPhoneNote::HandlePointerEventL
|
|
116 |
// ---------------------------------------------------------
|
|
117 |
//
|
|
118 |
void CPhoneNote::HandlePointerEventL(
|
|
119 |
const TPointerEvent& aPointerEvent )
|
|
120 |
{
|
|
121 |
if( ( iNoteType == EPhoneNoteError ) ||
|
|
122 |
( iNoteType == EPhoneNoteWarning ) ||
|
|
123 |
( iNoteType == EPhoneNoteInformation ) ||
|
|
124 |
( iNoteType == EPhoneNoteConfirmation) ||
|
|
125 |
( iNoteType == EPhoneNoteCustom ))
|
|
126 |
{
|
|
127 |
CEikDialog::HandlePointerEventL( aPointerEvent );
|
|
128 |
}
|
|
129 |
}
|
|
130 |
|
|
131 |
// ---------------------------------------------------------
|
|
132 |
// CPhoneNote::UpdateSoftkeysL
|
|
133 |
// ---------------------------------------------------------
|
|
134 |
//
|
|
135 |
void CPhoneNote::UpdateSoftkeysL( TInt aResourceId )
|
|
136 |
{
|
|
137 |
CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
|
|
138 |
buttonGroup.SetCommandSetL( aResourceId );
|
|
139 |
|
|
140 |
buttonGroup.DrawDeferred();
|
|
141 |
}
|
|
142 |
|
|
143 |
// End of File
|