organizer_plat/calendar_custamization_api/inc/calenservices.h
branchRCL_3
changeset 66 bd7edf625bdd
child 67 1539a383d7b6
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     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:  Provides services for native Calendar extensions
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALENSERVICES_H
       
    19 #define CALENSERVICES_H
       
    20 
       
    21 // System includes
       
    22 #include <calennotificationhandler.h>
       
    23 #include <w32std.h>
       
    24 #include <calcommon.h>
       
    25 
       
    26 // Forward declarations
       
    27 class CCalEntryView;        // View for accessing calendar entries
       
    28 class CCalInstanceView;     // View for accessing instances of calendar entries
       
    29 class CCalSession;          // Handle to the Calendar file
       
    30 class CCalenServicesImpl;   // Services API implementation
       
    31 class TVwsViewId;           // Identifies an application view
       
    32 class MCalenContext;        // Current calendar focus information
       
    33 class MCalenToolbar;        // Calendar Toolbar
       
    34 class CEikMenuPane;         // A menu pane
       
    35 class TRect;
       
    36 class CCoeControl;
       
    37 class CCalenInterimUtils2;
       
    38 class CGulIcon;
       
    39 class TKeyEvent;
       
    40 class CMissedAlarmStore;
       
    41 class TCalenInstanceId;
       
    42 class CCalenAttachmentModel;
       
    43 class CCalCalendarInfo;
       
    44 class MCalenPreview;
       
    45 
       
    46 /**
       
    47  * @class MCalenServices
       
    48  * @brief Calendar services APIs. This class is not intended for user derivation
       
    49  * Can be used by all the clients to perform some basic Calendar specific services
       
    50  */
       
    51 NONSHARABLE_CLASS( MCalenServices )
       
    52     {
       
    53     public:
       
    54         
       
    55 		/**
       
    56 		 * TCalenIcons
       
    57 		 * The different icons used in Calendar
       
    58 		 */
       
    59 		enum TCalenIcons
       
    60 	        {
       
    61 	        ECalenMarkedTodoIcon,			// Marked To-do icon
       
    62 	        ECalenBirthdayIcon,				//  Birthday icon
       
    63 	        ECalenMeetingIcon,				//  Meeting note icon
       
    64 	        ECalenDaynoteIcon,				//  Day note icon
       
    65 	        ECalenToDoIcon,					//  To-do icon
       
    66 	        ECalenAlarmIcon,				//  Alarm icon
       
    67 	        ECalenRepeatIcon,				//  Repeat icon
       
    68 	        ECalenRepeatExceptionIcon,		//  Repeat exception icon
       
    69 	        ECalenNotePriorityLow,			//  To-do low priority
       
    70 	        ECalenNotePriorityHigh,			//  To-do high priority
       
    71 	        ECalenTodoIconUndone,			//  Undone To-do icon
       
    72 	        ECalenTodoIconDone,				//  Done To-do icon
       
    73 	        ECalenItemNotShownIcon,
       
    74 	        ECalenMonthManyEventIcon,
       
    75 	        ECalenMonthGrayedEventIcon,
       
    76 	        ECalenMonthViewIcon,			// Icon for toolbar buttons
       
    77 	        ECalenWeekViewIcon,				// Icon for toolbar buttons
       
    78 	        ECalenDayViewIcon,				// Icon for toolbar buttons
       
    79 	        ECalenTodoViewIcon,				// Icon for toolbar buttons
       
    80 	        ECalenNewMeetingIcon,			// Icon for toolbar buttons
       
    81 	        ECalenNewTodoIcon,				// Icon for toolbar buttons
       
    82 	        ECalenViewerEditIcon,			// Icon for viewer toolbar buttons
       
    83 	        ECalenViewerDeleteIcon,			// Icon for viewer toolbar buttons
       
    84 	        ECalenViewerSendIcon,			// Icon for viewer toolbar buttons
       
    85 	        ECalenMapIcon,					// Icon for map
       
    86 	        ECalenMeetingIconMissed,		// Icon for missed meeting 
       
    87 	        ECalenBirthdayIconMissed,		// Icon for missed birthdsy  
       
    88 	        ECalenDaynoteIconMissed,		// Icon for missed daynote
       
    89 	        ECalenToDoIconMissed,			// Icon for missed todo
       
    90 	        ECalenClearMissedAlarms,		// Icons for clearing a missed alarm
       
    91 	        ECalenClearAllMissedAlarms,		// Icons for clearing all missed alarms
       
    92 			ECalenNextViewIcon,				// Icon for next view toolbar button
       
    93 			ECalenSyncIcon					// Icon for calendar management view for public/private indication
       
    94         };
       
    95 
       
    96     public:
       
    97 		
       
    98 		/**
       
    99 		 * @brief Retrieves the calendar session currently in use by Calendar
       
   100 		 * It is the default calendar session from the Agenda Model
       
   101 		 * 
       
   102 		 * @return CCalSession& Calendar session currently used by Calendar
       
   103 		 */
       
   104 		virtual CCalSession& SessionL() = 0;
       
   105 
       
   106 		/**
       
   107 		 * @brief Retrieves the calendar session currently in use by aCalendar.
       
   108 		 * 
       
   109 		 * @param aCalendar The calendar name for which the session is required
       
   110 		 * @return CCalSession& Calendar session being used for aCalendar
       
   111 		 */
       
   112         virtual CCalSession& SessionL( const TDesC& aCalendar ) = 0;
       
   113         
       
   114 		/**
       
   115 		 * @brief Retrieves the calendar entry view currently in use by Calendar
       
   116 		 * 
       
   117 		 * @return CCalEntryView* The entry view currently being used by Calendar
       
   118 		 */
       
   119         virtual CCalEntryView* EntryViewL() = 0;
       
   120 
       
   121 		/**
       
   122 		 * @brief Retrieves the calendar entry view currently in use by Calendar specified by aCollectionId
       
   123 		 *
       
   124 		 * @return CCalEntryView* The entry view currently used by Calendar
       
   125 		 */
       
   126         virtual CCalEntryView* EntryViewL( const TCalCollectionId aCollectionId ) = 0;
       
   127         
       
   128         
       
   129 		/**
       
   130 		 * @brief Retrieves the calendar instance view currently in use by Calendar
       
   131 		 * 
       
   132 		 * @return CCalInstanceView* The instance view currently being used by Calendar
       
   133 		 */
       
   134 		virtual CCalInstanceView* InstanceViewL() = 0;
       
   135 
       
   136 		/**
       
   137 		 * @brief Retrieves the calendar instance view currently in use by Calendar/s specified by aCollectionIds
       
   138 		 *
       
   139 		 * @param aCollectionIds The collection id list
       
   140 		 * @return CCalInstanceView* The instance view currently used by Calendar/s
       
   141 		 */
       
   142         virtual CCalInstanceView* InstanceViewL( const RArray<TInt>& aCollectionIds ) = 0;
       
   143 		
       
   144 		/**
       
   145 		 * @brief Retrieves a reference to CCalenInterimUtils2
       
   146 		 * 
       
   147 		 * @return CCalenInterimUitls2& The reference to CCalenInterimUtils2 retrieved
       
   148 		 */
       
   149 		virtual CCalenInterimUtils2& InterimUtilsL() = 0;
       
   150 				
       
   151 		/**
       
   152 		 * @brief Gets the calendar icon specified by aIndex
       
   153 		 * 
       
   154 		 * @param aIndex One of the TCalenIcons
       
   155 		 * @return CGulIcon* The icon corresponding to aIndex
       
   156 		 */
       
   157 		virtual CGulIcon* GetIconL( TCalenIcons aIndex, const TInt aViewId = 0 ) = 0;
       
   158 
       
   159 		/**
       
   160 		 * @brief Register for notifications of Calendar events
       
   161 		 * 
       
   162 		 * @param aHandler The MCalenNotificationHandler to notify
       
   163 		 * @param aNotification Single notification to be notified about
       
   164 		 */
       
   165 		virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
       
   166 												TCalenNotification aNotification ) = 0;
       
   167         
       
   168 		/**
       
   169 		 * @brief Register for notifications of Calendar events
       
   170 		 * 
       
   171 		 * @param aHandler the MCalenNotificationHandler to notify
       
   172 		 * @param aNotifications Array of notifications for which to be notified
       
   173 		 */
       
   174 		virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
       
   175 												RArray <TCalenNotification>& aNotifications ) = 0;
       
   176 
       
   177 		/**
       
   178 		 * @brief Cancel notifications of Calendar events
       
   179 		 * 
       
   180 		 * @param aHandler The MCalenNotificationHandler to stop notifying
       
   181 		 */
       
   182 		virtual void CancelNotifications( MCalenNotificationHandler* aHandler ) = 0;
       
   183 
       
   184 		/**
       
   185 		 * @brief Issues a command to be handled by Calendar or a customization plugin.
       
   186 		 * All commands will be handled asynchronously.  Command may be rejected if invalid or cannot be handled
       
   187 		 * 
       
   188 		 * @param aCommand The command to be handled
       
   189 		 * @return TBool ETrue if Calendar will attempt to handle the command, EFalse otherwise
       
   190 		 */
       
   191         virtual TBool IssueCommandL( TInt aCommand ) = 0;
       
   192 
       
   193 		/**
       
   194 		 * @brief Issues a notification, which will be broadcasted
       
   195 		 * synchronously to all registered notification handlers.
       
   196 		 * Only one notification may be issued at once.
       
   197 		 * 
       
   198 		 * @param aNotification The notification to be broadcasted
       
   199 		 */
       
   200 		virtual void IssueNotificationL( TCalenNotification aNotification ) = 0;
       
   201 
       
   202 		/**
       
   203 		 * @brief Returns the context. This includes information such
       
   204 		 * as the currently focused date/instance
       
   205 		 *
       
   206 		 * @return MCalenContext& The context returned
       
   207 		 */
       
   208 		virtual MCalenContext& Context() = 0;
       
   209 
       
   210 		/**
       
   211 		 * @brief Request the activation of a specific view specified by aViewId
       
   212 		 * 
       
   213 		 * @param aViewId The view to be activated
       
   214 		 */
       
   215 		virtual void RequestActivationL( const TVwsViewId& aViewId )=0;
       
   216 
       
   217 		/**
       
   218 		 * @brief Notify Calendar that a specific view has been activated.
       
   219 		 * Custom views MUST call this on activation
       
   220 		 * 
       
   221 		 * @param aViewId The view that has been activated
       
   222 		 */
       
   223 		virtual void ActivationNotificationL( const TVwsViewId& aViewId ) = 0;
       
   224 
       
   225 		/**
       
   226 		 * @brief Offers the menu pane for population. Interested clients can
       
   227 		 * add or remove menu items
       
   228 		 * 
       
   229 		 * @param aMenuPane The menu pane to be populated
       
   230 		 * @param aResourceId   Resource id of menu pane
       
   231 		 */
       
   232 		virtual void OfferMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) = 0;
       
   233 
       
   234 		/**
       
   235 		 * @brief Gets the command range that has been allocated to this MCalenServices instance
       
   236 		 *
       
   237 		 * @param aCommandRangeStart Start of command range
       
   238 		 * @param aCommandRangeEnd End of command range
       
   239 		 */
       
   240         virtual void GetCommandRange( TInt& aCommandRangeStart, TInt& aCommandRangeEnd ) const = 0;
       
   241 
       
   242 		/**
       
   243 		 * @brief Offers a TRect to customization plugins for the creation of
       
   244 		 * a control to be displayed in the infobar
       
   245 		 * 
       
   246 		 * @param aRect The rect for which the customization is to be done
       
   247 		 * @return CCoeControl The information bar control
       
   248 		 */
       
   249 		virtual CCoeControl* Infobar( const TRect& aRect ) = 0;
       
   250         
       
   251 		/**
       
   252 		 * @brief Gets the text to be shown at the top of calendar views from the plugin
       
   253 		 * 
       
   254 		 * @return TDesC Text to be shown in the infobar
       
   255 		 */
       
   256 		virtual const TDesC& Infobar() = 0;
       
   257 		
       
   258 		/**
       
   259          * Gets the preview pane from the plugin to be shown at the 
       
   260          * calendar view. Offers the rectangle for the preview pane, 
       
   261          * which it can be used to draw the pane.
       
   262          * 
       
   263          * @param aRect The area available for the Preview Pane
       
   264          * @return Preview pane interface
       
   265          */
       
   266         virtual MCalenPreview* CustomPreviewPaneL( TRect& aRect ) = 0;
       
   267 
       
   268 		/**
       
   269 		 * @brief Offers a TRect to available customizations for the creation of a
       
   270 		 * control to be displayed in the preview pane
       
   271 		 * 
       
   272 		 * @param aRect The text for which the customization is to be done
       
   273 		 * @return CCoeControl The preview pane control
       
   274 		 */
       
   275         virtual CCoeControl* PreviewPane( TRect& aRect ) = 0;
       
   276 
       
   277 		/**
       
   278 		 * @brief Gets a pointer to the Calendar toolbar, or NULL if none is available.
       
   279 		 * Ownership is not transferred
       
   280 		 * 
       
   281 		 * @return MCalenToolbar The Calendar toolbar if available
       
   282 		 */
       
   283         virtual MCalenToolbar* ToolbarOrNull() = 0;
       
   284 
       
   285 
       
   286 		/**
       
   287 		 * @brief Cleans all resources assocaited with this object and frees its memory.
       
   288 		 */
       
   289 		virtual void Release() = 0;
       
   290 
       
   291 		/**
       
   292 		 * @brief Returns information whether the key event has been queued successfully
       
   293 		 * 
       
   294 		 * @param aEvent The event in question
       
   295 		 * @param aType The event type
       
   296 		 * @return TBool ETrue if event is queued, EFalse otherwise
       
   297 		 */
       
   298         virtual TBool QueueKeyEvent( const TKeyEvent& aEvent, TEventCode aType ) = 0;
       
   299 
       
   300 		/**
       
   301 		 * @brief Returns information whether a key event is fetched successfully
       
   302 		 *
       
   303 		 * @param aEvent The event in question
       
   304 		 * @param aType The event type		 
       
   305 		 * @return TBool ETrue if a key event is fetched, EFalse, otherwise
       
   306 		 */
       
   307 		virtual TBool GetQueuedKeyEvent( TKeyEvent& aEvent, TEventCode& aType ) = 0;
       
   308 
       
   309 		/**
       
   310 		* @brief Resets the event queue
       
   311 		*/
       
   312 		virtual void ResetKeyEventQueue() = 0;
       
   313         
       
   314 		/**
       
   315 		 * @brief Gets a reference to the missed alarm store
       
   316 		 * 
       
   317 		 * @return CMissedAlarmStore* Pointer to the missed alarm store
       
   318 		 */        
       
   319 		virtual CMissedAlarmStore* MissedAlarmStore() = 0;
       
   320         
       
   321 		/**
       
   322 		 * @brief Gets the missed alarms list aMissedAlarmList
       
   323 		 * 
       
   324 		 * @return aMissedAlarmList Array of missed alarms
       
   325 		 */
       
   326         virtual void GetMissedAlarmsList( RArray <TCalenInstanceId>& aMissedAlarmList ) = 0;
       
   327 		
       
   328         /**
       
   329 		 * @brief Gets the attachment data model
       
   330 		 * 
       
   331 		 * @return CCalenAttachmentModel The attachment data model
       
   332 		 */
       
   333         virtual CCalenAttachmentModel* GetAttachmentData() = 0;
       
   334 
       
   335 		/**
       
   336 		* @brief Get all available calendar info
       
   337 		*
       
   338 		* @param  returns the list of available calendar info iterating 
       
   339 		* through all calendars
       
   340 		*/
       
   341 		virtual void GetAllCalendarInfoL( 
       
   342 				RPointerArray<CCalCalendarInfo>& aCalendarInfoList ) = 0;
       
   343 		
       
   344 		/**
       
   345 		* @brief Gets calendar filename from collection id
       
   346 		*
       
   347 		* @param aColId Collection id for which calendar filename has to be returned
       
   348 		* @return TDesC& reference to the calendar file name
       
   349 		*/
       
   350 		virtual const TDesC&  GetCalFileNameForCollectionId(
       
   351 					const TCalCollectionId aCollectionId ) = 0;
       
   352 		
       
   353     protected:
       
   354 		
       
   355 		/**
       
   356 		 * @brief Protected destructor. Use Release() instead
       
   357 		 */
       
   358         ~MCalenServices()
       
   359 			{
       
   360 			};
       
   361     };
       
   362 
       
   363 #endif // CALENSERVICES_H
       
   364 
       
   365 // End of file