calendarui/views/inc/calenweeklistboxdata.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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:   Drawing WeekView Listbox data.
       
    15  *                Event bar and Event icon, event indicator
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CALENWEEKLBDATA_H
       
    22 #define CALENWEEKLBDATA_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <eikfrlbd.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class TCalenWeekHour;
       
    29 class MAknsSkinInstance;
       
    30 class MAknsControlContext;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  *  Drawing WeekView Listbox data.
       
    36  *  Event bar and Event icon, event indicator
       
    37  */
       
    38 NONSHARABLE_CLASS( CCalenWeekLBData )
       
    39     : public CFormattedCellListBoxData
       
    40     {
       
    41 public:  // Constructors and destructor
       
    42     /**
       
    43      * Destructor.
       
    44      */
       
    45     virtual ~CCalenWeekLBData();
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50     static CCalenWeekLBData* NewL();
       
    51 
       
    52 public:     // New function
       
    53     /**
       
    54      * Set current sub cell position.
       
    55      * @param aCurrentSubCellRect  Rect of the cell.
       
    56      * @param aCurrentItemPos      Position of the cell.
       
    57      */
       
    58     void CurrentSubCellPos( TRect& aCurrentSubCellRect, const TPoint& aCurrentItemPos );
       
    59 
       
    60     /**
       
    61      * Set highlight of row.
       
    62      * @param aHilightedSubCell cell to highlight
       
    63      */
       
    64     void SetHilightedSubCell(TInt aHilightedSubCell);
       
    65     /**
       
    66      * Return highlight of row.
       
    67      * @return highlighted cell
       
    68      */
       
    69     TInt HilightedSubCell();
       
    70 
       
    71     /**
       
    72      * Set count of row
       
    73      * @param aCount count of row
       
    74      */
       
    75     void SetCelCount(TInt aCount);
       
    76     
       
    77     /**
       
    78      * Set layout variant index
       
    79      * @param aLayout used layout
       
    80      */
       
    81     void SetVariantIndex(TInt aLayout);
       
    82     
       
    83     /**
       
    84      * Return count of row
       
    85      * @return count of row
       
    86      */
       
    87     TInt CellCount() const;
       
    88 
       
    89     /**
       
    90      * Drawing listbox item and highlight
       
    91      * @param aProperties Item margin, etc...
       
    92      * @param aGc Graphic context
       
    93      * @param aText Drawing text
       
    94      * @param aItemRect item rect
       
    95      * @param aColors Drawing colors
       
    96      */
       
    97     void Draw(TListItemProperties aProperties, CWindowGc& aGc,
       
    98               const TDesC* aText, const TRect& aRect, TBool aHighlight,
       
    99               const TColors& aColors) const;
       
   100 
       
   101 private:    // Constructors and destructor
       
   102     /**
       
   103      * C++ Constructor.
       
   104      */
       
   105     CCalenWeekLBData();
       
   106 
       
   107 private:    // New function
       
   108     /**
       
   109      * Drawing listbox item
       
   110      * @param aProperties Item margin, etc...
       
   111      * @param aGc Graphic context
       
   112      * @param aText Drawing text
       
   113      * @param aItemRect item rect
       
   114      * @param aColors Drawing colors
       
   115      */
       
   116     void DrawFormatted(TListItemProperties aProperties, CWindowGc& aGc,
       
   117                        const TDesC* aText, const TRect& aItemRect,
       
   118                        const TColors& aColors, TBool aHighlight) const;
       
   119     /**
       
   120      * Drawing cell text
       
   121      * @param aProperties Item margin, etc...
       
   122      * @param aSubCell Row index
       
   123      * @param aGc Graphic context
       
   124      * @param aText Drawing cell text
       
   125      * @param aCellRect Cell rect
       
   126      * @param aTextRect Text rect
       
   127      */
       
   128     void DrawCellText(TListItemProperties aProperties, TInt aSubCell,
       
   129                       CWindowGc& aGc, const TPtrC aText, const TRect& aCellRect,
       
   130                       const TRect& aTextRect, const TColors& aColors) const;
       
   131     /**
       
   132      * Drawing meeting note bar
       
   133      * @param aGc Graphic context
       
   134      * @param aHourData Hour schedule
       
   135      * @param aCellRect Cell rect
       
   136      */
       
   137     void DrawDurationBar(CWindowGc& aGc,
       
   138                          const TCalenWeekHour& aHourData,
       
   139                          const TRect& aCellRect) const;
       
   140 
       
   141     /**
       
   142      * Drawing non-timed note type icon
       
   143      * @param aGc Graphic context
       
   144      * @param aHourData Hour schedule
       
   145      * @param aCellRect Cell rect
       
   146      */
       
   147     void DrawIcon(CWindowGc& aGc,
       
   148                   const TCalenWeekHour& aHourData, 
       
   149                   const TRect& aCellRect) const;
       
   150 
       
   151     TBool DrawHighlight(const TRect aItemRect, CWindowGc& aGc, const TBool aDrawSkinned) const;
       
   152     
       
   153     /**
       
   154      *  Initialise Pattern at the construction period
       
   155      */
       
   156     void InitialisePatternL();
       
   157 private:    // data
       
   158     TInt iLayoutVariant;
       
   159     TInt iHilightedSubCell;
       
   160     TInt iCellCount;
       
   161     CFbsBitmap* iGradientBitmap;
       
   162     };
       
   163 
       
   164 #endif // CALENWEEKLBDATA_H
       
   165 
       
   166 
       
   167 // End of File