1 /* |
|
2 * Copyright (c) 2008 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: Definition of the class CPbkxRclvCardSender. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBKXRCLVCARDSENDER_H |
|
20 #define CPBKXRCLVCARDSENDER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CPbkContactEngine; |
|
25 class CPbkContactItem; |
|
26 class CBCardEngine; |
|
27 class CSendUi; |
|
28 class CEikonEnv; |
|
29 class CRichText; |
|
30 class CPbkxRclContactConverter; |
|
31 |
|
32 /** |
|
33 * Class that handles sending business card using CSendUI. |
|
34 * |
|
35 * @lib pbkxrclengine.lib |
|
36 * @since 3.1 |
|
37 */ |
|
38 class CPbkxRclvCardSender : public CBase |
|
39 { |
|
40 public: // constructor and destructor |
|
41 |
|
42 /** |
|
43 * Creates new object. |
|
44 * |
|
45 * @param aContactEngine Handle to contact engine. |
|
46 * @return Created object. |
|
47 */ |
|
48 static CPbkxRclvCardSender* NewL( CPbkContactEngine& aContactEngine ); |
|
49 |
|
50 /** |
|
51 * Creates new object. |
|
52 * |
|
53 * Pointer to the created object is left in the cleanupstack. |
|
54 * |
|
55 * @param aContactEngine Handle to contact engine. |
|
56 * @return Created object. |
|
57 */ |
|
58 static CPbkxRclvCardSender* NewLC( CPbkContactEngine& aContactEngine ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CPbkxRclvCardSender(); |
|
64 |
|
65 public: // new methods |
|
66 |
|
67 /** |
|
68 * Send business card of the given contact item. |
|
69 * |
|
70 * @param aContactItem Contact item which is sent as business card. |
|
71 */ |
|
72 void SendvCardL( |
|
73 CPbkContactItem& aContactItem, |
|
74 CPbkxRclContactConverter& aContactConverter ); |
|
75 |
|
76 private: // methods used internally |
|
77 |
|
78 /** |
|
79 * Creates temporary file of the contact item. |
|
80 * |
|
81 * @param aContactItem Contact item. |
|
82 */ |
|
83 void CreateTempFileL( |
|
84 CPbkContactItem& aContactItem, |
|
85 CPbkxRclContactConverter& aContactConverter ); |
|
86 |
|
87 /** |
|
88 * Destroys temporary file. |
|
89 */ |
|
90 void DestroyTempFileL(); |
|
91 |
|
92 /** |
|
93 * Creates rich text object of the temporary file. |
|
94 * |
|
95 * @return Created rich text object. Ownership is transferred. |
|
96 */ |
|
97 CRichText* CreateRichTextFromFileLC(); |
|
98 |
|
99 /** |
|
100 * Creates filter. |
|
101 */ |
|
102 void CreateFilterL(); |
|
103 |
|
104 //<cmail> getting temporary file name is not hard coded |
|
105 /** |
|
106 * Creates a temporary file name on device memory, in private |
|
107 * folder of the process, which loads this dll. |
|
108 * |
|
109 * @param aFileName file name is returned here |
|
110 * @return error code |
|
111 */ |
|
112 TInt GetTemporaryFileNameL( TFileName& aFileName, CPbkContactItem& aContactItem ); |
|
113 //</cmail> |
|
114 |
|
115 private: // constructors |
|
116 |
|
117 /** |
|
118 * Constructor. |
|
119 */ |
|
120 CPbkxRclvCardSender(); |
|
121 |
|
122 /** |
|
123 * Second-phase constructor. |
|
124 * |
|
125 * @param aContactEngine Handle to contact engine. |
|
126 */ |
|
127 void ConstructL( CPbkContactEngine& aContactEngine ); |
|
128 |
|
129 private: // data |
|
130 |
|
131 // Used to send the business card. Owned. |
|
132 CSendUi* iSendUi; |
|
133 |
|
134 // Card engine. Owned. |
|
135 CBCardEngine* iCardEngine; |
|
136 |
|
137 // Filter. Owned. |
|
138 CArrayFixFlat<TUid>* iFilter; |
|
139 |
|
140 // Eikon environment. Not owned. |
|
141 CEikonEnv* iEikEnv; |
|
142 //<cmail> |
|
143 // file name for temporary storage |
|
144 TFileName iTempFileName; |
|
145 //</cmail> |
|
146 |
|
147 }; |
|
148 |
|
149 #endif |
|
150 |
|