calendarui/inc/calenservices.h
branchRCL_3
changeset 65 12af337248b1
equal deleted inserted replaced
60:96907930389d 65:12af337248b1
       
     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 
       
    22 
       
    23 #include <w32std.h> // needed for enum TEventCode
       
    24 #include "calennotificationhandler.h"
       
    25 #include "hb_calencommands.hrh"
       
    26 
       
    27 // Forward declarations
       
    28 class CCalEntryView;        // View for accessing calendar entries
       
    29 class CCalInstanceView;     // View for accessing instances of calendar entries
       
    30 class CCalSession;          // Handle to the Calendar file
       
    31 class CalenServicesImpl;   // Services API implementation
       
    32 class AgendaUtil;
       
    33 class TVwsViewId;
       
    34 class HbMainWindow;
       
    35 class MCalenContext;        // Current calendar focus information
       
    36 class HbWidget;
       
    37 class QString;
       
    38 class HbMenu;
       
    39 
       
    40 /**
       
    41  * Calendar Services External API. This class is not intended for user
       
    42  * derivation - an object of this type is passed to customisations upon
       
    43  * construction.
       
    44  */
       
    45 class MCalenServices 
       
    46     {
       
    47     public:
       
    48     	/**
       
    49          * Get MainWindow
       
    50          * @return reference to HbMainWindow
       
    51          */
       
    52         virtual HbMainWindow& MainWindow() = 0;
       
    53                
       
    54 				/**
       
    55          * Register for notifications of Calendar events
       
    56          * @param aHandler the MCalenNotificationHandler to notify
       
    57          * @param aNotification single notification to be notified about
       
    58          */
       
    59         virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
       
    60                                                         TCalenNotification aNotification )=0;
       
    61         
       
    62         /**
       
    63          * Register for notifications of Calendar events
       
    64          * @param aHandler the MCalenNotificationHandler to notify
       
    65          * @param aNotifications array of notifications to be notified about
       
    66          */
       
    67         virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
       
    68                                                     RArray<TCalenNotification>& aNotifications )=0;
       
    69 
       
    70         /**
       
    71          * Cancel notifications of Calendar events
       
    72          * @param aHandler the MCalenNotificationHandler to stop notifying
       
    73          */
       
    74         virtual void CancelNotifications( MCalenNotificationHandler* aHandler )=0;
       
    75         
       
    76 
       
    77         /**
       
    78          * Issue a notification to Calendar, which will be broadcast
       
    79          * synchronously to all registered notification handlers.
       
    80          * Only one notification may be issued at once.
       
    81          * @param aNotification the notification to broadcast
       
    82          */
       
    83         virtual void IssueNotificationL( TCalenNotification aNotification )=0;
       
    84        
       
    85         /**
       
    86          * Request activation of a specific view
       
    87          * @param aViewId The view to be activated
       
    88          */
       
    89         virtual void RequestActivationL( const TVwsViewId& aViewId )=0;
       
    90 
       
    91         /**
       
    92          * Notify Calendar that a specific view has been activated.
       
    93          * Custom views must call this on activation
       
    94          * @param aViewId The view that was activated
       
    95          */
       
    96         virtual void ActivationNotificationL( const TVwsViewId& aViewId )=0;
       
    97 
       
    98         
       
    99         /**
       
   100          * Cleans all resources assocaited with this object and frees its memory.
       
   101          */
       
   102         virtual void Release()=0;
       
   103    
       
   104     	/**
       
   105          * Issue a command to be handled by Calendar or a customization
       
   106          * All commands will be handled asynchronously.  Calendar may reject
       
   107          * @param aCommand the command to be handled
       
   108          * @return ETrue, if Calendar will attempt to handle the command
       
   109          * @return EFalse, if Calendar will not attempt to handle the command
       
   110          */
       
   111         virtual TBool IssueCommandL( TInt aCommand  )=0;
       
   112         
       
   113         /**
       
   114          * Returns the context. This includes information such
       
   115          * as the currently focused date/instance.
       
   116          */
       
   117         virtual MCalenContext& Context()=0;
       
   118 
       
   119 		 /**         
       
   120           * a control to be displayed in the infobar
       
   121           * @return info bar control
       
   122           */
       
   123         virtual HbWidget* Infobar( )=0;
       
   124         
       
   125         /**
       
   126           * Returns info bar text
       
   127           */
       
   128         virtual QString* InfobarTextL() = 0;
       
   129         
       
   130         /**
       
   131           * Offers the menu  for population, interested parties can
       
   132           * add or remove menu items
       
   133           * @param aHbMenu meu  to be populated          
       
   134           */
       
   135         virtual void OfferMenu(HbMenu* aHbMenu) = 0 ;
       
   136 		
       
   137 		/**
       
   138          * Gets the command range that has been allocated to this MCalenServices
       
   139          * instance
       
   140          *
       
   141          * @param aCommandRangeStart start of command range
       
   142          * @param aCommandRangeEnd end of command range
       
   143          */
       
   144         virtual void GetCommandRange( TInt& aCommandRangeStart, TInt& aCommandRangeEnd ) const=0;
       
   145         
       
   146         /**
       
   147         * returns the interface to the agenda database
       
   148         * @return reference to agendainterface
       
   149         */
       
   150         virtual AgendaUtil* agendaInterface() = 0;
       
   151         
       
   152         /**
       
   153 		 * returns the first view with which calendar has been launched
       
   154 		 * @return view Id
       
   155 		 */
       
   156 		virtual int getFirstView() = 0;
       
   157 
       
   158     protected:
       
   159         
       
   160         /**
       
   161          * Protected destructor. Use Release() instead
       
   162          */
       
   163         ~MCalenServices(){ };
       
   164     };
       
   165 
       
   166 #endif // CALENSERVICES_H
       
   167 
       
   168 // End of file