|
1 /* |
|
2 * Copyright (c) 2008 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: CMSStoreKeepOnPhoneSetting class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <mediaservant.rsg> |
|
20 #include <aknlistquerydialog.h> |
|
21 |
|
22 #include "msstorekeeponphonesetting.h" |
|
23 #include "mediaservant.hrh" |
|
24 #include "msdebug.h" |
|
25 |
|
26 |
|
27 // -------------------------------------------------------------------------- |
|
28 // CMSStoreKeepOnPhoneSetting::~CMSStoreKeepOnPhoneSetting() |
|
29 // -------------------------------------------------------------------------- |
|
30 // |
|
31 CMSStoreKeepOnPhoneSetting::~CMSStoreKeepOnPhoneSetting() |
|
32 { |
|
33 } |
|
34 |
|
35 // -------------------------------------------------------------------------- |
|
36 // CMSStoreKeepOnPhoneSetting::CMSStoreKeepOnPhoneSetting |
|
37 // -------------------------------------------------------------------------- |
|
38 // |
|
39 CMSStoreKeepOnPhoneSetting::CMSStoreKeepOnPhoneSetting( |
|
40 TInt aIdentifier, |
|
41 TCmMediaType aMediaType, |
|
42 TInt& aSelection |
|
43 ) : |
|
44 CAknEnumeratedTextPopupSettingItem( aIdentifier, aSelection), |
|
45 iMediaType ( aMediaType ) |
|
46 { |
|
47 } |
|
48 |
|
49 // -------------------------------------------------------------------------- |
|
50 // CMSRuleAmountSetting::CompleteConstructionL |
|
51 // -------------------------------------------------------------------------- |
|
52 // |
|
53 void CMSStoreKeepOnPhoneSetting::CompleteConstructionL() |
|
54 { |
|
55 LOG(_L("[MediaServant]\t CMSStoreKeepOnPhoneSetting::\ |
|
56 CompleteConstructionL")); |
|
57 |
|
58 // base class call |
|
59 CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); |
|
60 |
|
61 // Get text arrays - defined in resource |
|
62 CArrayPtr< CAknEnumeratedText >* resEnumeratedTextArray = |
|
63 EnumeratedTextArray (); |
|
64 CArrayPtr< HBufC > * resPoppedUpTextArray = PoppedUpTextArray (); |
|
65 |
|
66 if ( iMediaType == ECmImage || iMediaType == ECmOtherImage ) |
|
67 { |
|
68 // remove "yes" item |
|
69 delete resEnumeratedTextArray->At( EMSKeep ); |
|
70 resEnumeratedTextArray->Delete( EMSKeep ); |
|
71 delete resPoppedUpTextArray->At( EMSKeep ); |
|
72 resPoppedUpTextArray->Delete( EMSKeep ); |
|
73 } |
|
74 |
|
75 else // other type than image |
|
76 { |
|
77 // remove "keep original size" and "keep screen size" items |
|
78 delete resEnumeratedTextArray->At( EMSKeepScreenSize ); |
|
79 delete resPoppedUpTextArray->At( EMSKeepScreenSize ); |
|
80 delete resEnumeratedTextArray->At( EMSKeepOriginalSize ); |
|
81 delete resPoppedUpTextArray->At( EMSKeepOriginalSize ); |
|
82 // delete 2 items |
|
83 resEnumeratedTextArray->Delete( EMSKeepOriginalSize, 2 ); |
|
84 // delete 2 items |
|
85 resPoppedUpTextArray->Delete( EMSKeepOriginalSize, 2 ); |
|
86 |
|
87 } |
|
88 |
|
89 HandleTextArrayUpdateL(); |
|
90 } |
|
91 |
|
92 // End of File |
|
93 |