1 /* |
|
2 * Copyright (c) 2002-2004 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: This file contains the header file of the CSisxUIStartupFile |
|
15 * class. |
|
16 * |
|
17 * CSisxUIStartupFile provides functions to access the special |
|
18 * startup control files. |
|
19 * |
|
20 * During the installation, the startup constrol file is copied to |
|
21 * private import directory of the installer process. This class |
|
22 * is used to process entries from that file. When entried have |
|
23 * been processed, the file is moved to private directory. |
|
24 * |
|
25 */ |
|
26 |
|
27 |
|
28 #ifndef SISXUISTARTUPFILE_H |
|
29 #define SISXUISTARTUPFILE_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> |
|
33 |
|
34 namespace SwiUI |
|
35 { |
|
36 |
|
37 class TStartupTaskParam; |
|
38 |
|
39 /** |
|
40 * Provides functions to access the special startup control files. |
|
41 * |
|
42 * @lib sisxui |
|
43 * @since 3.0 |
|
44 */ |
|
45 class CSisxUIStartupFile : public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * @since 3.0 |
|
52 * @param aUid - Uid of the package, whose startup file this class |
|
53 * will represent. |
|
54 */ |
|
55 static CSisxUIStartupFile* NewL( const TUid& aUid ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CSisxUIStartupFile(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Checks if new startup file exists in the import directory. |
|
66 * @since 3.0 |
|
67 * @return ETrue, EFalse. |
|
68 */ |
|
69 TBool NewFileExists(); |
|
70 |
|
71 /** |
|
72 * Checks if old, processed startup file exists in the private directory. |
|
73 * @since 3.0 |
|
74 * @return ETrue, EFalse. |
|
75 */ |
|
76 TBool PrivateFileExists(); |
|
77 |
|
78 /** |
|
79 * Read new startup file and process it's definitions. Creates a new private file |
|
80 * based on the resource file and returns all new startup items. |
|
81 * @since 3.0 |
|
82 * @param aStartupItems - On return contains all startup items found from the |
|
83 * startup file. |
|
84 * @param aFiles - Array of file names, which are part of the pakcage. |
|
85 * @return On success KErrNone, otherwise one of the system wide error codes. |
|
86 */ |
|
87 TInt ProcessNewFile( RArray<TStartupTaskParam>& aStartupItems, |
|
88 const RPointerArray<HBufC>& aFiles ); |
|
89 |
|
90 /** |
|
91 * Deletes the old startup file from private directory and returns all startup |
|
92 * items in that file. |
|
93 * @since 3.0 |
|
94 * @param aStartupItems - On return contains all startup items found from the |
|
95 * startup file. |
|
96 * @param aFiles - Array of file names, which are part of the pakcage. |
|
97 * @return On success KErrNone, otherwise one of the system wide error codes. |
|
98 */ |
|
99 TInt RemovePrivateFile( RArray<TStartupTaskParam>& aStartupItems ); |
|
100 |
|
101 /** |
|
102 * Deletes all startup resource files from import directory. |
|
103 * @since 3.0 |
|
104 * @return On success KErrNone, otherwise one of the system wide error codes. |
|
105 */ |
|
106 static TInt ClearAllNewFiles(); |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 * Constructor. |
|
112 */ |
|
113 CSisxUIStartupFile(); |
|
114 |
|
115 /** |
|
116 * 2nd phase constructor. |
|
117 * @param aUid - Uid of the package, whose startup file this class |
|
118 * will represent. |
|
119 */ |
|
120 void ConstructL( const TUid& aUid ); |
|
121 |
|
122 /** |
|
123 * Read new resource file and construct startup items from there. |
|
124 * @since 3.0 |
|
125 * @param aStartupItems - On return contains all startup items found from the |
|
126 * startup file. |
|
127 * @param aFiles - Array of file names, which are part of the pakcage. |
|
128 */ |
|
129 void ReadNewStartupItemsL( RArray<TStartupTaskParam>& aStartupItems, |
|
130 const RPointerArray<HBufC>& aFiles ); |
|
131 |
|
132 /** |
|
133 * Read startup items from private file. |
|
134 * @since 3.0 |
|
135 * @param aStartupItems - On return contains all startup items found from the |
|
136 * startup file. |
|
137 */ |
|
138 void ReadPrivateStartupItemsL( RArray<TStartupTaskParam>& aStartupItems ); |
|
139 |
|
140 /** |
|
141 * Write startup items into private file. |
|
142 * @since 3.0 |
|
143 * @param aStartupItems - The startup items to be written to the private file. |
|
144 */ |
|
145 void WritePrivateStartupItemsL( RArray<TStartupTaskParam>& aStartupItems ); |
|
146 |
|
147 private: // Data |
|
148 |
|
149 HBufC* iPrivateFile; |
|
150 HBufC* iNewFile; |
|
151 |
|
152 RFs iFileSession; |
|
153 TFileName iTemp; |
|
154 }; |
|
155 } |
|
156 |
|
157 #endif // SISXUISTARTUPFILE_H |
|
158 |
|
159 // End of File |
|