|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Classes for manipulating bookmarks and bookmark folders. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedPartner |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef __BOOKMARK_H__ |
|
25 #define __BOOKMARK_H__ |
|
26 |
|
27 #include <bookmarkdef.h> |
|
28 #include <cauthentication.h> |
|
29 |
|
30 class CBookmarkBase; |
|
31 class CBookmark; |
|
32 class CBookmarkFolder; |
|
33 class CBkmrkProperties; |
|
34 class RBkBookmark; |
|
35 class RBkFolder; |
|
36 |
|
37 /** |
|
38 RBkNode is the base class for RBkBookmark and RBkFolder handle classes. |
|
39 Bookmarks and folders have many attributes in common. This class encapulates these |
|
40 elements and provides the implementation for accessing and setting them. It is also |
|
41 used when iterating through a folders child list where you can't know in advance |
|
42 whether the item is a bookmark or folder. A RBkNode can be passed as a parameter |
|
43 when opening RBkBookmark and RBkFolder handles once you know the RBkNode's type |
|
44 @publishedPartner |
|
45 @released |
|
46 */ |
|
47 class RBkNode |
|
48 { |
|
49 public: |
|
50 IMPORT_C RBkNode(); |
|
51 IMPORT_C void Close(); |
|
52 |
|
53 IMPORT_C Bookmark::TType Type() const; |
|
54 IMPORT_C Bookmark::TItemId Id() const; |
|
55 IMPORT_C RBkFolder OpenParentL() const; |
|
56 IMPORT_C RBkBookmark OpenBookmarkL() const; |
|
57 IMPORT_C RBkFolder OpenFolderL() const; |
|
58 IMPORT_C void SetParentL(RBkFolder& aNewParent); |
|
59 |
|
60 IMPORT_C const TDesC& Title() const; |
|
61 IMPORT_C void SetTitleL(const TDesC& aTitle); |
|
62 |
|
63 IMPORT_C const TDesC& DescriptionL() const; |
|
64 IMPORT_C void SetDescriptionL(const TDesC& aDescription); |
|
65 |
|
66 IMPORT_C TBool IsPublic() const; |
|
67 IMPORT_C void SetPublicL(TBool aPublic); |
|
68 |
|
69 IMPORT_C TBool IsWritable() const; |
|
70 IMPORT_C void SetWritableL(TBool aWritable); |
|
71 |
|
72 IMPORT_C TSecureId OwnerL() const; |
|
73 IMPORT_C void SetOwnerL(TSecureId aOwner = Bookmark::KNoOwnerId); |
|
74 |
|
75 IMPORT_C Bookmark::TAttachmentId IconIdL() const; |
|
76 IMPORT_C void SetIconIdL(Bookmark::TAttachmentId aIconId = Bookmark::KNullAttachmentID); |
|
77 |
|
78 IMPORT_C void GetCustomPropertyL(TUid aPropertyId, TInt& aValue) const; |
|
79 IMPORT_C void GetCustomPropertyL(TUid aPropertyId, TReal& aValue) const; |
|
80 IMPORT_C void GetCustomPropertyL(TUid aPropertyId, TDes& aValue) const; |
|
81 IMPORT_C void GetCustomPropertyL(TUid aPropertyId, TDes8& aValue) const; |
|
82 IMPORT_C void SetCustomPropertyL(TUid aPropertyId, TInt aValue); |
|
83 IMPORT_C void SetCustomPropertyL(TUid aPropertyId, TReal aValue) __SOFTFP; |
|
84 IMPORT_C void SetCustomPropertyL(TUid aPropertyId, const TDesC& aValue); |
|
85 IMPORT_C void SetCustomPropertyL(TUid aPropertyId, const TDesC8& aValue); |
|
86 |
|
87 IMPORT_C void SetLastModifiedL ( const TTime& aTime ); |
|
88 IMPORT_C TTime LastModifiedL () const; |
|
89 |
|
90 // not exported |
|
91 CBookmarkBase* Item() const; |
|
92 void SetItem(CBookmarkBase& aItem); |
|
93 CBkmrkProperties* ExtendedPropertiesL() const; |
|
94 |
|
95 private: |
|
96 void LeaveIfRootL() const; |
|
97 |
|
98 static void DeleteBkmrkItem ( TAny* aPtr ); |
|
99 protected: |
|
100 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
101 /** |
|
102 @internalComponent |
|
103 */ |
|
104 #endif//SYMBIAN_ENABLE_SPLIT_HEADERS |
|
105 CBookmarkBase* iItem; // The internal bookmark item that this handle is connected to |
|
106 }; |
|
107 |
|
108 |
|
109 /** |
|
110 The bookmark tree maintained by the database is made up to folders containing bookmarks. |
|
111 The RBkBookmark class is a handle to a bookmark in the database. |
|
112 The RBkDatabase handle will return an RBkBookmark handle to you when you |
|
113 create a new bookmark or on a call to OpenBookmarkL(). As with all items in the database, |
|
114 the client application never owns the bookmark item itself. All actions are performed |
|
115 through this handle. |
|
116 @publishedPartner |
|
117 @released |
|
118 */ |
|
119 class RBkBookmark: public RBkNode |
|
120 { |
|
121 public: |
|
122 IMPORT_C RBkBookmark(); |
|
123 |
|
124 IMPORT_C TBool IsHomePage(); |
|
125 IMPORT_C TTime LastVisited() const; |
|
126 IMPORT_C void SetLastVisitedL(TTime aTime); |
|
127 IMPORT_C void UpdateVisited(); |
|
128 |
|
129 IMPORT_C const CAuthentication& AuthenticationL(); |
|
130 IMPORT_C void SetAuthenticationL(const CAuthentication& aAuthentication); |
|
131 |
|
132 IMPORT_C const TDesC8& Uri() const; |
|
133 IMPORT_C void SetUriL(const TDesC8& aUri); |
|
134 |
|
135 IMPORT_C TUint32 ProxyL() const; |
|
136 IMPORT_C void SetProxyL(TUint32 aProxy); |
|
137 |
|
138 IMPORT_C TUint32 GetNapL() const; |
|
139 IMPORT_C void SetNapL(TUint32 aNap); |
|
140 |
|
141 // not exported |
|
142 CBookmark* Bookmark() const; |
|
143 }; |
|
144 |
|
145 |
|
146 /** |
|
147 The bookmark tree maintained by the database is made up to folders containing bookmarks. |
|
148 The RBkFolder class is a handle to a bookmark folder. Bookmark folders contain a list |
|
149 of children which can be bookmarks or other folders. As with all items in the database, |
|
150 the client application never owns the folder item itself. All actions are performed |
|
151 through this handle. |
|
152 @publishedPartner |
|
153 @released |
|
154 */ |
|
155 class RBkFolder: public RBkNode |
|
156 { |
|
157 public: |
|
158 IMPORT_C RBkFolder(); |
|
159 |
|
160 IMPORT_C void AppendL(RBkNode& aItem); |
|
161 IMPORT_C void InsertL(RBkNode& aItem, TInt aIndexPosition); |
|
162 IMPORT_C TInt Move(TInt aOldPosition, TInt aNewPosition); |
|
163 IMPORT_C TInt Count() const; |
|
164 IMPORT_C TInt Index(const RBkNode& aItem) const; |
|
165 IMPORT_C RBkNode OpenItemL(TInt aIndex); |
|
166 |
|
167 // not exported |
|
168 CBookmarkFolder* Folder() const; |
|
169 }; |
|
170 |
|
171 #endif //__BOOKMARK_H__ |