|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * MsgEditor icon control |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MSGICONCONTROL_H |
|
22 #define MSGICONCONTROL_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <coecntrl.h> |
|
27 #include <AknsItemID.h> |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 |
|
39 // CLASS DECLARATION |
|
40 class CGulIcon; |
|
41 class CMsgMediaControl; |
|
42 class TAknsItemID; |
|
43 |
|
44 |
|
45 // ========================================================== |
|
46 |
|
47 /** |
|
48 * CMsgIconControl is a class for drawing an icon |
|
49 */ |
|
50 NONSHARABLE_CLASS( CMsgIconControl ) : public CCoeControl |
|
51 { |
|
52 |
|
53 public: // Constructor and destructor |
|
54 |
|
55 /** |
|
56 * Symbian constructor |
|
57 * @param aParent parent control |
|
58 */ |
|
59 static CMsgIconControl* NewL( const CCoeControl& aParent ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CMsgIconControl(); |
|
65 |
|
66 public: |
|
67 |
|
68 /** |
|
69 * Loads icon from specified file using bitmap id and mask id. |
|
70 * |
|
71 * @param aId Item Id. |
|
72 * @param aFileName Name of the file that includes wanted icon bitmap |
|
73 * @param aFileBitmapId ID of the icon bitmap |
|
74 * @param aFileMaskId ID of the icon mask. -1 (default) if no mask needed. |
|
75 */ |
|
76 void LoadIconL( const TAknsItemID& aId, |
|
77 const TDesC& aFileName, |
|
78 const TInt aFileBitmapId, |
|
79 const TInt aFileMaskId = -1 ); |
|
80 |
|
81 /** |
|
82 * Sets the icon, used by svgt thumbnail |
|
83 * |
|
84 * @param aIcon is the icon |
|
85 */ |
|
86 void SetIcon( CGulIcon* aIcon ); |
|
87 |
|
88 /** |
|
89 * Sets size to the icon |
|
90 * |
|
91 * @param aSize New size. |
|
92 */ |
|
93 void SetBitmapSizeL( const TSize& aSize ); |
|
94 |
|
95 /** |
|
96 * Size of the bitmap owned by icon control |
|
97 * @return size |
|
98 */ |
|
99 TSize BitmapSize(); |
|
100 |
|
101 /** |
|
102 * Returns the currently loaded icon's bitmap id. |
|
103 */ |
|
104 TInt IconBitmapId() const; |
|
105 |
|
106 public: // Functions from base classes |
|
107 |
|
108 /** |
|
109 * From CCoeControl. Handles resource change events. |
|
110 */ |
|
111 void HandleResourceChange( TInt aType ); |
|
112 |
|
113 protected: // from CCoeControl |
|
114 |
|
115 /** |
|
116 * From CCoeControl Draws control |
|
117 */ |
|
118 void Draw( const TRect& aRect ) const; |
|
119 |
|
120 private: // Constructors |
|
121 |
|
122 /** |
|
123 * C++ default constructor. |
|
124 */ |
|
125 CMsgIconControl(); |
|
126 |
|
127 /** |
|
128 * By default Symbian constructor is private. |
|
129 */ |
|
130 void ConstructL( const CCoeControl& aParent ); |
|
131 |
|
132 private: //Data |
|
133 |
|
134 CGulIcon* iIcon; |
|
135 const CMsgMediaControl* iParent; |
|
136 |
|
137 TAknsItemID iSkinId; |
|
138 HBufC* iFileName; |
|
139 TInt iFileBitmapId; |
|
140 TInt iFileMaskId; |
|
141 }; |
|
142 |
|
143 |
|
144 #endif // MSGICONCONTROL_H |