|
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: Implementation of List of Memos/Templates. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <barsread.h> |
|
21 #include <touchfeedback.h> |
|
22 #include <touchlogicalfeedback.h> |
|
23 #include <NpdLib.rsg> |
|
24 #include "NpdListBox.h" |
|
25 #include "NpdListDialog.h" |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CNotepadListBox::LoadMarginsL |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 void CNotepadListBox::LoadMarginsL() |
|
34 { |
|
35 TResourceReader rr; |
|
36 iCoeEnv->CreateResourceReaderLC(rr, R_NOTEPAD_MARGINS); // Push rr |
|
37 iMargins.iLeft = rr.ReadInt16(); // WORD left |
|
38 iMargins.iRight = rr.ReadInt16(); // WORD right |
|
39 CleanupStack::PopAndDestroy(); // rr |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CNotepadListBox::SizeChanged |
|
44 // |
|
45 // The margins are set by CAknSingleStyleListBox::SizeChanged() using |
|
46 // SetupColumnTextCellL. Thus CNotepadListBox overrides SizeChanged() to |
|
47 // change the margins just set by CAknSingleStyleListBox::SizeChanged(). |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 void CNotepadListBox::SizeChanged() |
|
51 { |
|
52 CAknSingleHeadingStyleListBox::SizeChanged(); |
|
53 } |
|
54 |
|
55 void CNotepadListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
56 { |
|
57 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
58 { |
|
59 if( aPointerEvent.iModifiers & EModifierShift ) |
|
60 { |
|
61 STATIC_CAST( CNotepadListDialog*,&iParent )->MiddleSoftKeyL(); |
|
62 } |
|
63 else if ( Model()->NumberOfItems() == 0 ) |
|
64 { |
|
65 STATIC_CAST( CNotepadListDialog*,&iParent )->HandleListBoxPointerEventL( CNotepadListDialog::EOpenListBoxContextMenu ); |
|
66 } |
|
67 } |
|
68 if( ( aPointerEvent.iType == TPointerEvent::EButton1Down )&&( Model()->NumberOfItems() == 0 ) ) |
|
69 { |
|
70 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
71 if(feedback) |
|
72 { |
|
73 feedback->InstantFeedback( ETouchFeedbackBasic ); |
|
74 } |
|
75 } |
|
76 CAknSingleHeadingStyleListBox::HandlePointerEventL( aPointerEvent ); |
|
77 } |
|
78 |
|
79 CNotepadListBox::CNotepadListBox(CNotepadDialogBase& aParent) |
|
80 :CAknSingleHeadingStyleListBox(),iParent(aParent) |
|
81 { |
|
82 |
|
83 } |
|
84 // End of File |