|
1 /* |
|
2 * Copyright (c) 2007 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: Encapsulates message subscriptions. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MPXSUBSCRIPTION_H |
|
21 #define MPXSUBSCRIPTION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <mpxmedia.h> |
|
25 #include <mpxmediaarray.h> |
|
26 |
|
27 /** |
|
28 * MPX subscription item class. |
|
29 * |
|
30 * #defined to CMPXMedia for now. |
|
31 */ |
|
32 typedef CMPXMedia CMPXSubscriptionItem; |
|
33 |
|
34 /** |
|
35 * A subscription instance includes one or more subscription items. |
|
36 * An MPX client can have one or more subscriptions. |
|
37 * |
|
38 * @lib MPXCommon.lib |
|
39 */ |
|
40 class CMPXSubscription : |
|
41 public CMPXMedia |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Two phased constructor. |
|
46 * |
|
47 * @since S60 3.2.3 |
|
48 * @return New CMPXSubscription instance. |
|
49 */ |
|
50 IMPORT_C static CMPXSubscription* NewL(); |
|
51 |
|
52 /** |
|
53 * Two phased constructor. |
|
54 * |
|
55 * @since S60 3.2.3 |
|
56 * @param aMediaArray Subscription item array to initialize with. |
|
57 * @return New CMPXSubscription instance. |
|
58 */ |
|
59 IMPORT_C static CMPXSubscription* NewL(CMPXMediaArray& aMediaArray); |
|
60 |
|
61 /** |
|
62 * Adds a new subscription item to the subscription. |
|
63 * |
|
64 * @since S60 3.2.3 |
|
65 * @param aItem Subscription item to add. |
|
66 */ |
|
67 IMPORT_C void AddItemL(const CMPXSubscriptionItem& aItem); |
|
68 |
|
69 /** |
|
70 * Returns the subscription item array. |
|
71 * |
|
72 * @since S60 3.2.3 |
|
73 * @leave KErrNoMemory if out of memory |
|
74 * @return subsription items array |
|
75 */ |
|
76 IMPORT_C const CMPXMediaArray* ItemsL() const; |
|
77 |
|
78 /** |
|
79 * Comparison operator. |
|
80 * |
|
81 * @since S60 3.2.3 |
|
82 * @param aSubscription subscription to compare with |
|
83 */ |
|
84 IMPORT_C TBool operator==(const CMPXSubscription& aSubscription) const; |
|
85 |
|
86 /** |
|
87 * Prints the subscription. |
|
88 * |
|
89 * @since S60 3.2.3 |
|
90 */ |
|
91 void DebugPrint() const; |
|
92 |
|
93 private: |
|
94 /** |
|
95 * Third phase constructor. |
|
96 * |
|
97 * @since S60 3.2.3 |
|
98 */ |
|
99 void InitializeL(); |
|
100 |
|
101 /** |
|
102 * Third phase constructor. |
|
103 * |
|
104 * @since S60 3.2.3 |
|
105 * @param aMediaArray Subscription item array to initialize with. |
|
106 */ |
|
107 void InitializeL(CMPXMediaArray& aMediaArray); |
|
108 }; |
|
109 |
|
110 #endif // MPXSUBSCRIPTION_H |