author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:29:17 +0300 | |
branch | RCL_3 |
changeset 64 | 85902f042028 |
parent 56 | d48ab3b357f1 |
child 72 | a5e7a4f63858 |
permissions | -rw-r--r-- |
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
56 | 2 |
* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Interface for controlling stylus popup menu. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include <AknPreviewPopUpController.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <eikmobs.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <AknUtils.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <barsread.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include <aknlayoutscalable_avkon.cdl.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <eikapp.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <aknappui.h> |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include <AknDef.h> |
56 | 27 |
#include <touchfeedback.h> |
28 |
#include <akntranseffect.h> |
|
29 |
#include <akntransitionutils.h> |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include "aknstyluspopupmenu.h" |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
#include "aknstyluspopupmenucontent.h" |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
const TInt KDefaultPopUpShowDelay = 0; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
const TInt KDefaultPopUpHideDelay = 6000000; // 6 seconds |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
enum TStylusPopUpFlags |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
EIdleDisabled // usage of iControllerIdle is disabled |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
}; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// ======== MEMBER FUNCTIONS ======== |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
// Default constructor |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
CAknStylusPopUpMenu::CAknStylusPopUpMenu( MEikMenuObserver* aObserver, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
const TPoint& aPoint, |
56 | 49 |
CAknPreviewPopUpController* aPopup, |
50 |
const TInt aFlags ) |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
: iPosition ( aPoint ), |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
iMenuObserver( aObserver ), |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
iPreviewPopup( aPopup ), |
56 | 54 |
iPositionType( EPositionTypeLeftTop ), |
55 |
iModeFlags ( aFlags ) |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
// CAknStylusPopUpMenu::ConstructL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
void CAknStylusPopUpMenu::ConstructL() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
iContent = CAknStylusPopUpMenuContent::NewL( *this ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
iContent->SetObserver(this); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
// CAknStylusPopUpMenu::NewL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
EXPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewL( |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
MEikMenuObserver* aObserver, const TPoint& aPoint, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
CAknPreviewPopUpController* aPopup ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
CAknStylusPopUpMenu* self = CAknStylusPopUpMenu::NewLC( aObserver, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
aPoint, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
aPopup ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
CleanupStack::Pop( self ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
return self; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
|
56 | 88 |
// --------------------------------------------------------------------------- |
89 |
// CAknStylusPopUpMenu::NewL |
|
90 |
// --------------------------------------------------------------------------- |
|
91 |
// |
|
92 |
CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewL( MEikMenuObserver* aObserver, |
|
93 |
const TPoint& aPoint, |
|
94 |
CAknPreviewPopUpController* aPopup, |
|
95 |
const TInt aFlags ) |
|
96 |
{ |
|
97 |
CAknStylusPopUpMenu* self = new ( ELeave ) CAknStylusPopUpMenu( aObserver, |
|
98 |
aPoint, |
|
99 |
aPopup, |
|
100 |
aFlags ); |
|
101 |
CleanupStack::PushL( self ); |
|
102 |
self->ConstructL(); |
|
103 |
CleanupStack::Pop( self ); |
|
104 |
return self; |
|
105 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
// CAknStylusPopUpMenu::NewL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
EXPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewL( |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
MEikMenuObserver* aObserver, const TPoint& aPoint ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
CAknStylusPopUpMenu* self = CAknStylusPopUpMenu::NewLC( aObserver, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
aPoint, NULL ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
CleanupStack::Pop( self ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
return self; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
// CAknStylusPopUpMenu::NewLC |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
EXPORT_C CAknStylusPopUpMenu* CAknStylusPopUpMenu::NewLC( |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
MEikMenuObserver* aObserver, const TPoint& aPoint, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
CAknPreviewPopUpController* aPopup ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
CAknStylusPopUpMenu* self = new ( ELeave ) CAknStylusPopUpMenu( aObserver, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
aPoint, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
aPopup ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
CleanupStack::PushL( self ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
self->ConstructL(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
return self; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
// Destructor |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
CAknStylusPopUpMenu::~CAknStylusPopUpMenu() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
{ |
56 | 144 |
if ( iContent ) |
145 |
{ |
|
146 |
iContent->SetObserver(NULL); |
|
147 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
if ( iIsDeleted ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
*iIsDeleted = ETrue; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
iIsDeleted = NULL; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
if ( iControllerIdle ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
iControllerIdle->Cancel(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
delete iControllerIdle; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
delete iController; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
delete iContent; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
// CAknStylusPopUpMenu::AddMenuItemL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
EXPORT_C void CAknStylusPopUpMenu::AddMenuItemL( const TDesC& aItem, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
const TInt aCommandId ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
iContent->AddMenuItemL( aItem, aCommandId ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
// CAknStylusPopUpMenu::RemoveMenuItem |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
EXPORT_C void CAknStylusPopUpMenu::RemoveMenuItem( const TInt aCommandId ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
iContent->RemoveMenuItem( aCommandId ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
// CAknStylusPopUpMenu::SetItemDimmed |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
EXPORT_C void CAknStylusPopUpMenu::SetItemDimmed( const TInt aCommandId, const TBool aDimmed ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
iContent->SetItemDimmed( aCommandId, aDimmed ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
// CAknStylusPopUpMenu::ShowMenu |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
EXPORT_C void CAknStylusPopUpMenu::ShowMenu() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
{ |
56 | 201 |
// if contoller exists, re-use it . |
202 |
if ( !iController ) |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
{ |
56 | 204 |
TInt err ( KErrNone ); |
205 |
||
206 |
if ( iModeFlags & EConsumeKeyEvents ) |
|
207 |
{ |
|
208 |
TRAP( err, iController = CAknPreviewPopUpController::NewL( |
|
209 |
*iContent, |
|
210 |
CAknPreviewPopUpController::ELayoutSubMenu | |
|
211 |
CAknPreviewPopUpController::EAutoMirror | |
|
212 |
CAknPreviewPopUpController::EDontClose | |
|
213 |
CAknPreviewPopUpController::EConsumeKeys ) ); |
|
214 |
} |
|
215 |
else |
|
216 |
{ |
|
217 |
TRAP( err, iController = CAknPreviewPopUpController::NewL( |
|
218 |
*iContent, |
|
219 |
CAknPreviewPopUpController::ELayoutSubMenu | |
|
220 |
CAknPreviewPopUpController::EAutoMirror | |
|
221 |
CAknPreviewPopUpController::EDontClose ) ); |
|
222 |
} |
|
223 |
if ( err ) |
|
224 |
{ |
|
225 |
return; |
|
226 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
|
56 | 228 |
iController->SetPopUpShowDelay( KDefaultPopUpShowDelay ); |
229 |
iController->SetPopUpHideDelay( KDefaultPopUpHideDelay ); |
|
230 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
TSize size(iController->Size()); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
iController->ShowPopUp(); |
56 | 234 |
if ( AknLayoutUtils::PenEnabled() ) |
235 |
{ |
|
236 |
MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
237 |
if ( feedback ) |
|
238 |
{ |
|
239 |
TTouchLogicalFeedback feedbackType = ETouchFeedbackPopUp; |
|
240 |
if ( CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EComponentTransitionsOff ) ) |
|
241 |
{ |
|
242 |
feedbackType = ETouchFeedbackOptionsMenuOpened; |
|
243 |
} |
|
244 |
feedback->InstantFeedback( |
|
245 |
iContent, |
|
246 |
feedbackType, |
|
247 |
ETouchFeedbackVibra, |
|
248 |
TPointerEvent() ); |
|
249 |
} |
|
250 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
if ( size.iWidth == 0 && size.iHeight == 0 ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
if ( iPositionType != KErrNotFound ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
SetPosition( iPosition, TPositionType( iPositionType ) ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
else |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
SetPosition( iPosition ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
262 |
else |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
//position already adjusted. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
iController->SetPosition( iPosition ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
// CAknStylusPopUpMenu::SetPosition |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
EXPORT_C void CAknStylusPopUpMenu::SetPosition( const TPoint& aPoint ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
SetPosition( aPoint, EPositionTypeLeftTop ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
// CAknStylusPopUpMenu::SetPosition |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
// |
56 | 285 |
EXPORT_C void CAknStylusPopUpMenu::SetPosition( const TPoint& aPoint, |
286 |
TPositionType aPosType ) |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
TPoint adjustedPoint( aPoint ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
if ( !iController ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
iPosition = aPoint; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
iPositionType = aPosType; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
return; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
} |
56 | 295 |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
iController->UpdateContentSize(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
TSize menuSize = iController->Size(); |
56 | 298 |
|
299 |
// Calculate the position to right-top corner by aPosType and |
|
300 |
// popup menu size. Add also a margin between the screen borders and the |
|
301 |
// popup if the popup is too close to screen border. |
|
302 |
TBool layoutMirrored( AknLayoutUtils::LayoutMirrored() ); |
|
303 |
TRect screenRect; |
|
304 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, |
|
305 |
screenRect ); |
|
306 |
||
307 |
// Margin is read from the popup window's layout data |
|
308 |
// (left parameter used). |
|
309 |
TAknWindowLineLayout popupWindowLayout( |
|
310 |
AknLayoutScalable_Avkon::popup_touch_menu_window( 0 ).LayoutLine() ); |
|
311 |
TInt windowMargin = layoutMirrored ? popupWindowLayout.ir : |
|
312 |
popupWindowLayout.il; |
|
313 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
switch ( aPosType ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
{ |
56 | 316 |
case EPositionTypeRightTop: |
317 |
{ |
|
4
8ca85d2f0db7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
318 |
break; |
56 | 319 |
} |
320 |
||
55
aecbbf00d063
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
51
diff
changeset
|
321 |
case EPositionTypeLeftTop: |
56 | 322 |
{ |
323 |
if ( !layoutMirrored ) |
|
55
aecbbf00d063
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
51
diff
changeset
|
324 |
{ |
56 | 325 |
adjustedPoint.iX += menuSize.iWidth; |
55
aecbbf00d063
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
51
diff
changeset
|
326 |
} |
56 | 327 |
|
328 |
break; |
|
329 |
} |
|
330 |
||
331 |
case EPositionTypeRightBottom: |
|
332 |
{ |
|
333 |
adjustedPoint.iY -= menuSize.iHeight; |
|
334 |
||
335 |
break; |
|
336 |
} |
|
337 |
||
338 |
case EPositionTypeLeftBottom: |
|
339 |
{ |
|
340 |
if ( !layoutMirrored ) |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
adjustedPoint.iX += menuSize.iWidth; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
343 |
} |
56 | 344 |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
adjustedPoint.iY -= menuSize.iHeight; |
56 | 346 |
|
347 |
break; |
|
348 |
} |
|
349 |
||
350 |
default: |
|
351 |
{ |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
break; |
56 | 353 |
} |
354 |
} |
|
355 |
||
356 |
// Check if margins need to be added. |
|
357 |
TInt xLeftPos( layoutMirrored ? adjustedPoint.iX : |
|
358 |
adjustedPoint.iX - menuSize.iWidth ); |
|
359 |
TInt xRightPos( layoutMirrored ? adjustedPoint.iX + menuSize.iWidth : |
|
360 |
adjustedPoint.iX ); |
|
361 |
TInt xPosRightMargin( screenRect.iBr.iX - windowMargin ); |
|
362 |
TInt xPosBottomMargin( screenRect.iBr.iY - windowMargin ); |
|
363 |
||
364 |
if ( xLeftPos < windowMargin ) |
|
365 |
{ |
|
366 |
// Too close to the left side of the screen. |
|
367 |
adjustedPoint.iX = windowMargin + menuSize.iWidth; |
|
368 |
} |
|
369 |
else if ( xRightPos > xPosRightMargin ) |
|
370 |
{ |
|
371 |
// Too close to the right side of the screen. |
|
372 |
if ( layoutMirrored ) |
|
373 |
{ |
|
374 |
// In mirrored layout a left-top position must be provided |
|
375 |
// for the preview popup controller. |
|
376 |
adjustedPoint.iX = xPosRightMargin - menuSize.iWidth; |
|
377 |
} |
|
378 |
else |
|
379 |
{ |
|
380 |
adjustedPoint.iX = xPosRightMargin; |
|
381 |
} |
|
382 |
} |
|
383 |
||
384 |
if ( adjustedPoint.iY < windowMargin ) |
|
385 |
{ |
|
386 |
// Too close to the top border of the screen. |
|
387 |
adjustedPoint.iY = windowMargin; |
|
388 |
} |
|
389 |
else if ( adjustedPoint.iY + menuSize.iHeight > xPosBottomMargin ) |
|
390 |
{ |
|
391 |
// Too close to the bottom border of the screen. |
|
392 |
adjustedPoint.iY = xPosBottomMargin - menuSize.iHeight; |
|
393 |
} |
|
55
aecbbf00d063
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
51
diff
changeset
|
394 |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
iPosition = adjustedPoint; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
iController->SetPosition( adjustedPoint ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
// CAknStylusPopUpMenu::ConstructFromResourceL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
EXPORT_C void CAknStylusPopUpMenu::ConstructFromResourceL( TResourceReader& |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
aReader ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
TInt count = aReader.ReadInt16(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
TInt commandId; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
for ( TInt i = 0; i < count; i++ ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
TPtrC text = aReader.ReadTPtrC(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
commandId = aReader.ReadInt32(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
iContent->AddMenuItemL( text, commandId ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
aReader.ReadInt32(); // extension link |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
// From class MCoeControlObserver. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
// Handles stylus tap events by forwarding the event to the observer. |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
EXPORT_C void CAknStylusPopUpMenu::HandleControlEventL( CCoeControl* aControl, |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
TCoeEvent aEventType ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
if ( aControl && aEventType == EEventStateChanged ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
{ |
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
429 |
HidePreviewPopup(); |
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
if ( iMenuObserver ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
{ |
56 | 433 |
TBool isAlreadySet = iFlags.IsSet( EIdleDisabled ); |
434 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
iFlags.Set( EIdleDisabled ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
TBool isDeleted = EFalse; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
iIsDeleted = &isDeleted; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
|
56 | 439 |
CleanupStack::PushL( TCleanupItem( CleanLocalRef, this ) ); |
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
iMenuObserver->ProcessCommandL( iContent->CurrentCommandId() ); |
56 | 441 |
CleanupStack::Pop(); |
442 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
if ( isDeleted ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
return; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
iIsDeleted = NULL; |
56 | 449 |
if( !isAlreadySet ) |
450 |
{ |
|
451 |
iFlags.Clear( EIdleDisabled ); |
|
452 |
} |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
StartControllerIdleL(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
else if ( aControl && aEventType == EEventRequestExit ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
{ |
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
459 |
HidePreviewPopup(); |
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
StartControllerIdleL(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
else if ( aControl && aEventType == EEventRequestCancel ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
{ |
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
465 |
HidePreviewPopup(); |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
466 |
|
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
if ( iMenuObserver ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
{ |
56 | 469 |
TBool isAlreadySet = iFlags.IsSet( EIdleDisabled ); |
470 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
iFlags.Set( EIdleDisabled ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
iMenuObserver->ProcessCommandL( KErrCancel ); |
56 | 473 |
|
474 |
if( !isAlreadySet ) |
|
475 |
{ |
|
476 |
iFlags.Clear( EIdleDisabled ); |
|
477 |
} |
|
478 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
StartControllerIdleL(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
// CAknStylusPopUpMenu::UpdatePosition |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
void CAknStylusPopUpMenu::UpdatePosition() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
SetPosition( iPosition ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
497 |
// CAknStylusPopUpMenu::Clear |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
// --------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
void CAknStylusPopUpMenu::Clear() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
iContent->Clear(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
503 |
if ( iController ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
iController->UpdateContentSize(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
506 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
507 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
|
56 | 509 |
|
510 |
// --------------------------------------------------------------------------- |
|
511 |
// CAknStylusPopUpMenu::HideMenu |
|
512 |
// --------------------------------------------------------------------------- |
|
513 |
// |
|
514 |
void CAknStylusPopUpMenu::HideMenu() |
|
515 |
{ |
|
516 |
if ( iController ) |
|
517 |
{ |
|
518 |
iController->HidePopUp(); |
|
519 |
} |
|
520 |
} |
|
521 |
||
522 |
||
0
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
523 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
524 |
// CAknStylusPopUpMenu::StartControllerIdleL |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
527 |
void CAknStylusPopUpMenu::StartControllerIdleL() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
if ( !iFlags.IsSet( EIdleDisabled ) ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
if ( !iControllerIdle ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
532 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
iControllerIdle = CIdle::NewL( CActive::EPriorityIdle ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
535 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
536 |
if ( !iControllerIdle->IsActive() && iController ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
537 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
iControllerIdle->Start( TCallBack( ControllerCallBack, this ) ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
542 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
543 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
544 |
// CAknStylusPopUpMenu::ControllerCallBack |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
546 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
TInt CAknStylusPopUpMenu::ControllerCallBack( TAny* aThis ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
549 |
CAknStylusPopUpMenu* self = static_cast<CAknStylusPopUpMenu*>( aThis ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
550 |
self->RemoveController(); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
551 |
self->iFlags.Clear( EIdleDisabled ); |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
552 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
return KErrNone; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
|
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
556 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
557 |
// CAknStylusPopUpMenu::RemoveController |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
// ----------------------------------------------------------------------------- |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
// |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
void CAknStylusPopUpMenu::RemoveController() |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
562 |
if ( iController ) |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
{ |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
564 |
delete iController; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
iController = NULL; |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
} |
2f259fa3e83a
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
} |
56 | 568 |
|
569 |
// ----------------------------------------------------------------------------- |
|
570 |
// CAknStylusPopUpMenu::CleanLocalRef |
|
571 |
// ----------------------------------------------------------------------------- |
|
572 |
// |
|
573 |
void CAknStylusPopUpMenu::CleanLocalRef( TAny* aParam ) |
|
574 |
{ |
|
575 |
static_cast<CAknStylusPopUpMenu*>( aParam )->iIsDeleted = NULL; |
|
576 |
} |
|
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
577 |
|
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
578 |
// ----------------------------------------------------------------------------- |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
579 |
// Hide Preview Popups |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
580 |
// ----------------------------------------------------------------------------- |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
581 |
// |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
582 |
void CAknStylusPopUpMenu::HidePreviewPopup() |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
583 |
{ |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
584 |
if ( iPreviewPopup ) |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
585 |
{ |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
586 |
iPreviewPopup->HidePopUp(); |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
587 |
} |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
588 |
|
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
589 |
if ( iController ) |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
590 |
{ |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
591 |
iController->HidePopUp(); |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
592 |
} |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
593 |
} |