|
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: Directory entry container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CRSFWDIRENT_H |
|
20 #define CRSFWDIRENT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // CONSTANTS |
|
26 |
|
27 // DATA TYPES |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CRsfwDirEntAttr; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * Directory entry container |
|
35 * |
|
36 * @lib rsfwcommon.lib |
|
37 * @since Series 60 3.1 |
|
38 */ |
|
39 class CRsfwDirEnt: public CBase |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor |
|
45 * @param aName name of the entry |
|
46 * @param aAttr attributes - if this parameter is NULL, |
|
47 * an attribute object with attribute values set to zero will be created. |
|
48 * The entry takes ownership of the attribute object. |
|
49 */ |
|
50 IMPORT_C static CRsfwDirEnt* NewLC(const TDesC& aName, CRsfwDirEntAttr* aAttr); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor |
|
54 * @param aName name of the entry |
|
55 * @param aAttr attributes - if this parameter is NULL, |
|
56 * an attribute object with attribute values set to zero will be created. |
|
57 * The entry takes ownership of the attribute object. |
|
58 */ |
|
59 IMPORT_C static CRsfwDirEnt* NewLC(const TDesC8& aName, CRsfwDirEntAttr* aAttr); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @param aName name of the entry |
|
64 * @param aAttr attributes - if this parameter is NULL, |
|
65 * an attribute object with attribute values set to zero will be created. |
|
66 * The entry takes ownership of the attribute object. |
|
67 */ |
|
68 IMPORT_C static CRsfwDirEnt* NewL(const TDesC& aName, CRsfwDirEntAttr* aAttr); |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 * @param aName name of the entry |
|
73 * @param aAttr attributes - if this parameter is NULL, |
|
74 * an attribute object with attribute values set to zero will be created. |
|
75 * The entry takes ownership of the attribute object. |
|
76 */ |
|
77 IMPORT_C static CRsfwDirEnt* NewL(const TDesC8& aName, CRsfwDirEntAttr* aAttr); |
|
78 |
|
79 CRsfwDirEnt(); |
|
80 |
|
81 IMPORT_C ~CRsfwDirEnt(); |
|
82 |
|
83 /** |
|
84 * Gets the name of the filesystem object |
|
85 * @return pointer to the name |
|
86 */ |
|
87 IMPORT_C const HBufC* Name() const; |
|
88 |
|
89 /** |
|
90 * Gets the name of the filesystem object |
|
91 * @param aName name |
|
92 */ |
|
93 IMPORT_C void GetName(TDes& aName) const; |
|
94 |
|
95 /** |
|
96 * Gets the name of the filesystem object |
|
97 * @param aName name |
|
98 */ |
|
99 IMPORT_C void GetName(TDes8& aName) const; |
|
100 |
|
101 /** |
|
102 * Sets the name of the filesystem object |
|
103 * @param aName name |
|
104 */ |
|
105 IMPORT_C void SetNameL(const TDesC& aName); |
|
106 |
|
107 /** |
|
108 * Sets the name of the filesystem object |
|
109 * @param aName name |
|
110 */ |
|
111 IMPORT_C void SetNameL(const TDesC8& aName); |
|
112 |
|
113 /** |
|
114 * Returns a pointer to the filesystem object's attributes |
|
115 * @return pointer to the attributes |
|
116 */ |
|
117 IMPORT_C CRsfwDirEntAttr* Attr() const; |
|
118 |
|
119 /** |
|
120 * Returns a pointer to the filesystem object's attributes |
|
121 * The ownership to the attribute object is transferred to the caller |
|
122 * @return pointer to the attributes |
|
123 */ |
|
124 IMPORT_C CRsfwDirEntAttr* ExtractAttr(); |
|
125 |
|
126 /** |
|
127 * Sets the attribute object for the directory entry. |
|
128 * The pre-existing attribute object is deleted (if owned by the entry). |
|
129 * The directory entry gets ownership of the new attribute object. |
|
130 * If the aAttr parameter is NULL, |
|
131 * an attribute object with default values is created. |
|
132 * @param pointer to the attribute object |
|
133 */ |
|
134 IMPORT_C void SetAttrL(CRsfwDirEntAttr* aAttr); |
|
135 |
|
136 private: |
|
137 void ConstructL(const TDesC& aName, CRsfwDirEntAttr* aAttr); |
|
138 void Construct8L(const TDesC8& aName, CRsfwDirEntAttr* aAttr); |
|
139 |
|
140 private: |
|
141 HBufC* iName; // name |
|
142 CRsfwDirEntAttr* iAttr; // attributes |
|
143 TBool iNotOwnAttr; // we do not own the attributes (extracted) |
|
144 }; |
|
145 |
|
146 #endif // CRSFWDIRENT_H |
|
147 |
|
148 // End of File |