|
1 /* |
|
2 * Copyright (c) 2005-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: Date publisher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AIDATEPUBLISHER_H |
|
20 #define C_AIDATEPUBLISHER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <coemain.h> |
|
24 #include "aidevicestatuspublisher.h" |
|
25 #include "aidevicestatuscontentmodel.h" |
|
26 |
|
27 class MAiDeviceStatusContentObserver; |
|
28 class MAiPropertyExtension; |
|
29 class CEnvironmentChangeNotifier; |
|
30 |
|
31 /** |
|
32 * @ingroup group_devicestatusplugin |
|
33 * |
|
34 * Date publisher. |
|
35 * |
|
36 * Publishes current date formatted according to current locale if profile |
|
37 * if either general or offline. |
|
38 * |
|
39 * @since S60 3.2 |
|
40 */ |
|
41 class CAiDatePublisher : public CBase, public MAiDeviceStatusPublisher |
|
42 { |
|
43 public: |
|
44 |
|
45 static CAiDatePublisher* NewL(); |
|
46 |
|
47 virtual ~CAiDatePublisher(); |
|
48 |
|
49 protected: |
|
50 |
|
51 // from base class MAiDeviceStatusPublisher |
|
52 |
|
53 void ResumeL(); |
|
54 void Subscribe( MAiContentObserver& aObserver, |
|
55 MAiPropertyExtension& aExtension, |
|
56 MAiPublishPrioritizer& aPrioritizer, |
|
57 MAiPublisherBroadcaster& aBroadcaster ); |
|
58 void RefreshL( TBool aClean ); |
|
59 TBool RefreshL( TInt aContentId, TBool aClean ); |
|
60 |
|
61 private: |
|
62 |
|
63 CAiDatePublisher(); |
|
64 |
|
65 void ConstructL(); |
|
66 |
|
67 /// Re-publish date |
|
68 void RefreshDateL(); |
|
69 |
|
70 /// Create day name string |
|
71 HBufC* GetDayNameStringLC( TDay aDay, CCoeEnv& aCoeEnv ); |
|
72 |
|
73 /// Create date string |
|
74 HBufC* ConstructDateStringL(); |
|
75 |
|
76 /// Callback when enviroment changed. |
|
77 static TInt HandleCallBackL( TAny *aPtr ); |
|
78 |
|
79 |
|
80 |
|
81 protected: // data |
|
82 |
|
83 /** |
|
84 * Content observer. |
|
85 * Not own. |
|
86 */ |
|
87 MAiContentObserver* iContentObserver; |
|
88 |
|
89 /** |
|
90 * Property extension. |
|
91 * Not own. |
|
92 */ |
|
93 MAiPropertyExtension* iExtension; |
|
94 |
|
95 /** |
|
96 * Content prioritizer. |
|
97 * Not own. |
|
98 */ |
|
99 MAiPublishPrioritizer* iPrioritizer; |
|
100 |
|
101 /** |
|
102 * Environment notifier. |
|
103 * own. |
|
104 */ |
|
105 CEnvironmentChangeNotifier* iEnvNotifier; |
|
106 |
|
107 /** |
|
108 * Constructed date text. |
|
109 * Own. |
|
110 */ |
|
111 HBufC* iDateText; |
|
112 |
|
113 }; |
|
114 |
|
115 |
|
116 #endif // C_AIDATEPUBLISHER_H |