|
1 /* |
|
2 * Copyright (c) 2003 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: Manages popups |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // using CAknInfoPopupNoteController API for iPopupController |
|
20 #include <AknInfoPopupNoteController.h> |
|
21 |
|
22 #include <j2me/jdebug.h> |
|
23 |
|
24 #include "CMIDPopupNoteController.h" |
|
25 |
|
26 CMIDPopupNoteController* CMIDPopupNoteController::NewL() |
|
27 { |
|
28 CMIDPopupNoteController* self = new(ELeave) CMIDPopupNoteController(); |
|
29 CleanupStack::PushL(self); |
|
30 self->ConstructL(); |
|
31 CleanupStack::Pop(self); |
|
32 return self; |
|
33 } |
|
34 |
|
35 void CMIDPopupNoteController::ConstructL() |
|
36 { |
|
37 iPopupController = CAknInfoPopupNoteController::NewL(); |
|
38 } |
|
39 |
|
40 CMIDPopupNoteController::~CMIDPopupNoteController() |
|
41 { |
|
42 delete iPopupController; |
|
43 } |
|
44 |
|
45 |
|
46 void CMIDPopupNoteController::ShowPopupL(const TDesC& aText, const TRect aRect, TBool aShortPopup) |
|
47 { |
|
48 if (!iPopupController->IsActive()) |
|
49 { |
|
50 iPopupController->SetTextL(aText); |
|
51 iPopupController->SetPositionByHighlight(aRect); |
|
52 iPopupController->SetTimeDelayBeforeShow((aShortPopup?KPopupNoteShortVisibleDelayMs:KPopupNoteVisibleDelayMs)); |
|
53 iPopupController->SetTimePopupInView((aShortPopup?KPopupNoteShortVisibleTimeMs:KPopupNoteVisibleTimeMs)); |
|
54 iPopupController->ShowInfoPopupNote(); |
|
55 } |
|
56 else |
|
57 { |
|
58 DEBUG("CMIDPopupNoteController::ShowPopupL IGNORED"); |
|
59 } |
|
60 } |
|
61 |
|
62 void CMIDPopupNoteController::HidePopup() |
|
63 { |
|
64 iPopupController->HideInfoPopupNote(); |
|
65 } |
|
66 |
|
67 |
|
68 CMIDPopupNoteController::CMIDPopupNoteController() |
|
69 { |
|
70 // nothing here |
|
71 } |
|
72 |
|
73 |