calendarui/views/inc/calenmissedalarmscontainer.h
changeset 0 f979ecb2b13e
child 19 1984aceb8774
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2008 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:   Missed alarm container class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENMISSEDALARMSCONTAINER_H
       
    21 #define CALENMISSEDALARMSCONTAINER_H
       
    22 
       
    23 #include<coecntrl.h>
       
    24 #include<missedalarm.h>
       
    25 #include<missedalarmstore.h>
       
    26 #include <caleninstanceid.h>            // TCalenInstanceId
       
    27 
       
    28 #include "calencontainer.h"
       
    29 #include "calenmissedalarmsview.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CAknDoubleGraphicStyleListBox;
       
    33 class CAknIconArray;
       
    34 class CCalenAppUi;
       
    35 class CCalEntry;
       
    36 
       
    37 /**
       
    38  * Class declaration for Missed alarms container
       
    39  */
       
    40 NONSHARABLE_CLASS(CCalenMissedAlarmsContainer) : public CCalenContainer
       
    41     {
       
    42     public:
       
    43         
       
    44    	    /**
       
    45          * Two-phased constructor.
       
    46          * @param aRect of this container.
       
    47          * @param aView CCalenMissedAlarmsView* that owns this class.
       
    48          * @return CCalenMissedAlarmsContainer*
       
    49          */
       
    50         CCalenMissedAlarmsContainer( CCalenNativeView* aView,
       
    51                               MCalenServices& aServices,
       
    52                               TInt& aHighlightedRowNumber);
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         virtual ~CCalenMissedAlarmsContainer();
       
    58 
       
    59         /**
       
    60          * Return list box pointer.
       
    61          * @return List box pointer.
       
    62          */
       
    63         CAknDoubleGraphicStyleListBox* ListBox() const;
       
    64 
       
    65     private: // Functions from base classes
       
    66         /**
       
    67          * From CCoeControl, child control was resized.
       
    68          */
       
    69         void SizeChanged();
       
    70 
       
    71         /**
       
    72          * From CCoeControl, return child control count.
       
    73          * @return Control count
       
    74          */
       
    75         TInt CountComponentControls() const;
       
    76 
       
    77         /**
       
    78          * From CCoeControl, return child control pointer.
       
    79          * @param aIndex Child control index
       
    80          * @return Child control pointer.
       
    81          */
       
    82         CCoeControl* ComponentControl(TInt aIndex) const;
       
    83 
       
    84         /**
       
    85          * From CCoeControl, process key event.
       
    86          * @param aKeyEvent The key event.
       
    87          * @param aType EEventKey | EEventKeyUp | EEventKeyDown.
       
    88          * @return EKeyWasNotConsumed : Key event was not consumed.
       
    89          */
       
    90         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
       
    91                                     TEventCode aType);
       
    92 
       
    93         /**
       
    94          * From CCoeControl, process pointer event.
       
    95          */
       
    96         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    97 
       
    98         /**
       
    99          * From CCoeControl
       
   100          */  
       
   101         void Draw(const TRect& /*aRect*/) const;
       
   102 
       
   103         /**
       
   104          * Pass skin information if needed
       
   105          */
       
   106         TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   107 
       
   108         /**
       
   109          * From CCoeControl, Get help context.
       
   110          * @param aContext Help context
       
   111          */
       
   112         void GetHelpContext(TCoeHelpContext& aContext) const;
       
   113 
       
   114         /**
       
   115          * From MActiveStep, refresh EventView data.
       
   116          */
       
   117         TInt DoStepL();
       
   118     
       
   119         /**
       
   120          * From CCoeControl Handles a resource relative event
       
   121          */
       
   122         void HandleResourceChange(TInt aType);                              
       
   123         
       
   124     private:    // From CCalenContainer
       
   125 
       
   126         /**
       
   127          * From CCalenContainer Third phase constructor.
       
   128          * This function was called CCalenView::ConstructL().
       
   129          */
       
   130         void ConstructImplL();
       
   131         
       
   132         /**
       
   133          * From CCalenContainer.
       
   134          * This methods is called after calendar settings have changed.
       
   135          */
       
   136         void UpdateSize();
       
   137      	
       
   138         /**
       
   139          * Create icon index
       
   140          */
       
   141         void CreateIconIndicesL( RArray<MCalenServices::TCalenIcons>& aIndexArray );
       
   142         
       
   143         /**
       
   144          * This method is called after pointer event in Navi
       
   145          * decoration object.
       
   146          * @param aDirection right or left
       
   147          */
       
   148         void HandleNaviDecoratorEventL(TInt aEventID);
       
   149         
       
   150         /**
       
   151          * Handle long tap events
       
   152          */
       
   153         void HandleLongTapEventL( const TPoint& aPenEventLocation, 
       
   154                                   const TPoint& aPenEventScreenLocation );
       
   155     private:
       
   156         
       
   157         /**
       
   158          * Gets an icon index corresponding to a note
       
   159          * @param aEntry Agenda entry
       
   160          * @return ENullIcon | EBirthdayIcon |
       
   161          *         EMeetingIcon | EDaynoteIcon | EToDoIcon
       
   162          */
       
   163         TInt IconIndexForEntryL(CCalEntry& aEntry, TInt aSeenMissedAlarm);
       
   164         
       
   165         /**
       
   166          * Creates the list box data
       
   167          * @aIndex index of the listbox 
       
   168          */
       
   169         void CreateListBoxDataL(TInt aIndex);
       
   170                  
       
   171          /**
       
   172           * Get Missed Alarm Entry
       
   173           * @param aIndex: index for fetching the missed alarm entry
       
   174           * @return CCalEntry* pointer to the calendar entry
       
   175           */
       
   176          CCalEntry* GetMissedAlarmEntryL(TInt aIndex) const ;  
       
   177           
       
   178          /**
       
   179           * Get the Instance Time
       
   180           * @param aIndex : index for fetching the instance time
       
   181           * @return TTime returns the instance time
       
   182           */ 
       
   183          TTime GetInstanceTime(TInt aIndex) const ;
       
   184          
       
   185          /**
       
   186           * Get the Viewed Event Information
       
   187           *
       
   188           * @param aIndex : index for fetching the viewed event info
       
   189           * @return TInt returns the viewed event info
       
   190           */ 
       
   191          TInt GetViewedEventInfo(TInt aIndex);
       
   192           
       
   193          /**
       
   194           * Set current item index and draw list.
       
   195           */
       
   196          void SetCurrentItemIndexAndDraw();
       
   197           
       
   198          /**
       
   199           * Sets the correct highlight, based on the context.
       
   200           */
       
   201          void SetHighlightingL();
       
   202           
       
   203          /**
       
   204           * Set current item index.
       
   205           * @param aIndex Item index
       
   206           */
       
   207          void SetCurrentItemIndex(TInt aIndex);
       
   208          
       
   209          /**
       
   210           * Set empty list text
       
   211           */ 
       
   212          void SetEmptyListTextL();
       
   213           
       
   214     public:
       
   215         
       
   216         /**
       
   217          * Updates missed alarms array
       
   218          */
       
   219         void UpdateMissedAlarmsArrayL();
       
   220         
       
   221         /**
       
   222          * Populate Missed alarms View with missed alarm entries
       
   223          */
       
   224         void PopulateWithMissedAlarmsL();
       
   225 	    
       
   226         /**
       
   227          * Completes the population of the Missed alarms view 
       
   228          */
       
   229 	    void CompletePopulationL();
       
   230 	    
       
   231 		/**
       
   232 		 * Returns the current lisbox item's index
       
   233 		 * @return returns the current listbox's index
       
   234 		 */
       
   235 		TInt CurrentItemIndex();
       
   236    	
       
   237     	/**
       
   238     	 * Returns the Missed alarms Count
       
   239     	 * @return returns the missed alarms count
       
   240     	 */
       
   241     	TInt MissedAlarmsCount();
       
   242     	    	 
       
   243         /**
       
   244          * Sets the context from the current focused missed alarm entry
       
   245          * @aIndex index of the missed alarm entry
       
   246          */
       
   247         void SetContextFromMissedAlarmEntryL(TInt aIndex);
       
   248        
       
   249         /**
       
   250          * Returns the index of the missed alarm entry 
       
   251          * @aId Intance id of the context
       
   252          * @return TInt return focused index of the missed alarms entry
       
   253          */
       
   254         TInt FindMissedAlarmEntryIndexL(const TCalenInstanceId& aId);
       
   255 
       
   256     private:    // Data Members
       
   257         
       
   258     	CAknDoubleGraphicStyleListBox* iListBox;
       
   259     	CCalenMissedAlarmsView* iMissedAlarmsView;
       
   260     	CMissedAlarmStore* iMissedAlarmStore;
       
   261      	RArray<TCalenInstanceId> iMissedAlarmsArray;
       
   262     	CDesCArray* iListBoxItemArray;
       
   263     	TUint32 iMissedAlarmsCount;
       
   264     	TInt& iHighlightedRowNumber;
       
   265     	TBool iFirstTap;
       
   266     };
       
   267 
       
   268 #endif // CALENMISSEDALARMSCONTAINER_H
       
   269 
       
   270 // End of File