|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CATALOGSSMSSESSION_H |
|
20 #define C_CATALOGSSMSSESSION_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "catalogssmssession.h" |
|
25 |
|
26 |
|
27 class MCatalogsSmsOperation; // SMS operation |
|
28 class MCatalogsSmsObserver; // SMS observer |
|
29 class CCatalogsTransport; // Catalogs Transport |
|
30 |
|
31 |
|
32 class CCatalogsSmsSession : public CBase, public MCatalogsSmsSession |
|
33 { |
|
34 public: // Constructors & Destructor |
|
35 |
|
36 /** |
|
37 * Creator |
|
38 * |
|
39 * @param aSessionId Session ID |
|
40 * @param aOwner Owning object |
|
41 */ |
|
42 static CCatalogsSmsSession* NewL( TInt32 aSessionId, |
|
43 CCatalogsTransport& aOwner ); |
|
44 |
|
45 /** |
|
46 * Destructor |
|
47 */ |
|
48 ~CCatalogsSmsSession(); |
|
49 |
|
50 |
|
51 public: // From MCatalogsSmsSession |
|
52 |
|
53 TInt AddRef(); |
|
54 |
|
55 TInt Release(); |
|
56 |
|
57 TInt RefCount() const; |
|
58 |
|
59 /** |
|
60 * Creates a new SMS operation and starts it |
|
61 * @param aRecipient Recipient's address |
|
62 * @param aBody Message body |
|
63 * @param aObserver Observer for SMS events. Default: NULL |
|
64 * @return A new SMS operation that sends the given message |
|
65 */ |
|
66 MCatalogsSmsOperation* CreateSmsL( const TDesC& aRecipient, |
|
67 const TDesC& aBody, MCatalogsSmsObserver* aObserver ); |
|
68 |
|
69 |
|
70 /** |
|
71 * Returns the SMS operation that matches the given id or returns |
|
72 * NULL if no such operation was found. |
|
73 * |
|
74 * @param aId Operation ID |
|
75 * |
|
76 * @return SMS operation that matches the ID or NULL |
|
77 */ |
|
78 MCatalogsSmsOperation* SmsOperation( |
|
79 const TCatalogsTransportOperationId& aId ) const; |
|
80 |
|
81 |
|
82 /** |
|
83 * Returns an array of the session's SMS operations |
|
84 * @return Array of currently existing SMS operations |
|
85 */ |
|
86 const RCatalogsSmsOperationArray& CurrentSmsOperations() const; |
|
87 |
|
88 |
|
89 public: // From MCatalogsTransportSession |
|
90 |
|
91 /** |
|
92 * Session ID getter |
|
93 * |
|
94 * @return Session ID |
|
95 */ |
|
96 TInt32 SessionId() const; |
|
97 |
|
98 |
|
99 /** |
|
100 * Session type getter |
|
101 * |
|
102 * @return Session type |
|
103 */ |
|
104 TInt SessionType() const; |
|
105 |
|
106 |
|
107 public: // New operations |
|
108 |
|
109 /** |
|
110 * Removes the operation from the session. |
|
111 * Called by the operation's destructor |
|
112 */ |
|
113 void RemoveOperation( MCatalogsSmsOperation* aOperation ); |
|
114 |
|
115 |
|
116 protected: |
|
117 |
|
118 /** |
|
119 * Constructor |
|
120 */ |
|
121 CCatalogsSmsSession( TInt32 aSessionId, CCatalogsTransport& aOwner ); |
|
122 |
|
123 |
|
124 private: |
|
125 |
|
126 CCatalogsTransport& iOwner; |
|
127 TInt32 iSessionId; |
|
128 |
|
129 // Current operations |
|
130 RCatalogsSmsOperationArray iOperations; |
|
131 TInt iRefCount; |
|
132 TInt32 iNextId; |
|
133 TBool iRemoveAll; |
|
134 }; |
|
135 |
|
136 |
|
137 #endif // C_CATALOGSSMSSESSION_H |