|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 // ========== INCLUDE FILES ================================ |
|
19 #include <msvapi.h> |
|
20 #include <eikspane.h> |
|
21 #include <eikmenup.h> |
|
22 #include <AknDef.h> |
|
23 #include <aknappui.h> |
|
24 #include <akntitle.h> |
|
25 #include <aknnavi.h> |
|
26 #include <aknlists.h> |
|
27 #include <gulicon.h> |
|
28 #include <coeutils.h> // for ConeUtils::FileExists |
|
29 #include <bautils.h> |
|
30 #include <aknnotewrappers.h> |
|
31 #include <AknWaitDialog.h> // CAknWaitDialog |
|
32 #include <DocumentHandler.h> |
|
33 #include <StringLoader.h> // StringLoader |
|
34 #include <AiwCommon.h> |
|
35 #include <NpdApi.h> |
|
36 |
|
37 |
|
38 |
|
39 #include <avkon.hrh> |
|
40 |
|
41 #include <aknlayout.cdl.h> |
|
42 #include <aknlayoutscalable_avkon.cdl.h> |
|
43 |
|
44 #include <AknUtils.h> |
|
45 #include <AknsUtils.h> // skinned icons |
|
46 #include <AknsConstants.h> // skinned icon ids |
|
47 |
|
48 #include "calenattachmentinfo.h" |
|
49 #include "calenattachmentmodel.h" |
|
50 #include "calenviewattachmentsdialog.h" |
|
51 #include "calenattachmentutils.h" |
|
52 #include "calenattalistitemarray.h" |
|
53 #include "calenattachmentitemdrawer.h" |
|
54 #include "calendarui_debug.h" |
|
55 #include <calendar.mbg> |
|
56 #include "calendar.hrh" |
|
57 #include <Calendar.rsg> // resouce identifiers |
|
58 #include <calencommonui.rsg> |
|
59 |
|
60 #include <aknlistloadertfx.h> |
|
61 #include <aknlistboxtfxinternal.h> |
|
62 |
|
63 |
|
64 // --------------------------------------------------------- |
|
65 // CCalenAttachmentItemDrawer::CCalenAttachmentItemDrawer |
|
66 // |
|
67 // |
|
68 // --------------------------------------------------------- |
|
69 // |
|
70 CCalenAttachmentItemDrawer::CCalenAttachmentItemDrawer( |
|
71 MTextListBoxModel* aTextListBoxModel, |
|
72 const CFont* aFont, |
|
73 CFormattedCellListBoxData* aFormattedCellData, |
|
74 CCalenAttachmentModel& aAttachmentModel, |
|
75 CCalenAttachmentsListBox* aAttaListBox ) |
|
76 : CDoubleLargeStyleItemDrawer( aTextListBoxModel, aFont, aFormattedCellData, aAttaListBox ), |
|
77 iAttachmentModel( aAttachmentModel ) |
|
78 { |
|
79 TRACE_ENTRY_POINT; |
|
80 TRACE_EXIT_POINT; |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------- |
|
84 // CCalenAttachmentItemDrawer::DrawItem |
|
85 // |
|
86 // |
|
87 // --------------------------------------------------------- |
|
88 // |
|
89 void CCalenAttachmentItemDrawer::DrawItem( |
|
90 TInt aItemIndex, |
|
91 TPoint aItemRectPos, |
|
92 TBool aItemIsSelected, |
|
93 TBool aItemIsCurrent, |
|
94 TBool aViewIsEmphasized, |
|
95 TBool aViewIsDimmed ) const |
|
96 { |
|
97 TRACE_ENTRY_POINT; |
|
98 |
|
99 |
|
100 |
|
101 CCalenAttachmentInfo& currAttInfo = |
|
102 iAttachmentModel.AttachmentInfoAt( aItemIndex ); |
|
103 |
|
104 iGc->SetPenColor(iTextColor); |
|
105 iGc->SetBrushColor(iBackColor); |
|
106 |
|
107 SetupGc(aItemIndex); |
|
108 |
|
109 // if ( currAttInfo.IsSeparator() ) |
|
110 { |
|
111 // draw separator line before item. |
|
112 |
|
113 // Resolve separator layout |
|
114 TRect mainPane; |
|
115 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane ); |
|
116 TAknLayoutRect listPaneLayout; |
|
117 listPaneLayout.LayoutRect( |
|
118 mainPane, |
|
119 AknLayoutScalable_Avkon::list_gen_pane( 0 ).LayoutLine() ); |
|
120 TAknLayoutRect doubleGraphicLayout; |
|
121 doubleGraphicLayout.LayoutRect( |
|
122 listPaneLayout.Rect(), |
|
123 AknLayoutScalable_Avkon::list_double_large_graphic_pane( 0 ).LayoutLine() ); |
|
124 TAknLayoutRect separator; |
|
125 separator.LayoutRect( |
|
126 doubleGraphicLayout.Rect(), |
|
127 AknLayoutScalable_Avkon::list_double_large_graphic_pane_g5( 1 ).LayoutLine() ); |
|
128 |
|
129 MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); |
|
130 if ( transApi ) |
|
131 { |
|
132 TRect lineRect( TPoint( separator.Rect().iTl.iX, aItemRectPos.iY ), |
|
133 TPoint( separator.Rect().iBr.iX, aItemRectPos.iY + separator.Rect().Height() ) ); |
|
134 transApi->BeginRedraw( MAknListBoxTfxInternal::EListItem, lineRect, aItemIndex ); |
|
135 transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); |
|
136 } |
|
137 /*iGc->DrawLine( TPoint( separator.Rect().iTl.iX, aItemRectPos.iY ), |
|
138 TPoint( separator.Rect().iBr.iX, aItemRectPos.iY ) );*/ |
|
139 |
|
140 // Reset gc because empty area is drawn after this. |
|
141 // Otherwise lines in empty area is drawn with line color! |
|
142 //iGc->Reset(); |
|
143 CDoubleLargeStyleItemDrawer::DrawItem( |
|
144 aItemIndex, |
|
145 aItemRectPos, |
|
146 aItemIsSelected, |
|
147 aItemIsCurrent, |
|
148 aViewIsEmphasized, |
|
149 aViewIsDimmed ); |
|
150 |
|
151 |
|
152 if ( transApi ) |
|
153 { |
|
154 transApi->StopDrawing(); |
|
155 transApi->EndRedraw( MAknListBoxTfxInternal::EListItem, aItemIndex ); |
|
156 } |
|
157 } |
|
158 TRACE_EXIT_POINT; |
|
159 } |
|
160 |
|
161 |
|
162 // End of File |