|
1 /* |
|
2 * Copyright (c) 2007 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: List-box model class for Simulation PSY file selector dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_SIMPSYFILESELECTORMODEL_H |
|
20 #define C_SIMPSYFILESELECTORMODEL_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <bamdesca.h> |
|
25 |
|
26 /** |
|
27 * List-box model class for Simulation PSY file selector dialog. |
|
28 * |
|
29 * This class provides the implementation of the list-box model for Simulation |
|
30 * PSY file selector model. The class loads all the available Simulation PSY |
|
31 * files present in the system and allows the configure one of the Simulation |
|
32 * files for obtaining simulated Location information. |
|
33 * |
|
34 * @lib simpsyui.exe |
|
35 * @since S60 v3.2 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CSimPsyFileSelectorModel ) : public MDesCArray |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Constructs a new instance of Simulation PSY file selector list |
|
42 * box model. |
|
43 * |
|
44 * @return The new instance of list-box model object. |
|
45 * @leave System wide error code if the object creation fails. |
|
46 */ |
|
47 static CSimPsyFileSelectorModel* NewL(); |
|
48 |
|
49 /** |
|
50 * C++ Destructor. |
|
51 * Frees all the resources associated with this object. |
|
52 */ |
|
53 virtual ~CSimPsyFileSelectorModel(); |
|
54 |
|
55 /** |
|
56 * Returns the simulation file name corresponding to the |
|
57 * selected item. |
|
58 * |
|
59 * @param aIndex Index of the item whose file name is requested |
|
60 * @return TPtrC File name at the requested index |
|
61 */ |
|
62 TPtrC SimulationFileNameL( TInt aIndex ); |
|
63 |
|
64 public: // Inherited from Base classes |
|
65 /** |
|
66 * Inherited from MDesCArray |
|
67 */ |
|
68 virtual TInt MdcaCount() const; |
|
69 |
|
70 /** |
|
71 * Inherited from MDesCArray |
|
72 */ |
|
73 virtual TPtrC16 MdcaPoint( TInt aIndex ) const; |
|
74 |
|
75 private: |
|
76 /** |
|
77 * Overloaded constructor |
|
78 */ |
|
79 CSimPsyFileSelectorModel(); |
|
80 |
|
81 /** |
|
82 * Second phase of the two phase constructor |
|
83 */ |
|
84 void ConstructL(); |
|
85 |
|
86 /** |
|
87 * Gets the correct file path |
|
88 */ |
|
89 void GetCorrectPathL( TFileName& aFilePath ); |
|
90 |
|
91 /** |
|
92 * Appends all the sps and nmea files in the specified |
|
93 * path to the Filename array |
|
94 */ |
|
95 void AppendFileL( const TDesC& aDir ); |
|
96 |
|
97 private: // data |
|
98 |
|
99 /** |
|
100 * Buffer for packing the MdcaPoint |
|
101 * |
|
102 * Owns |
|
103 */ |
|
104 HBufC16* iBuffer; |
|
105 |
|
106 /** |
|
107 * Simulation PSY File names |
|
108 */ |
|
109 RArray< TFileName > iFileNameArray; |
|
110 }; |
|
111 |
|
112 #endif // C_SIMPSYFILESELECTORMODEL_H |