24
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-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: Header file for CCamBatteryPaneDrawer class.
|
|
15 |
*
|
|
16 |
* Copyright © 2007-2008 Nokia. All rights reserved.
|
|
17 |
* This material, including documentation and any related computer
|
|
18 |
* programs, is protected by copyright controlled by Nokia. All
|
|
19 |
* rights are reserved. Copying, including reproducing, storing,
|
|
20 |
* adapting or translating, any or all of this material requires the
|
|
21 |
* prior written consent of Nokia. This material also contains
|
|
22 |
* confidential information which may not be disclosed to others
|
|
23 |
* without the prior written consent of Nokia.
|
|
24 |
|
|
25 |
*
|
|
26 |
*
|
|
27 |
*/
|
|
28 |
|
|
29 |
|
|
30 |
#ifndef CAMBATTERYPANEDRAWER_H
|
|
31 |
#define CAMBATTERYPANEDRAWER_H
|
|
32 |
|
|
33 |
// INCLUDES
|
|
34 |
|
|
35 |
#include <e32base.h>
|
|
36 |
#include "cambatterypanecontroller.h" // Battery level constants
|
|
37 |
|
|
38 |
// FORWARD DECLARATIONS
|
|
39 |
|
|
40 |
class CFbsBitmap;
|
|
41 |
class CBitmapContext;
|
|
42 |
class CWindowGc;
|
|
43 |
class CCamBitmapItem;
|
|
44 |
|
|
45 |
// CLASS DECLARATION
|
|
46 |
|
|
47 |
class CCamBatteryPaneDrawer: public CBase
|
|
48 |
{
|
|
49 |
public: // Construction and destruction
|
|
50 |
/**
|
|
51 |
* Destructor
|
|
52 |
*/
|
|
53 |
virtual ~CCamBatteryPaneDrawer();
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Two-phased constructor
|
|
57 |
*/
|
|
58 |
static CCamBatteryPaneDrawer* NewL();
|
|
59 |
|
|
60 |
public: // New functions
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Set battery strength level used in drawing
|
|
64 |
* @param aBatteryStrength Battery Strength )
|
|
65 |
*/
|
|
66 |
void SetBatteryStrength( TInt aBatteryStrength );
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Set battery pane location used in drawing
|
|
70 |
* @param aLocation
|
|
71 |
*/
|
|
72 |
void SetLocation( const TPoint &aLocation );
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Get battery pane's rectangle
|
|
76 |
* @return rectangle
|
|
77 |
*/
|
|
78 |
TRect Rect() const;
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Draw the battery pane
|
|
82 |
* @param aGc Graphics context
|
|
83 |
*/
|
|
84 |
// void Draw( CWindowGc& aGc ) const;
|
|
85 |
void Draw( CBitmapContext& aGc ) const;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Clear the battery pane indicator
|
|
89 |
* @param aGc Graphics context
|
|
90 |
*/
|
|
91 |
void ClearBattery( CBitmapContext& aGc ) const;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Handle resource change event
|
|
95 |
* @param aType Type of the resource change
|
|
96 |
*/
|
|
97 |
void HandleResourceChange( TInt aType );
|
|
98 |
|
|
99 |
protected:
|
|
100 |
/**
|
|
101 |
* Second phase constructor
|
|
102 |
*/
|
|
103 |
void ConstructL();
|
|
104 |
|
|
105 |
private:
|
|
106 |
/**
|
|
107 |
* Constructor
|
|
108 |
*/
|
|
109 |
CCamBatteryPaneDrawer();
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Load layouts for elements in the battery pane
|
|
113 |
*/
|
|
114 |
void LoadLayoutsL();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Load icons needed for drawing the battery pane
|
|
118 |
*/
|
|
119 |
void LoadIconsL();
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Delete loaded icons
|
|
123 |
*/
|
|
124 |
void DeleteIcons();
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Read nontouch layout
|
|
128 |
*/
|
|
129 |
void NonTouchLayoutL();
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Read touch layout
|
|
133 |
*/
|
|
134 |
void TouchLayoutL();
|
|
135 |
|
|
136 |
|
|
137 |
private: // Data
|
|
138 |
// Battery strength
|
|
139 |
TInt iBatteryStrength;
|
|
140 |
|
|
141 |
|
|
142 |
RPointerArray<CCamBitmapItem> iBatteryIcons;
|
|
143 |
|
|
144 |
// Rectangle of the battery pane
|
|
145 |
TRect iRect;
|
|
146 |
|
|
147 |
};
|
|
148 |
|
|
149 |
#endif // CAMBATTERYPANEDRAWER_H
|