|
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: Interface for Calendar customisation plugins |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENCUSTOMISATION_H |
|
19 #define CALENCUSTOMISATION_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <ecom/ecom.h> |
|
24 |
|
25 // Constants |
|
26 const TUid KCalenCustomisationInterfaceUid = { 0x1028336F }; |
|
27 |
|
28 // Forward declarations |
|
29 class CCalenView; |
|
30 class MCalenServices; |
|
31 class MCalenCommandHandler; |
|
32 class CAknSettingItem; |
|
33 class CCoeControl; |
|
34 class TRect; |
|
35 class CEikMenuPane; |
|
36 class MCalenPreview; |
|
37 |
|
38 /** |
|
39 * @class CCalenCustomisation |
|
40 * @brief Base class for creating customised calendar plugins. |
|
41 */ |
|
42 class CCalenCustomisation : public CBase |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * @brief Creates the implementation with UID aUid |
|
48 * |
|
49 * @param aUid Interface uid |
|
50 * @param aServices Services API which are exposed to plugins. |
|
51 * @return CCalenCustomisation Pointer to created plugin |
|
52 */ |
|
53 static CCalenCustomisation* CreateImplementationL( TUid aUid, MCalenServices* aServices ); |
|
54 |
|
55 /** |
|
56 * @brief Default C++ destructor |
|
57 */ |
|
58 virtual ~CCalenCustomisation(); |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * @brief Gets the list of views provided/supported by the plugin in aCustomViewArray |
|
64 * |
|
65 * @param aCustomViewArray The array containing all the views supplied by the plugin, of type CCalenView |
|
66 */ |
|
67 virtual void GetCustomViewsL( RPointerArray<CCalenView>& aCustomViewArray ) =0; |
|
68 |
|
69 /** |
|
70 * @brief Gets the list of settings provided/supported by the plugin in aCustomSettingArray |
|
71 * |
|
72 * @param aCustomSettingArray The array containing all the setting items supplied by the plugin, of type CAknSettingItem |
|
73 */ |
|
74 virtual void GetCustomSettingsL( RPointerArray<CAknSettingItem>& aCustomSettingArray ) =0; |
|
75 |
|
76 /** |
|
77 * @brief Gets the information bar which is to be shown at the top of the calendar views from the plugin |
|
78 * |
|
79 * @param aRect The size of the information bar bar provided to plugin |
|
80 * @return CCoeControl The actual information bar control |
|
81 */ |
|
82 virtual CCoeControl* InfobarL( const TRect& aRect ) =0; |
|
83 |
|
84 /** |
|
85 * @brief Gets the text to be shown inside the information bar from the plugin |
|
86 * |
|
87 * @return TDesC Text to be shown in the information bar |
|
88 */ |
|
89 virtual const TDesC& InfobarL() = 0; |
|
90 |
|
91 /** |
|
92 * Gets the preview pane from the plugin to be shown at the |
|
93 * calendar view. Offers the rectangle for the preview pane, |
|
94 * which it can be used to draw the pane. |
|
95 * |
|
96 * @param aRect The area available for the Preview Pane |
|
97 * @return Preview pane interface |
|
98 */ |
|
99 virtual MCalenPreview* CustomPreviewPaneL( TRect& aRect ) =0; |
|
100 |
|
101 /** |
|
102 * Gets preview pane from plugin to be shown at bottom of calendar views |
|
103 * |
|
104 * @param aRect The size of preview pane provided to plugin. |
|
105 * @return The control of preview pane. |
|
106 */ |
|
107 virtual CCoeControl* PreviewPaneL( TRect& aRect ) =0; |
|
108 |
|
109 /** |
|
110 * @brief Gets the command handler for aCommand. Plugins can choose to handle the command |
|
111 * or ignore it. |
|
112 * |
|
113 * @param aCommand The command id for which the command handler is needed |
|
114 * @return MCalenCommandHandler The command handler to handle aCommand |
|
115 */ |
|
116 virtual MCalenCommandHandler* CommandHandlerL( TInt aCommand ) = 0; |
|
117 |
|
118 /** |
|
119 * @brief Gets the list of view ids to be removed from view cycle |
|
120 * |
|
121 * @param aViews The array of view ids to be removed from view cycle |
|
122 */ |
|
123 virtual void RemoveViewsFromCycle( RArray<TInt>& aViews ) = 0; |
|
124 |
|
125 /** |
|
126 * @brief Adds a menuitem to the menupane specified by aMenuPane |
|
127 * |
|
128 * @param aResourceId The resource id of the menu pane |
|
129 * @param aMenuPane The menupane to which menuitem is added |
|
130 */ |
|
131 virtual TBool CustomiseMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) = 0; |
|
132 |
|
133 /** |
|
134 * @brief Checks whether the plugin can be enabled or disabled from calendar settings |
|
135 * |
|
136 * @return ETrue if plugin can be enabled/disabled from calendar settings, EFalse otherwise |
|
137 */ |
|
138 virtual TBool CanBeEnabledDisabled() = 0; |
|
139 |
|
140 /** |
|
141 * @brief Allows extending this API without breaking BC. |
|
142 * |
|
143 * @param aExtensionUid Specifies the UID of the extenstion |
|
144 * @return TAny Extension of the requested type |
|
145 */ |
|
146 virtual TAny* CalenCustomisationExtensionL( TUid aExtensionUid ) = 0; |
|
147 |
|
148 private: |
|
149 |
|
150 /** |
|
151 * @var iDtor_ID_Key |
|
152 * @brief Instance identifier key. When instance of an implementation is |
|
153 * created by ECOM framework, the framework will assign a UID for |
|
154 * it. The UID is used in the destructor to notify framework that |
|
155 * this instance is being destroyed and resources can be released. |
|
156 * Plugin implementations should leave this untouched, as the inline |
|
157 * destructor and constructor method take care of ECom releasing. |
|
158 */ |
|
159 TUid iDtor_ID_Key; |
|
160 }; |
|
161 |
|
162 #include "calencustomisation.inl" |
|
163 |
|
164 #endif // CALENCUSTOMISATION_H |
|
165 |
|
166 // End of file |