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: One bookmark item in browser settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPWAPBOOKMARKITEM_H |
|
20 #define CWPWAPBOOKMARKITEM_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MWPVisitor.h> |
|
25 #include <FavouritesDb.h> |
|
26 #include <FavouritesSession.h> |
|
27 #include "CWPWAPItemBAse.h" |
|
28 |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CBookmarkDb; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CWPWAPBookmarkItem handles one bookmark item in browser settings. |
|
37 * |
|
38 * @lib WPWAPAdapter |
|
39 * @since 2.0 |
|
40 */ |
|
41 class CWPWAPBookmarkItem : public CBase, public MWPWAPItemBase, private MWPVisitor |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 * @param aTitle The title to be returned in Name(). |
|
48 * @param aDefaultName The default name for bookmarks. |
|
49 * @param aCharacteristic The RESOURCE characteristic. |
|
50 * @param aLink Link to NAPDEF |
|
51 * @param aDb The bookmark database to use. Created if NULL. |
|
52 * @return CWPWAPBookmarkItem instance |
|
53 */ |
|
54 static CWPWAPBookmarkItem* NewL( const TDesC& aTitle, |
|
55 const TDesC& aDefaultName, |
|
56 CWPCharacteristic& aCharacteristic, |
|
57 CWPCharacteristic*& aLink, |
|
58 RFavouritesDb aDb ); |
|
59 |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 ~CWPWAPBookmarkItem(); |
|
65 |
|
66 public: // From MWPMMSItemBase |
|
67 |
|
68 const TDesC& Name() const; |
|
69 const TDesC& Title() const; |
|
70 TBool CanSetAsDefault() const; |
|
71 void SaveL(); |
|
72 void SetAsDefaultL(); |
|
73 TBool ValidateL(); |
|
74 void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, |
|
75 RPointerArray<MWPWAPItemBase>& aHiddenItems ); |
|
76 const TDesC8& SaveData() const; |
|
77 const TDesC& Address() const; |
|
78 |
|
79 public: // From MWPVisitor |
|
80 |
|
81 void VisitL(CWPCharacteristic& aCharacteristic); |
|
82 void VisitL(CWPParameter& aParameter); |
|
83 void VisitLinkL(CWPCharacteristic& aCharacteristic ); |
|
84 |
|
85 private: // New functions |
|
86 /** |
|
87 * C++ constructor. |
|
88 * @param aTitle The title to be returned in Name(). |
|
89 * @param aDefaultName The default name for bookmarks. |
|
90 * @param aLink Link to access point |
|
91 * @param aDb The bookmark database to use. Created if NULL. |
|
92 */ |
|
93 CWPWAPBookmarkItem( const TDesC& aTitle, |
|
94 const TDesC& aDefaultName, |
|
95 CWPCharacteristic*& aLink, |
|
96 RFavouritesDb aDb ); |
|
97 |
|
98 /** |
|
99 * By default Symbian 2nd phase constructor is private. |
|
100 * @param aCharacteristic The RESOURCE characteristic |
|
101 * to scan. |
|
102 */ |
|
103 void ConstructL( CWPCharacteristic& aCharacteristic ); |
|
104 |
|
105 /** |
|
106 * Create the bookmarks db. |
|
107 */ |
|
108 void CreateDbL(); |
|
109 |
|
110 private: |
|
111 // The title for bookmark items |
|
112 const TDesC& iTitle; |
|
113 |
|
114 // The default name for bookmarks. |
|
115 const TDesC& iDefaultName; |
|
116 |
|
117 // The access point characteristic. Refs. |
|
118 CWPCharacteristic*& iLink; |
|
119 |
|
120 // The name of the bookmark |
|
121 TPtrC iName; |
|
122 |
|
123 // The URI of the bookmark |
|
124 TPtrC iURI; |
|
125 |
|
126 // Startpage parameter |
|
127 TBool iHasStartPage; |
|
128 |
|
129 RFavouritesDb iBookmarkDb; |
|
130 RFavouritesSession iSession; |
|
131 |
|
132 // Access point uid. |
|
133 TUint32 iUID; |
|
134 |
|
135 // UIDs of the saved items |
|
136 TPckgBuf<TWPWAPSaveItem> iSaveItem; |
|
137 }; |
|
138 |
|
139 #endif // CWPWAPBOOKMARKITEM_H |
|
140 |
|
141 // End of File |
|