|
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: Calendar Lunar Plugin (Test code) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CALENLUNARPLUGIN_H__ |
|
21 #define __CALENLUNARPLUGIN_H__ |
|
22 |
|
23 //SYSTEM INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <ecom.h> |
|
26 #include <ConeResLoader.h> |
|
27 |
|
28 //CALENDAR INCLUDES |
|
29 #include <calencommandhandler.h> |
|
30 #include <calennotificationhandler.h> |
|
31 #include <calenservices.h> |
|
32 #include <eiklabel.h> |
|
33 #include <coecntrl.h> |
|
34 #include <calencustomisation.h> |
|
35 |
|
36 #include "CalendarVariant.hrh" |
|
37 |
|
38 |
|
39 //FORWARD DECLARE |
|
40 class CEikonEnv; |
|
41 class CCalenLunarInfoProvider; |
|
42 class CCalenLunarLocalizer; |
|
43 class CCalenLunarLocalizedInfo; |
|
44 class CEikLabel; |
|
45 class MCalenPreview; |
|
46 |
|
47 |
|
48 //CLASS DECLARATION |
|
49 NONSHARABLE_CLASS(CCalenLunarChinesePlugin) : public CCalenCustomisation, |
|
50 public MCalenCommandHandler, |
|
51 public MCalenNotificationHandler |
|
52 |
|
53 { |
|
54 public: |
|
55 |
|
56 static CCalenLunarChinesePlugin* NewL( MCalenServices* aServices ); |
|
57 virtual ~CCalenLunarChinesePlugin(); |
|
58 |
|
59 private: |
|
60 CCalenLunarChinesePlugin( MCalenServices* aServices); |
|
61 void ConstructL(); |
|
62 |
|
63 public: //From CCalenCustomisation |
|
64 void GetCustomViewsL( RPointerArray<CCalenView>& aCustomViewArray ); |
|
65 void GetCustomSettingsL( RPointerArray<CAknSettingItem>& aCustomSettingArray ); |
|
66 CCoeControl* InfobarL( const TRect& aRect ); |
|
67 const TDesC& InfobarL(); |
|
68 MCalenPreview* CustomPreviewPaneL( TRect& aRect ); |
|
69 CCoeControl* PreviewPaneL( TRect& aRect ); |
|
70 MCalenCommandHandler* CommandHandlerL( TInt aCommand ); |
|
71 void RemoveViewsFromCycle( RArray<TInt>& aViews ); |
|
72 TBool CustomiseMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
73 TBool CanBeEnabledDisabled(); |
|
74 TAny* CalenCustomisationExtensionL( TUid aExtensionUid ); |
|
75 |
|
76 public:// From MCalenCommandHandler |
|
77 TBool HandleCommandL( const TCalenCommand& aCommand ); |
|
78 TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid ); |
|
79 |
|
80 public://From MCalenNotificationHandler |
|
81 void HandleNotification( const TCalenNotification aNotification ); |
|
82 |
|
83 private: |
|
84 void SetLabelContentL( CEikLabel& aLabel ,const TRect& aRect); |
|
85 void SetLabelContentExtraL( CEikLabel& aLabel, TRect& aRect); |
|
86 void FormatExtraRowStringL( CEikLabel& aLabel,TBool aTwoLines); |
|
87 void UpdateLocalizerInfoL(); |
|
88 void ExecuteMessageDialogL( TDesC& aMsgText ); |
|
89 |
|
90 public: |
|
91 void ShowDetailsL(); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * Language independent provider of lunar calendar information |
|
97 */ |
|
98 CCalenLunarInfoProvider* iInfoProvider; |
|
99 |
|
100 /** |
|
101 * Language specific localizer of lunar calendar information |
|
102 */ |
|
103 CCalenLunarLocalizer* iLocalizer; |
|
104 |
|
105 /** |
|
106 * Localized lunar info for currently focused day |
|
107 */ |
|
108 CCalenLunarLocalizedInfo* iLocInfo; |
|
109 |
|
110 /** |
|
111 * Currently displayed text for extra row |
|
112 */ |
|
113 TPtrC iExtraRowText; |
|
114 MCalenServices* iServices; |
|
115 /** |
|
116 * This text object is used for hitchcock |
|
117 * infobar in Month/Day/Week. |
|
118 */ |
|
119 HBufC* iInfoBarText; |
|
120 |
|
121 /** |
|
122 * This control is used in avkon view. |
|
123 */ |
|
124 CEikLabel* iLabelControl; |
|
125 TInt iStart; |
|
126 TInt iEnd; |
|
127 TRect iRect; |
|
128 TInt iResourceFileOffset; |
|
129 |
|
130 }; |
|
131 |
|
132 |
|
133 NONSHARABLE_CLASS(CCalenPluginLabel) : public CEikLabel |
|
134 { |
|
135 public: |
|
136 static CCalenPluginLabel* NewL(CCalenLunarChinesePlugin& iPlugin); |
|
137 |
|
138 private: |
|
139 ~CCalenPluginLabel(); |
|
140 CCalenPluginLabel(CCalenLunarChinesePlugin& iPlugin); |
|
141 void ConstructL(); |
|
142 |
|
143 private: //CCoeControl |
|
144 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
145 void Draw( const TRect& aRect) const; |
|
146 |
|
147 private: |
|
148 CCalenLunarChinesePlugin& iPlugin; |
|
149 |
|
150 }; |
|
151 |
|
152 #endif //__CALENLUNARPLUGIN_H__ |
|
153 |
|
154 |
|
155 |
|
156 |