calendarui/globaldata/inc/calencontext.h
branchRCL_3
changeset 29 12af337248b1
equal deleted inserted replaced
28:96907930389d 29: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:  Calendar context, info on what's currently focused
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENCONTEXT_H
       
    20 #define CALENCONTEXT_H
       
    21 
       
    22 #include "caleninstanceid.h"
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class TCalenInstanceId;
       
    26 class QDateTime;
       
    27 
       
    28 // INCLUDES
       
    29 
       
    30 // CLASS DEFINITIONS
       
    31 /**
       
    32  * The controller handles events from the rest of Calendar and delegates
       
    33  * them to the appropriate place (i.e. the action ui classes).
       
    34  */
       
    35 class MCalenContext
       
    36     {
       
    37     public:  // New functions
       
    38     // Utils
       
    39         /**
       
    40          * Returns the default time for views. (Normally 8am.) This would be
       
    41          * used for example by the month view, which sets the focus time to
       
    42          * 8am on a day. Then when opening the week view, a sane time is shown.
       
    43          */
       
    44         virtual int defaultTimeForViewsInMinnutes() const = 0;
       
    45 
       
    46         /**
       
    47          * Returns the default TCalTime for views. (Normally 8am today.) This
       
    48          * would be used for example when a view is the first view loaded in
       
    49          * Calendar.
       
    50          */
       
    51         virtual QDateTime defaultCalTimeForViewsL() const = 0;
       
    52 
       
    53     // Setters
       
    54         /**
       
    55          * Sets the date and time currently focused.
       
    56          * @param aFocusTime The new focus date and time.
       
    57          */
       
    58         virtual void setFocusDateAndTime( const QDateTime& focusDateTime) = 0;
       
    59 
       
    60         /**
       
    61          * Sets the date currently focused. When retrieving the focus
       
    62          * date and time after calling this function, the time component
       
    63          * will be set to the default of view. When retrieving the focus
       
    64          * time only, it will be set to -1.
       
    65          * @param aFocusDate The new focus date and time.
       
    66          */
       
    67         virtual void setFocusDate( const QDateTime& focusDateTime) = 0;
       
    68 
       
    69         /**
       
    70          * Sets the id of the instance currently focused.
       
    71          * @param aInstanceId the id of the focused instance.
       
    72          */
       
    73         virtual void setInstanceId( const TCalenInstanceId& instanceId ) = 0;
       
    74 
       
    75         /**
       
    76          * Sets the time and instance currently focused.
       
    77          * @param aFocusTime The new focus time. If no time is focused, set
       
    78          * the Utc time of this object to be Time::NullTTime.
       
    79          * @param aInstanceId the id of the focused instance.
       
    80          */
       
    81         virtual void setFocusDateAndTimeAndInstance( const QDateTime& focusDateTime,
       
    82                                                       const TCalenInstanceId& aInstanceId ) = 0;
       
    83 
       
    84     // Getters
       
    85         /**
       
    86          * Gets the date and time currently focused.
       
    87          * @return The currently focused date and time. When no time is
       
    88          * focused, the default time on the current date will be returned.
       
    89          */
       
    90         virtual QDateTime focusDateAndTime() const = 0;
       
    91 	
       
    92 
       
    93         /**
       
    94          * Gets the time currently focused.
       
    95          * @return The currently focused time. When no time is
       
    96          * focused, -1 will be returned.
       
    97          */
       
    98         virtual int focusTime() const = 0;
       
    99 
       
   100         /**
       
   101          * Gets the id of the instance currently focused.
       
   102          * @return The instance id currently focused. When no instance is focused,
       
   103          * this will be TCalenInstanceId::NullInstanceIdL()
       
   104          */
       
   105         virtual TCalenInstanceId instanceId() const = 0;
       
   106 
       
   107  public: // For Mutliple Context Support    
       
   108  
       
   109      /**
       
   110 	    * Set multiple context ids
       
   111 	    *
       
   112 	    * @param aMutlipleContextIds
       
   113 	    */	
       
   114 		 virtual void setMutlipleContextIds( QList<TCalenInstanceId>& mutlipleContextIds)  = 0;
       
   115 		
       
   116 	   /**
       
   117 	    * Remove multiple context id 
       
   118 	    * 
       
   119 	    * @param aInstanceId Instance Id for which context to be removed
       
   120 	    */
       
   121 		 virtual void removeMultipleContextId(TCalenInstanceId instanceId) = 0;
       
   122 		
       
   123 	   /**
       
   124 	    * Resets all the multiple context ids
       
   125 	    * 
       
   126 	    */
       
   127 		 virtual void resetMultipleContextIds(int dbId = 0) = 0;
       
   128 		
       
   129 	   /**
       
   130 	    * Getter for multiple context ids
       
   131 	    *
       
   132 	    * @return RArray<TCalenInstanceId>&
       
   133 	    */
       
   134 		 virtual QList<TCalenInstanceId>& getMutlipleContextIds(int dbId = 0) = 0;
       
   135 		
       
   136 	   /**
       
   137 	    * Returns mutliple context's count
       
   138 	    *
       
   139 	    * @return 
       
   140 	    */
       
   141 		virtual int mutlipleContextIdsCount() = 0;
       
   142 		
       
   143     };
       
   144 
       
   145 #endif // CALENCONTEXT_H
       
   146 
       
   147 // End of file