|
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: class to publish the data into widget |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CSERVICEWIDGETCONTENTPUBLISHER_H |
|
21 #define CSERVICEWIDGETCONTENTPUBLISHER_H |
|
22 |
|
23 #include <liwservicehandler.h> |
|
24 #include <LiwVariant.h> |
|
25 #include <LiwGenericParam.h> |
|
26 #include "servicewidgetcpglobals.h" |
|
27 #include "mservicewidgetobservers.h" |
|
28 |
|
29 class MServiceWidgetEventObserver; |
|
30 |
|
31 /** |
|
32 * @class servicewidgetdatapubliser |
|
33 * @since 5.0 |
|
34 */ |
|
35 class CServiceWidgetContentPublisher: public CBase, |
|
36 public MLiwNotifyCallback |
|
37 { |
|
38 |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CServiceWidgetContentPublisher* NewL(MServiceWidgetEventObserver& aObserver); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CServiceWidgetContentPublisher* NewLC(MServiceWidgetEventObserver& aObserver); |
|
51 |
|
52 /** |
|
53 * @function ~CServiceWidgetContentPublisher |
|
54 * @discussion Destroy the object and release all memory objects |
|
55 */ |
|
56 ~CServiceWidgetContentPublisher(); |
|
57 |
|
58 |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * publish the text with given details and actions |
|
64 * @param aPublisherId, publisher id |
|
65 * @param aInstId, Instance id |
|
66 * @paramconst aOwnTextToAdd Own text (updated in first row) |
|
67 * @paramconst aStatusTextToAdd status text (updated in second row) |
|
68 * @param aBitmapHandle image handle to add |
|
69 * @param aMaskHandle, image mask handle to add |
|
70 */ |
|
71 void PublishDataWithActionL( const TDesC& aPublisherId, |
|
72 const TDesC& aInstId, |
|
73 const TDesC& aOwnTextToAdd, |
|
74 const TDesC& aStatusTextToAdd, |
|
75 TInt aBitmapHandle, |
|
76 TInt aMaskHandle, |
|
77 TInt sericonbitmapHandle, |
|
78 TInt sericonmaskHandle |
|
79 ); |
|
80 |
|
81 |
|
82 /** |
|
83 * Notifies event from widget (from CPS) |
|
84 * @param aCmdId, cmd id |
|
85 * @param aEventParamList |
|
86 * @param aInParamList |
|
87 */ |
|
88 virtual TInt HandleNotifyL(TInt aCmdId, TInt /*aEventId*/, |
|
89 CLiwGenericParamList& aEventParamList, |
|
90 const CLiwGenericParamList& aInParamList); |
|
91 |
|
92 |
|
93 /** |
|
94 * Unregister widget from CPS |
|
95 * @param aPublisherId, publisher id |
|
96 */ |
|
97 void UnregisterWidgetL(const TDesC& aPublisherId ); |
|
98 |
|
99 /** |
|
100 * Register widget from CPS |
|
101 * @param aPublisherId, publisher id |
|
102 */ |
|
103 void RegisterWidgetL(const TDesC& aPublisherId, |
|
104 TInt aBitmapHandle, |
|
105 TInt aMaskHandle ); |
|
106 |
|
107 /** |
|
108 * Remove data from widget |
|
109 * @param aPublisherId, publisher id |
|
110 */ |
|
111 void RemoveWidgetDataL(const TDesC& aPublisherId,const TDesC& aInstId ); |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * @function ConstructL |
|
117 * @discussion Perform the second phase construction of a CServiceWidgetContentPublisher object |
|
118 * this needs to be public due to the way the framework constructs the AppUi |
|
119 */ |
|
120 void ConstructL(); |
|
121 |
|
122 /** |
|
123 *@function CServiceWidgetContentPublisher |
|
124 * @discussion Perform the first phase of two phase construction. |
|
125 * This needs to be public due to the way the framework constructs the AppUi |
|
126 */ |
|
127 CServiceWidgetContentPublisher(MServiceWidgetEventObserver& aObserver); |
|
128 |
|
129 /** |
|
130 * GetMessagingInterfaceL get interface from liw |
|
131 */ |
|
132 MLiwInterface* GetMessagingInterfaceL( ); |
|
133 |
|
134 private: // data |
|
135 |
|
136 MServiceWidgetEventObserver& iObserver; |
|
137 // owns : message interface to liw |
|
138 MLiwInterface* iMsgInterface; |
|
139 // owns : liw service handler |
|
140 CLiwServiceHandler* iServiceHandler; |
|
141 }; |
|
142 |
|
143 #endif // CSERVICEWIDGETCONTENTPUBLISHER_H |
|
144 |