66
|
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();
|
|
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 |
enum TCalViewerIconSlot
|
|
89 |
{
|
|
90 |
ENoIcons,
|
|
91 |
EOneIcon,
|
|
92 |
ETwoIcons,
|
|
93 |
EThreeIcons
|
|
94 |
};
|
|
95 |
CCalenIconDrawer( MCalenServices& aServices );
|
|
96 |
void ConstructL();
|
|
97 |
|
|
98 |
TRect iFirstIconRect; // First icon Size and position
|
|
99 |
TRect iSecondIconRect; // Second icon Size and position
|
|
100 |
TRect iThirdIconRect; // Third icon Size and position
|
|
101 |
|
|
102 |
TInt iFirstIconIndex;
|
|
103 |
TInt iSecondIconIndex;
|
|
104 |
TInt iThirdIconIndex;
|
|
105 |
TBool isMapIconAdded;
|
|
106 |
TCalViewerIconSlot iIconCount; // Number of icons added to the icon drawer
|
|
107 |
CAknIconArray* iIconArray;
|
|
108 |
MCalenServices& iServices;
|
|
109 |
RArray<MCalenServices::TCalenIcons> iIconIndices;
|
|
110 |
};
|
|
111 |
|
|
112 |
#endif // CALENICONDRAWER_H
|
|
113 |
|
|
114 |
|
|
115 |
// End of File
|