|
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 // |
|
15 |
|
16 #include <bookmark.h> |
|
17 #include "bkmrk.h" |
|
18 #include "bkmrkfolder.h" |
|
19 |
|
20 /** |
|
21 RBkBookmark constructor |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 EXPORT_C RBkBookmark::RBkBookmark() : RBkNode() |
|
26 { |
|
27 } |
|
28 |
|
29 /** |
|
30 Method to query whether this bookmark is the home page |
|
31 |
|
32 @return ETrue if this bookmark is the home page |
|
33 @publishedPartner |
|
34 @released |
|
35 */ |
|
36 EXPORT_C TBool RBkBookmark::IsHomePage() |
|
37 { |
|
38 return Bookmark()->IsHomePage(); |
|
39 } |
|
40 |
|
41 /** |
|
42 Returns the last visited time for this bookmark |
|
43 @return The time this bookmark was last visited |
|
44 @publishedPartner |
|
45 @released |
|
46 */ |
|
47 EXPORT_C TTime RBkBookmark::LastVisited() const |
|
48 { |
|
49 return Bookmark()->LastVisited(); |
|
50 } |
|
51 |
|
52 /** |
|
53 Sets the last visited time for this bookmark to the time specified. |
|
54 This function is intended to only be used for managing bookmarks, and will leave if not called in Management mode. |
|
55 Use RBkBookmark::UpdateVisited() to set the last-modified time to the current time. |
|
56 |
|
57 @param aTime The new visited time |
|
58 @leave KErrPermissionDenied This function will leave when the bookmark database is not opened as |
|
59 Bookmark::EVisibilityManager. |
|
60 @publishedPartner |
|
61 @released |
|
62 @see RBkBookmark::UpdateVisited |
|
63 */ |
|
64 EXPORT_C void RBkBookmark::SetLastVisitedL(TTime aTime) |
|
65 { |
|
66 CBookmark* bookmark = Bookmark (); |
|
67 bookmark->LeaveIfNotInManagerModeL (); |
|
68 bookmark->SetLastVisited ( aTime ); |
|
69 } |
|
70 |
|
71 /** |
|
72 Sets the last visited time to be the current time |
|
73 |
|
74 @publishedPartner |
|
75 @released |
|
76 */ |
|
77 EXPORT_C void RBkBookmark::UpdateVisited() |
|
78 { |
|
79 Bookmark()->UpdateVisited(); |
|
80 } |
|
81 |
|
82 /** |
|
83 Returns the assigned authentication object. This object is based on the bookmark's URI |
|
84 |
|
85 @return A reference to the bookmark's authentication object. |
|
86 @publishedPartner |
|
87 @released |
|
88 */ |
|
89 EXPORT_C const CAuthentication& RBkBookmark::AuthenticationL() |
|
90 { |
|
91 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
92 return properties.AuthenticationL(); |
|
93 } |
|
94 |
|
95 /** |
|
96 Set the bookmark's authentication object. |
|
97 |
|
98 @param aAuthentication Reference to a new authentication object |
|
99 @publishedPartner |
|
100 @released |
|
101 */ |
|
102 EXPORT_C void RBkBookmark::SetAuthenticationL(const CAuthentication& aAuthentication) |
|
103 { |
|
104 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
105 properties.SetAuthenticationL(aAuthentication); |
|
106 } |
|
107 |
|
108 /** |
|
109 Method for getting the bookmark's Uri |
|
110 |
|
111 @return Descriptor containing the Uri. |
|
112 @publishedPartner |
|
113 @released |
|
114 */ |
|
115 EXPORT_C const TDesC8& RBkBookmark::Uri() const |
|
116 { |
|
117 return Bookmark()->Uri(); |
|
118 } |
|
119 /** |
|
120 Method for setting the bookmark's Uri |
|
121 |
|
122 @param aUri Descriptor containing the new Uri |
|
123 @publishedPartner |
|
124 @released |
|
125 */ |
|
126 EXPORT_C void RBkBookmark::SetUriL(const TDesC8& aUri) |
|
127 { |
|
128 Bookmark()->SetUriL(aUri); |
|
129 } |
|
130 |
|
131 /** |
|
132 Method for getting the bookmark's proxy. The proxy will be set to the default proxy when |
|
133 CBookmark is first created |
|
134 @return Id for identifying the proxy entry in the commdb |
|
135 @publishedPartner |
|
136 @released |
|
137 */ |
|
138 EXPORT_C TUint32 RBkBookmark::ProxyL() const |
|
139 { |
|
140 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
141 return properties.Proxy(); |
|
142 } |
|
143 |
|
144 /** |
|
145 Method for setting the bookmark's proxy. |
|
146 |
|
147 @param aProxy Id for identifying the proxy entry in the commdb |
|
148 @publishedPartner |
|
149 @released |
|
150 */ |
|
151 EXPORT_C void RBkBookmark::SetProxyL(TUint32 aProxy) |
|
152 { |
|
153 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
154 properties.SetProxyL(aProxy); |
|
155 } |
|
156 |
|
157 /** |
|
158 Method for getting the bookmark's nap. |
|
159 |
|
160 @return Id for identifying the nap entry in the commdb |
|
161 @publishedPartner |
|
162 @released |
|
163 */ |
|
164 EXPORT_C TUint32 RBkBookmark::GetNapL() const |
|
165 { |
|
166 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
167 return properties.Nap(); |
|
168 } |
|
169 |
|
170 /** |
|
171 Method for setting the bookmark's nap. |
|
172 |
|
173 @param aNap Id for identifying the nap entry in the commdb |
|
174 @publishedPartner |
|
175 @released |
|
176 */ |
|
177 EXPORT_C void RBkBookmark::SetNapL(TUint32 aNap) |
|
178 { |
|
179 CBkmrkExtendedProperties& properties = Bookmark()->BkmrkExtendedPropertiesL(); |
|
180 properties.SetNapL(aNap); |
|
181 } |
|
182 |
|
183 /** |
|
184 This method is an internal utility method for converting the objects item pointer |
|
185 to the correct type. It is not intended for external use. |
|
186 |
|
187 @internalComponent |
|
188 */ |
|
189 CBookmark* RBkBookmark::Bookmark() const |
|
190 { |
|
191 // The handle must be open and attached to a concrete bookmark object |
|
192 __ASSERT_ALWAYS(iItem, User::Panic(Bookmark::KBookmarkErrHandleNotOpen, Bookmark::KErrNotOpen)); |
|
193 |
|
194 return static_cast<CBookmark*>(iItem); |
|
195 } |
|
196 |
|
197 |