|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: |
|
15 * This class implements the behavior of an anchor element. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef WMLBROWSERBMOTABINSENDER_H |
|
20 #define WMLBROWSERBMOTABINSENDER_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 // System includes |
|
25 #include <e32base.h> |
|
26 #include <bldvariant.hrh> |
|
27 |
|
28 // User includes |
|
29 //#include "WmlBrowserBuild.h" |
|
30 |
|
31 |
|
32 |
|
33 #include "BmOTABinSender.h" |
|
34 |
|
35 // FORWARD DECLARATION |
|
36 class CSendUi; |
|
37 class CMessageData; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * The class for implementing the CBookmarkOTAItem. |
|
43 * Item is binary encoded in WBXML format. |
|
44 * |
|
45 * @lib Browser.app |
|
46 * @since Series 60 1.2 |
|
47 */ |
|
48 class CBookmarkOTAItem : public CBase |
|
49 { |
|
50 friend class CWmlBrowserBmOTABinSender; |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. Leaves on failure. |
|
56 * @param aURL is URL of the bookmark or current card's URL address |
|
57 * @param aTitle is title of the bookmark or title of the current card's URL address |
|
58 * @return new Bookmark OTA item |
|
59 */ |
|
60 static CBookmarkOTAItem* NewL( const TDesC& aURL, |
|
61 const TDesC& aTitle ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CBookmarkOTAItem(); |
|
67 |
|
68 protected: |
|
69 |
|
70 /** |
|
71 * Constructor. |
|
72 */ |
|
73 CBookmarkOTAItem(); |
|
74 |
|
75 /** |
|
76 * Second phase constructor. Leaves on failure. |
|
77 * Encode input params to binary WBXML format. |
|
78 * @since Series 60 1.2 |
|
79 * @param aURL is URL of the bookmark or current card's URL address |
|
80 * @param aTitle is title of the bookmark or title of the current card's URL address |
|
81 */ |
|
82 void ConstructL( const TDesC& aURL, const TDesC& aTitle ); |
|
83 |
|
84 protected: // data |
|
85 |
|
86 /** |
|
87 * Binary encoded bookmark in WBXML format |
|
88 */ |
|
89 HBufC *iBookmark; |
|
90 }; |
|
91 |
|
92 /** |
|
93 * The class for implementing the CWmlBrowserBmOTABinSender. |
|
94 * |
|
95 * @lib Browser.app |
|
96 * @since Series 60 1.2 |
|
97 */ |
|
98 class CWmlBrowserBmOTABinSender : public CBase, public MBmOTABinSender |
|
99 { |
|
100 public : // public construction |
|
101 |
|
102 /** |
|
103 * Two-phased constructor. Leaves on failure. |
|
104 */ |
|
105 static CWmlBrowserBmOTABinSender* NewL(); |
|
106 |
|
107 /** |
|
108 * Destructor. |
|
109 */ |
|
110 virtual ~CWmlBrowserBmOTABinSender(); |
|
111 |
|
112 public: // from MBmOTABinSender |
|
113 |
|
114 /** |
|
115 * Reset and destroy bookmark list. |
|
116 * @since Series 60 1.2 |
|
117 */ |
|
118 void ResetAndDestroy(); |
|
119 |
|
120 /** |
|
121 * Add bookmark title and URL to be sent |
|
122 * this class will destroy passed objects. |
|
123 * @since Series 60 1.2 |
|
124 * @param aURL bookmark's URL |
|
125 * @param aTitle bookmark's title can be Null |
|
126 */ |
|
127 void AppendL( const TText *aURL, const TText *aTitle = NULL ); |
|
128 |
|
129 /** |
|
130 * Add bookmark title and URL to be sent |
|
131 * this class will destroy passed objects. |
|
132 * @since Series 60 1.2 |
|
133 * @param aURL bookmark's URL |
|
134 * @param aTitle bookmark's title |
|
135 */ |
|
136 void AppendL( const TDesC& aURL, const TDesC& aTitle ); |
|
137 |
|
138 /** |
|
139 * Sends all the bookmarks added with AddL(). |
|
140 * @since Series 60 1.2 |
|
141 */ |
|
142 void SendAddressL( ); |
|
143 |
|
144 /** |
|
145 * Sends an OPML file. |
|
146 * @since Series 60 3.2 |
|
147 */ |
|
148 virtual void SendOPMLFileL(const TDesC& aOPMLFile); |
|
149 |
|
150 protected: // construction |
|
151 |
|
152 /** |
|
153 * Second phase constructor. Leaves on failure. |
|
154 */ |
|
155 void ConstructL(); |
|
156 |
|
157 /** |
|
158 * Constructor. |
|
159 */ |
|
160 CWmlBrowserBmOTABinSender(); |
|
161 |
|
162 private: // new methods |
|
163 |
|
164 /** |
|
165 * Creates a new attachment file for BT and IRī. |
|
166 * @since Series 60 1.2 |
|
167 * @param fs Already connected file session |
|
168 * @param aBody body of the message |
|
169 * @return system error code or KErrNone |
|
170 */ |
|
171 TInt WriteMessageBodyIntoFileL( RFs &fs, TDesC& aBody ); |
|
172 |
|
173 private: // data |
|
174 |
|
175 /// List of bookmarks to be sent. Owned. |
|
176 CArrayPtrFlat<CBookmarkOTAItem> iBookmarks; |
|
177 |
|
178 /// Pointer to SendUi. Owned. |
|
179 CSendUi* iSendUi; |
|
180 }; |
|
181 |
|
182 |
|
183 #endif // WMLBROWSERBMOTABINSENDER_H |
|
184 // End of File |