|
1 /* |
|
2 * Copyright (c) 2002 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: MsgSendKeyAcceptingQuery implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // ========== INCLUDE FILES ================================ |
|
21 |
|
22 #include "MsgSendKeyAcceptingQuery.h" |
|
23 |
|
24 // ========== EXTERNAL DATA STRUCTURES ===================== |
|
25 |
|
26 // ========== EXTERNAL FUNCTION PROTOTYPES ================= |
|
27 |
|
28 // ========== CONSTANTS ==================================== |
|
29 |
|
30 // ========== MACROS ======================================= |
|
31 |
|
32 // ========== LOCAL CONSTANTS AND MACROS =================== |
|
33 |
|
34 // ========== MODULE DATA STRUCTURES ======================= |
|
35 |
|
36 // ========== LOCAL FUNCTION PROTOTYPES ==================== |
|
37 |
|
38 // ========== LOCAL FUNCTIONS ============================== |
|
39 |
|
40 // ========== MEMBER FUNCTIONS ============================= |
|
41 |
|
42 // --------------------------------------------------------- |
|
43 // CMsgSendKeyAcceptingQuery::NewL |
|
44 // |
|
45 // |
|
46 // --------------------------------------------------------- |
|
47 CMsgSendKeyAcceptingQuery* CMsgSendKeyAcceptingQuery::NewL(TDesC& aPrompt, const TTone& aTone) |
|
48 { |
|
49 CMsgSendKeyAcceptingQuery* self = new (ELeave) CMsgSendKeyAcceptingQuery(aTone); |
|
50 |
|
51 CleanupStack::PushL(self); |
|
52 self->SetPromptL(aPrompt); |
|
53 CleanupStack::Pop(); |
|
54 |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // CMsgSendKeyAcceptingQuery::CMsgSendKeyAcceptingQuery |
|
60 // |
|
61 // |
|
62 // --------------------------------------------------------- |
|
63 CMsgSendKeyAcceptingQuery::CMsgSendKeyAcceptingQuery(const TTone aTone) |
|
64 : |
|
65 CAknQueryDialog(aTone) |
|
66 { |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------- |
|
70 // CMsgSendKeyAcceptingQuery::~CMsgSendKeyAcceptingQuery |
|
71 // |
|
72 // |
|
73 // --------------------------------------------------------- |
|
74 CMsgSendKeyAcceptingQuery::~CMsgSendKeyAcceptingQuery() |
|
75 { |
|
76 } |
|
77 |
|
78 // --------------------------------------------------------- |
|
79 // CMsgSendKeyAcceptingQuery::OfferKeyEventL |
|
80 // |
|
81 // |
|
82 // --------------------------------------------------------- |
|
83 TKeyResponse CMsgSendKeyAcceptingQuery::OfferKeyEventL( |
|
84 const TKeyEvent& aKeyEvent, TEventCode aType) |
|
85 { |
|
86 if (aType == EEventKey && aKeyEvent.iCode == EKeyYes) |
|
87 { |
|
88 TryExitL(EKeyYes); |
|
89 return EKeyWasConsumed; |
|
90 } |
|
91 else |
|
92 { |
|
93 return CAknDialog::OfferKeyEventL(aKeyEvent, aType); |
|
94 } |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------- |
|
98 // CMsgSendKeyAcceptingQuery::OkToExitL |
|
99 // |
|
100 // |
|
101 // --------------------------------------------------------- |
|
102 TBool CMsgSendKeyAcceptingQuery::OkToExitL(TInt aButtonId) |
|
103 { |
|
104 if (EKeyYes == aButtonId) |
|
105 { |
|
106 return ETrue; |
|
107 } |
|
108 else |
|
109 { |
|
110 return CAknDialog::OkToExitL(aButtonId); |
|
111 } |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------- |
|
115 // CMsgSendKeyAcceptingQuery::MappedCommandId |
|
116 // |
|
117 // |
|
118 // --------------------------------------------------------- |
|
119 TInt CMsgSendKeyAcceptingQuery::MappedCommandId(TInt aButtonId) |
|
120 { |
|
121 switch(aButtonId) |
|
122 { |
|
123 case EKeyYes: |
|
124 return EKeyYes; |
|
125 |
|
126 default : |
|
127 return CEikDialog::MappedCommandId(aButtonId); |
|
128 } |
|
129 } |
|
130 |
|
131 // End of File |