1 /* |
|
2 * Copyright (c) 2002-2010 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: CSisxSifUiSelectionCache saves user selections during |
|
15 * installation. Cached selections can be re-used, to avoid |
|
16 * displaying the same dialogs again. |
|
17 */ |
|
18 |
|
19 #ifndef C_SISXSIFUISELECTIONCACHE_H |
|
20 #define C_SISXSIFUISELECTIONCACHE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 |
|
26 /** |
|
27 * Saves user selections during installation. Installer may re-use |
|
28 * cached selections in order to avoid displaying the same prompts |
|
29 * several times. |
|
30 */ |
|
31 class CSisxSifUiSelectionCache : public CBase |
|
32 { |
|
33 public: // constructor and destructor |
|
34 static CSisxSifUiSelectionCache* NewL(); |
|
35 ~CSisxSifUiSelectionCache(); |
|
36 |
|
37 public: // new functions |
|
38 /** |
|
39 * Returns ETrue if language selection is currently cached, and |
|
40 * EFalse otherwise. Language selection can be cached by using |
|
41 * SetLanguage() method. |
|
42 * @return TBool -- ETrue if language is cached |
|
43 */ |
|
44 TBool LanguageCached() const; |
|
45 |
|
46 /** |
|
47 * Returns the language code saved earlier with SetLanguage() method. |
|
48 * If no language has been set, then returns language code 0 (ELangTest). |
|
49 * @return TLanguage -- the cached language, or ELangTest |
|
50 */ |
|
51 TLanguage Language() const; |
|
52 |
|
53 /** |
|
54 * Caches the given language code. |
|
55 * @param aLanguage - language to be cached |
|
56 */ |
|
57 void SetLanguage( const TLanguage& aLanguage ); |
|
58 |
|
59 /** |
|
60 * Returns ETrue if drive selection is currently cacehed, and EFalse |
|
61 * otherwise. Drive selection can be cached by using SetDrive() method. |
|
62 * @return TBool -- ETrue if drive is cached |
|
63 */ |
|
64 TBool DriveCached() const; |
|
65 |
|
66 /** |
|
67 * Returns the drive saved earlier with SetDrive() method. |
|
68 * @return TDriveUnit -- the cached drive |
|
69 */ |
|
70 TDriveUnit Drive() const; |
|
71 |
|
72 /** |
|
73 * Caches the given drive. |
|
74 * @param aLanguage -- drive to be cached |
|
75 */ |
|
76 void SetDrive( TDriveUnit aDrive ); |
|
77 |
|
78 /** |
|
79 * Returns ETrue if all options in aOptions array are cached, and EFalse |
|
80 * otherwise. Options can be cached using SetOptions() method. |
|
81 * @param aOptions -- array of options names |
|
82 * @return TBool -- ETrue if all aOptions are cached |
|
83 */ |
|
84 TBool OptionsCached( const RPointerArray<TDesC>& aOptions ) const; |
|
85 |
|
86 /** |
|
87 * Returns the options saved earlier with SetOptions() method. |
|
88 * @param aSelections -- the cached option selections |
|
89 */ |
|
90 void Options( RArray<TBool>& aSelections ); |
|
91 |
|
92 /** |
|
93 * Caches the given options. |
|
94 * @param aOptions -- array of options names |
|
95 * @param aSelections -- array of option selections |
|
96 */ |
|
97 void SetOptionsL( const RPointerArray<TDesC>& aOptions, const RArray<TBool>& aSelections ); |
|
98 |
|
99 private: // new functions |
|
100 CSisxSifUiSelectionCache(); |
|
101 void ConstructL(); |
|
102 |
|
103 private: // data |
|
104 TBool iLanguageCached; |
|
105 TLanguage iLanguage; |
|
106 TDriveUnit iDrive; |
|
107 RPointerArray<HBufC> iOptions; |
|
108 RArray<TBool> iSelections; |
|
109 }; |
|
110 |
|
111 |
|
112 #endif // C_SISXSIFUISELECTIONCACHE_H |
|
113 |
|