calendarui/views/inc/calenweeklistbox.h
branchRCL_3
changeset 66 bd7edf625bdd
child 67 1539a383d7b6
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     1 /*
       
     2 * Copyright (c) 2002 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:   CCalenWeekListbox is the class that customizes drawing
       
    15  *                part of CEikFormattedCellListBox.
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CALENWEEKLISTBOX_H
       
    22 #define CALENWEEKLISTBOX_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <eikfrlb.h>
       
    26 #include <gdi.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CAknsFrameBackgroundControlContext;
       
    30 class CCalenWeekContainer;
       
    31 class CGulIcon; 
       
    32 class MCalenWeekCursorObserver;
       
    33 
       
    34 
       
    35 //  CLASS DEFINITIONS
       
    36 
       
    37 /**
       
    38  *  CCalenWeekListbox is the class that customizes drawing
       
    39  *  part of CEikFormattedCellListBox.
       
    40  */
       
    41 NONSHARABLE_CLASS( CCalenWeekListbox ) : public CEikFormattedCellListBox
       
    42     {
       
    43 public:  // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * C++ default constructor.
       
    47      */
       
    48     CCalenWeekListbox(CCalenWeekContainer& aWeekContainer);
       
    49 
       
    50     /**
       
    51      * Symbian OS constructor
       
    52      * @param aParent Parent container control
       
    53      */
       
    54     //lint -e{1411} Upperlevel ConstructL can be hidden as it is never called
       
    55     void ConstructL(const CCoeControl* aParent);
       
    56 
       
    57     /**
       
    58      * Destructor.
       
    59      */
       
    60     virtual ~CCalenWeekListbox();
       
    61 public:     // New function
       
    62     /**
       
    63      * Set cursor handling class
       
    64      * @param aCursorObsever Cursor handling observer
       
    65      */
       
    66     void SetCursorObserver(MCalenWeekCursorObserver* aCursorObsever);
       
    67     /**
       
    68      * Set the start of a week
       
    69      * @param aStartDay start of a week
       
    70      */
       
    71     void SetStartDay(TTime aStartDay);
       
    72 
       
    73     /**
       
    74      * Set background control context for skinning.
       
    75      */
       
    76     void SetBgContext(MAknsControlContext* aCc);
       
    77 
       
    78     TRect LayoutRect() const;
       
    79 public:     // From CCoeControl
       
    80     /**
       
    81      * From CCoeControl, handles key events.
       
    82      * @param aKeyEvent Event to handled.
       
    83      * @param aType Type of the key event.
       
    84      * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed).
       
    85      */
       
    86     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
       
    87                                 TEventCode aType);
       
    88 
       
    89 
       
    90     /**
       
    91      * checks if pointer event was done in allowed area
       
    92      */
       
    93     TBool IsValidPointer(TPoint aPos);
       
    94     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    95 
       
    96     /**
       
    97      * Calculates new column from pointer event
       
    98      */
       
    99     TInt PointerEventColumn(TPoint aPos);
       
   100 
       
   101 
       
   102 protected: // from MObjectProvider
       
   103     virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   104 
       
   105 private:    // New function
       
   106     /**
       
   107      * Set all cell data
       
   108      */
       
   109     void SetupLayoutL();
       
   110 
       
   111     /**
       
   112      * Set a Background color for all subcells
       
   113      */
       
   114     void SetSubcellColorsL() const;
       
   115 
       
   116 private:    // From CEikFormattedCellListBox
       
   117     /**
       
   118      * From CEikFormattedCellListBox
       
   119      * Create CColumnListBoxData and CColumnListBoxItemDrawer.
       
   120      */
       
   121     void CreateItemDrawerL();
       
   122 
       
   123 private:    // from CEikListBox
       
   124     /**
       
   125      * From CEikListBox Create ListBoxView class
       
   126      */
       
   127     CListBoxView* MakeViewClassInstanceL();
       
   128     /**
       
   129      * From CEikListBox Called when Left arrow key was pressed
       
   130      */
       
   131     void HandleLeftArrowKeyL(CListBoxView::TSelectionMode aSelectionMode);
       
   132     /**
       
   133      * From CEikListBox Called when Right arrow key was pressed
       
   134      */
       
   135     void HandleRightArrowKeyL(CListBoxView::TSelectionMode aSelectionMode);
       
   136 
       
   137 private:    // From CCoeControl
       
   138     /**
       
   139      * From CCoeControl Initilizes ListBox cell
       
   140      */
       
   141     void SizeChanged();
       
   142 
       
   143 private:    // Data
       
   144     CCalenWeekContainer& iWeekContainer;
       
   145 
       
   146     MCalenWeekCursorObserver* iCursorObsever;
       
   147     TTime iStartDay;
       
   148     MAknsControlContext* iBgContext;  // not owned
       
   149     };
       
   150 
       
   151 #endif // CALENWEEKLISTBOX_H
       
   152 
       
   153 
       
   154 // End of File