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