calendarui/globaldata/inc/calencontext.h
changeset 18 c198609911f9
child 45 b6db4fd4947b
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:  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          * @param aViewId The view id of the currently active view.
       
    58          */
       
    59         virtual void setFocusDateAndTimeL( const QDateTime& focusDateTime,
       
    60                                         const int& viewId ) = 0;
       
    61 
       
    62         /**
       
    63          * Sets the date currently focused. When retrieving the focus
       
    64          * date and time after calling this function, the time component
       
    65          * will be set to the default of view. When retrieving the focus
       
    66          * time only, it will be set to -1.
       
    67          * @param aFocusDate The new focus date and time.
       
    68          * @param aViewId The view id of the currently active view.
       
    69          */
       
    70         virtual void setFocusDateL( const QDateTime& focusDateTime,
       
    71                                     const int& viewId ) = 0;
       
    72 
       
    73         /**
       
    74          * Sets the id of the instance currently focused.
       
    75          * @param aInstanceId the id of the focused instance.
       
    76          * @param aViewId The view id of the currently active view.
       
    77          */
       
    78         virtual void setInstanceIdL( const TCalenInstanceId& instanceId,
       
    79                                      const int& viewId ) = 0;
       
    80 
       
    81         /**
       
    82          * Sets the time and instance currently focused.
       
    83          * @param aFocusTime The new focus time. If no time is focused, set
       
    84          * the Utc time of this object to be Time::NullTTime.
       
    85          * @param aInstanceId the id of the focused instance.
       
    86          * @param aViewId The view id of the currently active view.
       
    87          */
       
    88         virtual void setFocusDateAndTimeAndInstanceL( const QDateTime& focusDateTime,
       
    89                                                       const TCalenInstanceId& aInstanceId,
       
    90                                                       const int& viewId ) = 0;
       
    91 
       
    92     // Getters
       
    93         /**
       
    94          * Gets the date and time currently focused.
       
    95          * @return The currently focused date and time. When no time is
       
    96          * focused, the default time on the current date will be returned.
       
    97          */
       
    98         virtual QDateTime focusDateAndTimeL() const = 0;
       
    99 
       
   100         /**
       
   101          * Gets the time currently focused.
       
   102          * @return The currently focused time. When no time is
       
   103          * focused, -1 will be returned.
       
   104          */
       
   105         virtual int focusTime() const = 0;
       
   106 
       
   107         /**
       
   108          * Gets the id of the instance currently focused.
       
   109          * @return The instance id currently focused. When no instance is focused,
       
   110          * this will be TCalenInstanceId::NullInstanceIdL()
       
   111          */
       
   112         virtual TCalenInstanceId instanceId() const = 0;
       
   113 
       
   114         /**
       
   115          * Gets the id of the currently active view.
       
   116          * @return The view id of the currently active view.
       
   117          */
       
   118         virtual int viewId() const = 0;
       
   119         
       
   120  
       
   121  public: // For Mutliple Context Support    
       
   122  
       
   123      /**
       
   124 	    * Set multiple context ids
       
   125 	    *
       
   126 	    * @param aMutlipleContextIds
       
   127 	    */	
       
   128 		 virtual void setMutlipleContextIds( QList<TCalenInstanceId>& mutlipleContextIds)  = 0;
       
   129 		
       
   130 	   /**
       
   131 	    * Remove multiple context id 
       
   132 	    * 
       
   133 	    * @param aInstanceId Instance Id for which context to be removed
       
   134 	    */
       
   135 		 virtual void removeMultipleContextId(TCalenInstanceId instanceId) = 0;
       
   136 		
       
   137 	   /**
       
   138 	    * Resets all the multiple context ids
       
   139 	    * 
       
   140 	    */
       
   141 		 virtual void resetMultipleContextIds(int dbId = 0) = 0;
       
   142 		
       
   143 	   /**
       
   144 	    * Getter for multiple context ids
       
   145 	    *
       
   146 	    * @return RArray<TCalenInstanceId>&
       
   147 	    */
       
   148 		 virtual QList<TCalenInstanceId>& getMutlipleContextIds(int dbId = 0) = 0;
       
   149 		
       
   150 	   /**
       
   151 	    * Returns mutliple context's count
       
   152 	    *
       
   153 	    * @return 
       
   154 	    */
       
   155 		virtual int mutlipleContextIdsCount() = 0;
       
   156 		
       
   157 		/**
       
   158 	    * Sets the user selected landmark
       
   159 	    * @param aLandMark	Landmark object
       
   160 	    */
       
   161 		//virtual void SetLandMark(CPosLandmark* aLandMark) = 0;
       
   162 		
       
   163 		/**
       
   164 	    * Returns the user selected landmark
       
   165 	    * @return Landmark object
       
   166 	    */
       
   167 		//virtual CPosLandmark* GetLandMark() = 0;
       
   168 		
       
   169 		/**
       
   170 	    * Resets the landmark
       
   171 	    */
       
   172 		//virtual void ResetLandMark() = 0;
       
   173 		
       
   174     };
       
   175 
       
   176 #endif // CALENCONTEXT_H
       
   177 
       
   178 // End of file