1 /* |
|
2 * Copyright (c) 2002-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: Navigable file list model |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CGFLMNAVIGATORMODEL_H |
|
21 #define CGFLMNAVIGATORMODEL_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "CGflmFileListModel.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CGflmDriveItem; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Decorates the file list model with navigator functionality |
|
36 * |
|
37 * @lib GFLM.lib |
|
38 * @since 2.0 |
|
39 */ |
|
40 class CGflmNavigatorModel : public CGflmFileListModel |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 IMPORT_C static CGflmNavigatorModel* NewL( RFs& aFs ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CGflmNavigatorModel(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Sets the navigator's basepath to a given directory |
|
58 * @since 2.0 |
|
59 * @param aPath A descriptor containing the directory to enter |
|
60 * @param aBackstepping If false the backstepping stack is reset |
|
61 */ |
|
62 IMPORT_C void GoToDirectoryL( const TDesC& aPath, |
|
63 TBool aBackstepping = ETrue ); |
|
64 |
|
65 /** |
|
66 * Sets the navigator's basepath to a given directory and |
|
67 * constructs a backstepping stack that leads from the base path |
|
68 * to the top path one intermediate directory at a time |
|
69 * @since 2.0 |
|
70 * @param aBasePath A descriptor containing the base path |
|
71 * @param aTopPath A descriptor containing the directory to enter |
|
72 */ |
|
73 IMPORT_C void GoToDirectoryL( const TDesC& aBasePath, |
|
74 const TDesC& aTopPath ); |
|
75 |
|
76 /** |
|
77 * Navigates one step backwards. |
|
78 * @since 2.0 |
|
79 */ |
|
80 IMPORT_C void BackstepL(); |
|
81 |
|
82 /** |
|
83 * Returns the current navigation directory |
|
84 * @since 2.0 |
|
85 * @return A pointer descriptor containing the current navigation |
|
86 * directory. |
|
87 */ |
|
88 IMPORT_C TPtrC CurrentDirectory() const; |
|
89 |
|
90 /** |
|
91 * Returns the localized name of the current navigation directory |
|
92 * @since 2.0 |
|
93 * @return A pointer descriptor containing the localized name |
|
94 * of the current navigation directory. |
|
95 */ |
|
96 IMPORT_C TPtrC LocalizedNameOfCurrentDirectory() const; |
|
97 |
|
98 /** |
|
99 * Returns the current navigation level, the depth of backstep stack |
|
100 * @since 2.0 |
|
101 * @return Current navigation level |
|
102 */ |
|
103 IMPORT_C TInt NavigationLevel() const; |
|
104 |
|
105 /** |
|
106 * Obtains a pointer to current drive (not own). |
|
107 * @since 3.1 |
|
108 * @return Pointer to current drive or NULL. |
|
109 */ |
|
110 IMPORT_C CGflmDriveItem* CurrentDrive() const; |
|
111 |
|
112 private: |
|
113 |
|
114 /** |
|
115 * C++ default constructor. |
|
116 */ |
|
117 CGflmNavigatorModel( RFs& aFs ); |
|
118 |
|
119 /** |
|
120 * By default Symbian 2nd phase constructor is private. |
|
121 */ |
|
122 void ConstructL(); |
|
123 |
|
124 /** |
|
125 * Sets the navigator's base directory |
|
126 * @since 2.0 |
|
127 * @param aDirectory The new base directory |
|
128 */ |
|
129 void SetBaseDirectoryL( const TDesC& aDirectory ); |
|
130 |
|
131 void SetSourceL( const TDesC& aSource ); |
|
132 |
|
133 TBool IsValidSource( const TDesC& aSource ) const; |
|
134 |
|
135 private: // Data |
|
136 |
|
137 // An dynamic array holding backstepping information |
|
138 CDesCArraySeg* iBackstepStack; |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // CGFLMNAVIGATORMODEL_H |
|
143 |
|
144 // End of File |
|