|
1 /* |
|
2 * Copyright (c) 2006 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: Provides methods for Settings list. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "MsgMailEditorDocument.h" |
|
21 #include "cmsgmaileditorsettinglist.h" |
|
22 #include "cmsgmailremotemailboxsetting.h" |
|
23 #include "cmsgmailshedulingsetting.h" |
|
24 #include "cmsgmailencodingsetting.h" |
|
25 #include "cmsgmailprioritysetting.h" |
|
26 #include "cmsgmailreplytosetting.h" |
|
27 #include "msgmaileditor.hrh" |
|
28 #include <MsgMailEditor.rsg> |
|
29 #include "CMailCRHandler.h" |
|
30 |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 |
|
34 CMailEditorSettingList::CMailEditorSettingList( |
|
35 CMsgMailEditorDocument& aDocument ) |
|
36 : iDocument( aDocument ) |
|
37 { |
|
38 } |
|
39 |
|
40 inline void CMailEditorSettingList::ConstructL( TInt aResourceId ) |
|
41 { |
|
42 ConstructFromResourceL( aResourceId ); |
|
43 } |
|
44 |
|
45 CMailEditorSettingList* CMailEditorSettingList::NewL( |
|
46 CMsgMailEditorDocument& aDocument, TInt aResourceId ) |
|
47 { |
|
48 CMailEditorSettingList* self = |
|
49 new( ELeave ) CMailEditorSettingList( aDocument ); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL( aResourceId ); |
|
52 CleanupStack::Pop(self); // self |
|
53 return self; |
|
54 } |
|
55 |
|
56 CMailEditorSettingList::~CMailEditorSettingList() |
|
57 { |
|
58 } |
|
59 |
|
60 // ---------------------------------------------------------------------------- |
|
61 // From: CAknSettingItemList |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
|
64 CAknSettingItem* CMailEditorSettingList::CreateSettingItemL( |
|
65 TInt aSettingId ) |
|
66 { |
|
67 CAknSettingItem* settingItem( NULL ); |
|
68 switch ( aSettingId ) |
|
69 { |
|
70 case ESettingMailboxInUse: |
|
71 { |
|
72 settingItem = CMsgMailEditorRemoteMailboxSettingItem::NewL( |
|
73 aSettingId, iDocument ); |
|
74 |
|
75 break; |
|
76 } |
|
77 |
|
78 case ESettingSendMessage: |
|
79 { |
|
80 // nothing leavable is called after creating this item |
|
81 settingItem = CMsgMailEditorShedulingSettingItem::NewL( // CSI: 35 # see comment above |
|
82 aSettingId, iDocument ); |
|
83 break; |
|
84 } |
|
85 case ESettingPriority: |
|
86 { |
|
87 settingItem = CMsgMailEditorPrioritySettingItem::NewL( |
|
88 aSettingId, iDocument ); |
|
89 break; |
|
90 } |
|
91 case ESettingReplyTo: |
|
92 { |
|
93 settingItem = CMsgMailEditorReplyToSettingItem::NewL( |
|
94 aSettingId, iDocument ); |
|
95 |
|
96 break; |
|
97 } |
|
98 case ESettingEncoding: |
|
99 { |
|
100 // is encoding setting enabled? |
|
101 if ( iDocument.MailCRHandler()->MailEncodingSetting() ) |
|
102 { |
|
103 settingItem = CMsgMailEditorEncodingSettingItem::NewL( |
|
104 aSettingId, iDocument ); |
|
105 } |
|
106 |
|
107 break; |
|
108 } |
|
109 default: |
|
110 { |
|
111 // Do nothing |
|
112 break; |
|
113 } |
|
114 } |
|
115 |
|
116 // Ownership transferred |
|
117 return settingItem; |
|
118 } |
|
119 |
|
120 // ---------------------------------------------------------------------------- |
|
121 // CMailEditorSettingList::SizeChanged |
|
122 // ---------------------------------------------------------------------------- |
|
123 // |
|
124 void CMailEditorSettingList::SizeChanged() |
|
125 { |
|
126 CAknSettingItemList::SizeChanged(); |
|
127 if ( ListBox() ) |
|
128 { |
|
129 ListBox()->SetRect( Rect() ); |
|
130 } |
|
131 } |
|
132 |
|
133 // End of File |