|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Holds one default folder entry |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFILEMANAGERFOLDERENTRY_H |
|
20 #define CFILEMANAGERFOLDERENTRY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class TResourceReader; |
|
27 |
|
28 /** |
|
29 * One default folder entry. |
|
30 * Contains fullpath of the default folder and information |
|
31 * is it media folder or nor. |
|
32 * |
|
33 * @lib FileManagerEngine.lib |
|
34 * @since 2.0 |
|
35 */ |
|
36 NONSHARABLE_CLASS(CFileManagerFolderEntry) : public CBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Two-phased constructors. |
|
41 */ |
|
42 static CFileManagerFolderEntry* NewLC( TResourceReader& aReader ); |
|
43 |
|
44 static CFileManagerFolderEntry* NewL( TResourceReader& aReader ); |
|
45 |
|
46 static CFileManagerFolderEntry* NewLC( |
|
47 const TInt aDrive, const TDesC& aPath ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CFileManagerFolderEntry(); |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Is the default folder media folder or not |
|
57 * @since 2.0 |
|
58 * @return ETrue if default folder is media folder, EFalse if not |
|
59 */ |
|
60 TBool IsMediaFolder() const; |
|
61 |
|
62 /** |
|
63 * Returns reference to full path information of default folder |
|
64 * @since 2.0 |
|
65 * @return Reference to default folder full path descriptor. |
|
66 */ |
|
67 TPtrC Name() const; |
|
68 |
|
69 /** |
|
70 * Used for sorting folder entries |
|
71 * @since 3.2 |
|
72 * @param aFirst Reference to the first folder entry |
|
73 * @param aSecond Reference to the second folder entry |
|
74 * @return Comparison result. |
|
75 */ |
|
76 static TInt CompareSort( |
|
77 const CFileManagerFolderEntry& aFirst, |
|
78 const CFileManagerFolderEntry& aSecond ); |
|
79 |
|
80 /** |
|
81 * Used for finding folder from sorted entries |
|
82 * @since 3.2 |
|
83 * @param aPath Path to find |
|
84 * @param aItem Reference to the folder entry |
|
85 * @return Comparison result. |
|
86 */ |
|
87 static TInt CompareFind( |
|
88 const TDesC* aPath, |
|
89 const CFileManagerFolderEntry& aItem ); |
|
90 |
|
91 private: |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CFileManagerFolderEntry(); |
|
96 |
|
97 /** |
|
98 * By default Symbian 2nd phase constructor is private. |
|
99 */ |
|
100 void ConstructFromResourceL( TResourceReader& aReader); |
|
101 |
|
102 /** |
|
103 * By default Symbian 2nd phase constructor is private. |
|
104 */ |
|
105 void ConstructL( const TInt aDrive, const TDesC& aPath ); |
|
106 |
|
107 private: // Date |
|
108 // Own: Full path information of default folder |
|
109 HBufC* iName; |
|
110 |
|
111 // Is the default folder media folder |
|
112 TBool iIsMediaFolder; |
|
113 |
|
114 }; |
|
115 |
|
116 |
|
117 #endif // CFILEMANAGERFOLDERENTRY_H |
|
118 |
|
119 // End of File |