calendarui/views/inc/calenicondrawer.h
changeset 0 f979ecb2b13e
child 59 aba12c885d83
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Draws alarm/repeat icons in entry viewer
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENICONDRAWER_H
       
    21 #define CALENICONDRAWER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknUtils.h>
       
    25 #include <calenservices.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class TAknLayoutRect;
       
    29 class CFbsBitmap;
       
    30 class CAknIconArray;
       
    31 class MCalenServices;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  Icon drawer for entry viewer
       
    37 *  Draws alarm/repeat icons at the top of the entry viewer.
       
    38 *
       
    39 *  @lib CalenDefaultEditors
       
    40 *  @since Series 60 3.2
       
    41 */
       
    42 NONSHARABLE_CLASS( CCalenIconDrawer ) : public CPicture
       
    43     {
       
    44     public:     // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two phased constructor.
       
    48         */
       
    49         static CCalenIconDrawer* NewL( MCalenServices& aServices );
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CCalenIconDrawer();
       
    55 
       
    56     public:     // From CPicture
       
    57 
       
    58         /**
       
    59         * Draw
       
    60         */
       
    61         void Draw( CGraphicsContext& aGc, 
       
    62                        const TPoint& aTopLeft,
       
    63                        const TRect& aClipRect, 
       
    64                        MGraphicsDeviceMap* aMap ) const;
       
    65 
       
    66         /**
       
    67         * ExternalizeL
       
    68         */
       
    69         void ExternalizeL( RWriteStream& aStream ) const;
       
    70 
       
    71         /**
       
    72         * Returns the picture's size in twips.
       
    73         * @param aSize Size.
       
    74         */
       
    75         void GetOriginalSizeInTwips( TSize& aSize ) const;
       
    76 
       
    77         void AddIconL( MCalenServices::TCalenIcons aIconIndex );
       
    78         void SetIconSizesFromLayout(TInt aNumOfLinesBefLocField = 0);
       
    79         TInt WidthInPixels();
       
    80 
       
    81     public:
       
    82         void HandleResourceChange();
       
    83 
       
    84     private:
       
    85         CAknIconArray* CreateIconsL( const RArray<MCalenServices::TCalenIcons>& aIndexArray );
       
    86         TInt IconIndex( MCalenServices::TCalenIcons aType ) const;
       
    87         
       
    88         /**
       
    89         * Fuction to set map icon size
       
    90         */
       
    91         void SetMapIconSize(TRect aIconRect);
       
    92 
       
    93         enum TCalViewerIconSlot
       
    94             {
       
    95             ENoIcons,
       
    96             EOneIcon,
       
    97             ETwoIcons,
       
    98             EThreeIcons
       
    99             };
       
   100         CCalenIconDrawer( MCalenServices& aServices );
       
   101         void ConstructL();
       
   102 
       
   103         TRect iFirstIconRect;            // First icon Size and position
       
   104         TRect iSecondIconRect;           // Second icon Size and position
       
   105         TRect iThirdIconRect;            // Third icon Size and position
       
   106 
       
   107         TInt iFirstIconIndex;
       
   108         TInt iSecondIconIndex;
       
   109         TInt iThirdIconIndex;
       
   110         TBool isMapIconAdded;
       
   111         TCalViewerIconSlot iIconCount;  // Number of icons added to the icon drawer
       
   112         CAknIconArray* iIconArray;
       
   113         MCalenServices& iServices;
       
   114         RArray<MCalenServices::TCalenIcons> iIconIndices;
       
   115     };
       
   116 
       
   117 #endif      // CALENICONDRAWER_H
       
   118 
       
   119 
       
   120 // End of File