|
1 /* |
|
2 * Copyright (c) 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: Editor for invite creation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCAINVITEEDITOR_H |
|
20 #define CCAINVITEEDITOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <badesca.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MCAInviteConflictResolver; |
|
28 class MCAServerContactsArrayPC; |
|
29 class MCAInviteEditorPC; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Editor for invite creation. |
|
36 * |
|
37 * @lib chatng.app |
|
38 * @since 1.2 |
|
39 */ |
|
40 class CCAInviteEditor : public CBase |
|
41 { |
|
42 public: // Enums |
|
43 |
|
44 enum TInviteResult // result of invitation |
|
45 { |
|
46 ECreationCancelled = 1, |
|
47 EInviteCancelled, |
|
48 ERecipientAcceptedInvite, |
|
49 ERecipientCancelledInvite |
|
50 }; |
|
51 |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @param aGroup Reference of GroupId |
|
57 * @return Instance of this class |
|
58 */ |
|
59 static CCAInviteEditor* NewL( const TDesC& aGroup ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @param aGroup Reference of GroupId |
|
64 * @return Instance of this class |
|
65 */ |
|
66 static CCAInviteEditor* NewLC( const TDesC& aGroup ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CCAInviteEditor(); |
|
72 |
|
73 public: // New methods |
|
74 |
|
75 /** |
|
76 * Creates and sends invitation |
|
77 * @param aResolver for conflicts with banned users. |
|
78 * @param aReceiver Receiver of invitation. If not given, then user |
|
79 * will be asked for recipient. |
|
80 * @return Did system managed to create and send invitation |
|
81 */ |
|
82 TBool CreateAndSendInvitation( MCAInviteConflictResolver& aResolver, |
|
83 const TDesC& aReceiver = KNullDesC |
|
84 ); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * Populates list of wvids to whom user can send invitation |
|
90 * @param aInviteList List of user-ids |
|
91 * @param aRawOnlineList Raw data online-list |
|
92 * @param aSelectionArray Array of selected indexes |
|
93 */ |
|
94 void PopulateInviteListL( CDesCArray& aInviteList, |
|
95 const MCAServerContactsArrayPC& aRawOnlineList, |
|
96 const CArrayFixFlat<TInt>& aSelectionArray ); |
|
97 |
|
98 /** |
|
99 * Gets online friends from Presence API and fetch nicknames also |
|
100 * for contact ID's from Storage. |
|
101 * @return contacts array with wvid's and nicknames |
|
102 */ |
|
103 MCAServerContactsArrayPC* GetOnlineFriendsLC(); |
|
104 |
|
105 /** |
|
106 * Queries invitation message |
|
107 * Ownership is transferred to caller |
|
108 * @return Message |
|
109 */ |
|
110 HBufC* QueryInviteMessageL(); |
|
111 |
|
112 /** |
|
113 * Shows error note |
|
114 */ |
|
115 void ShowErrorNoteL(); |
|
116 |
|
117 private: |
|
118 /** |
|
119 * C++ default constructor. |
|
120 * @param aInviteAPI Reference to invite API |
|
121 * @param aPresenceAPI Reference to presence API |
|
122 */ |
|
123 CCAInviteEditor( ); |
|
124 |
|
125 /** |
|
126 * By default Symbian OS constructor is private. |
|
127 * @param aGroup GroupId |
|
128 */ |
|
129 void ConstructL( const TDesC& aGroup ); |
|
130 |
|
131 /** |
|
132 * "Real" logic for creating and sending invitation |
|
133 */ |
|
134 void CreateAndSendInvitationL( MCAInviteConflictResolver& aResolver, |
|
135 const TDesC& aReceiver = KNullDesC |
|
136 ); |
|
137 |
|
138 private: // Data |
|
139 // Owns. |
|
140 HBufC* iGroupID; |
|
141 |
|
142 // Own's iInviteEditorPC |
|
143 MCAInviteEditorPC* iInviteEditorPC; |
|
144 }; |
|
145 |
|
146 #endif // CCAINVITEEDITOR_H |
|
147 |
|
148 // End of File |