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: Setting item for browser settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPWAPBROWSERITEM_H |
|
20 #define CWPWAPBROWSERITEM_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MWPVisitor.h> |
|
25 #include <favouritesdb.h> |
|
26 #include "CWPWAPItemBAse.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MWPWAPItemBase; |
|
30 class CBookmarkDb; |
|
31 class RCmManagerExt; |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * CWPWAPBrowserItem handles one browser setting. |
|
36 * |
|
37 * @lib WPWAPAdapter |
|
38 * @since 2.0 |
|
39 */ |
|
40 |
|
41 |
|
42 class CWPWAPBrowserItem : public CWPWAPItemBase |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aFirst ETrue if this browser item is first |
|
49 * @param aTitle Title for browser items |
|
50 * @param aBookmarkTitle Title for bookmark items |
|
51 * @param aDefaultName Default name for browser items |
|
52 * @param aDefaultBookmarkName Default name for bookmarks. |
|
53 * @param aCharacteristic The APPLICATION characteristic |
|
54 * @param aCommsDb The CommsDB to use. Created if NULL. |
|
55 * @param aAPHandler The APEngine data handler to use. Created if NULL. |
|
56 * @param aBookmarkDb The bookmark database to use. Created if NULL. |
|
57 * @return CWPWAPBrowserItem instance |
|
58 */ |
|
59 static CWPWAPBrowserItem* NewL( TBool aFirst, |
|
60 const TDesC& aTitle, |
|
61 const TDesC& aBookmarkTitle, |
|
62 const TDesC& aDefaultName, |
|
63 const TDesC& aDefaultBookmarkName, |
|
64 CWPCharacteristic& aCharacteristic, |
|
65 CCommsDatabase*& aCommsDb, |
|
66 RCmManagerExt*& aCmManager, |
|
67 RFavouritesDb aBookmarkDb |
|
68 ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 ~CWPWAPBrowserItem(); |
|
74 |
|
75 public: // From CWPMMSItemBase |
|
76 |
|
77 TBool CanSetAsDefault() const; |
|
78 void SaveL(); |
|
79 void SetAsDefaultL(); |
|
80 TBool ValidateL(); |
|
81 void ResourceL( CWPCharacteristic& aResource ); |
|
82 void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, |
|
83 RPointerArray<MWPWAPItemBase>& aHiddenItems ); |
|
84 |
|
85 private: // New functions |
|
86 /** |
|
87 * C++ default constructor. |
|
88 * @see CWPWAPBrowserItem::NewL() for description of parameters. |
|
89 */ |
|
90 CWPWAPBrowserItem( TBool aFirst, |
|
91 const TDesC& aTitle, |
|
92 const TDesC& aBookmarkTitle, |
|
93 const TDesC& aDefaultName, |
|
94 const TDesC& aDefaultBookmarkName, |
|
95 CWPCharacteristic& aCharacteristic, |
|
96 CCommsDatabase*& aCommsDb, |
|
97 RCmManagerExt*& aCmManager, |
|
98 RFavouritesDb aBookmarkDb |
|
99 ); |
|
100 |
|
101 /** |
|
102 * By default Symbian 2nd phase constructor is private. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 private: |
|
107 // The bookmarks. Owns. |
|
108 RPointerArray<MWPWAPItemBase> iBookmarks; |
|
109 |
|
110 // The default name for bookmarks. |
|
111 const TDesC& iDefaultBookmarkName; |
|
112 |
|
113 // The title for bookmarks |
|
114 const TDesC& iBookmarkTitle; |
|
115 |
|
116 RFavouritesDb iDb; |
|
117 |
|
118 // ETrue if this browser item is first in list. |
|
119 TBool iFirst; |
|
120 }; |
|
121 |
|
122 #endif // CWPWAPBROWSERITEM_H |
|
123 |
|
124 // End of File |
|