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: Concrete implementation of MGflmItemGroup interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CGFLMITEMGROUPIMPL_H |
|
21 #define CGFLMITEMGROUPIMPL_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "MGflmItemGroup.h" |
|
26 #include <e32std.h> |
|
27 #include <badesca.h> |
|
28 #include <collate.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class RFs; |
|
33 class CGflmDirectoryListingCache; |
|
34 class CGflmFileRecognizer; |
|
35 class CGflmItemLocalizer; |
|
36 class CGflmDriveResolver; |
|
37 class MGflmItemFilter; |
|
38 |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Concrete implementation of MGflmItemGroup interface |
|
44 * |
|
45 * @lib GFLM.lib |
|
46 * @since 2.0 |
|
47 */ |
|
48 NONSHARABLE_CLASS(CGflmItemGroupImpl) : public CBase, public MGflmItemGroup |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @param aId The new id |
|
55 * @param aFss A reference to an open and valid file server session |
|
56 * @param aCache A constructed directory listing cache |
|
57 * @param aRecognizer A constructed file recognizer |
|
58 * @param aLocalizer A constructed item localizer |
|
59 * @param aResolver A constructed drive letter resolver |
|
60 */ |
|
61 static CGflmItemGroupImpl* NewLC( |
|
62 const TInt aId, |
|
63 RFs& aFss, |
|
64 CGflmDirectoryListingCache& aCache, |
|
65 CGflmItemLocalizer& aLocalizer, |
|
66 CGflmDriveResolver& aResolver ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CGflmItemGroupImpl(); |
|
72 |
|
73 public: // New functions |
|
74 |
|
75 /** |
|
76 * Refreshes and reformats the contents of the group |
|
77 * @since 2.0 |
|
78 * @param aFilter MGflmItemFilter object used to to filter the contents |
|
79 * @param aSortMethod Sort method |
|
80 * @param aRefreshMode Refresh mode |
|
81 */ |
|
82 void RefreshL( |
|
83 MGflmItemFilter* aFilter, |
|
84 TGflmSortMethod aSortMethod, |
|
85 TGflmRefreshMode aRefreshMode ); |
|
86 |
|
87 public: // From MGflmItemGroup |
|
88 |
|
89 TInt Id() const; |
|
90 |
|
91 TInt ItemCount() const; |
|
92 |
|
93 CGflmGroupItem* Item( TInt aIndex ); |
|
94 |
|
95 void AddSourceL( const TDesC& aDirectory ); |
|
96 |
|
97 void ResetSources(); |
|
98 |
|
99 void AddActionItemL( TInt aId, const TDesC& aCaption ); |
|
100 |
|
101 void SetInclusion( TUint aInclusion ); |
|
102 |
|
103 const TCollationMethod* CollationMethod(); |
|
104 |
|
105 private: |
|
106 |
|
107 /** |
|
108 * Constructor. |
|
109 * @param aId The new id |
|
110 * @param aFss A reference to an open and valid file server session |
|
111 * @param aCache A constructed directory listing cache |
|
112 * @param aLocalizer A constructed item localizer |
|
113 * @param aResolver A constructed drive letter resolver |
|
114 */ |
|
115 CGflmItemGroupImpl( |
|
116 const TInt aId, |
|
117 RFs& aFss, |
|
118 CGflmDirectoryListingCache& aCache, |
|
119 CGflmItemLocalizer& aLocalizer, |
|
120 CGflmDriveResolver& aResolver ); |
|
121 |
|
122 void ConstructL(); |
|
123 |
|
124 void PopulateReferenceListL( MGflmItemFilter* aFilter ); |
|
125 |
|
126 private: // Data |
|
127 |
|
128 // Id of the group |
|
129 TInt iId; |
|
130 |
|
131 // Reference to an open fileserver session |
|
132 RFs& iFss; |
|
133 |
|
134 // Inclusion type |
|
135 TUint iInclusion; |
|
136 |
|
137 // Contains (and owns) static items (action items and symbolic |
|
138 // links) of this group |
|
139 RPointerArray< CGflmGroupItem > iStaticItems; |
|
140 |
|
141 // Contains (and owns) volatile items (information aquired from |
|
142 // the filesystem) of this group |
|
143 RPointerArray< CGflmGroupItem > iVolatileItems; |
|
144 |
|
145 // Contains the same items as iStaticItems and iVolatileItems, |
|
146 // but doesn't own them |
|
147 RPointerArray< CGflmGroupItem > iItemReferences; |
|
148 |
|
149 // Directory name |
|
150 HBufC* iDirectory; |
|
151 |
|
152 // Reference to a CGflmDirectoryListingCache object. Not owned. |
|
153 CGflmDirectoryListingCache& iListingCache; |
|
154 |
|
155 // Reference to an CGflmItemLocalizer object. Not owned. |
|
156 CGflmItemLocalizer& iItemLocalizer; |
|
157 |
|
158 // Reference to an CGflmDriveResolver object. Not owned. |
|
159 CGflmDriveResolver& iDriveResolver; |
|
160 |
|
161 // Used collation method |
|
162 TCollationMethod iSortCollationMethod; |
|
163 |
|
164 }; |
|
165 |
|
166 #endif // CGFLMITEMGROUPIMPL_H |
|
167 |
|
168 // End of File |
|