1 /* |
|
2 * Copyright (c) 2006-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: Introduces CSatUiIconHandler class, which handles |
|
15 * icon fetching for SatUi. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CSATUIICONHANDLER_H |
|
21 #define CSATUIICONHANDLER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <rsatservice.h> |
|
25 |
|
26 class CFbsBitmap; |
|
27 class RSatSession; |
|
28 |
|
29 /** |
|
30 * Handles asynchronous icon fetching for SatUi. |
|
31 * |
|
32 * Opens connection to SatClient by using received session attribute. |
|
33 * Receives icon information and does the selection based on received icon id |
|
34 * attribute. Asks the handle of the icon bitmap from the SatClient's |
|
35 * RSatIcon class by giving the icon information and the package for handle, |
|
36 * which is done asynchronously. For mean time, this class is waiting for |
|
37 * completion of request by starting CActiveSchedulerWait, which is stopped |
|
38 * when request is completed. After that the icon is duplicated via RSatIcon |
|
39 * by giving the handle information. This is also an asynchronous call and |
|
40 * CActiveSchedulerWait is started again. When completed the pointer to the |
|
41 * bitmap is returned. |
|
42 * |
|
43 * @lib satui.exedll |
|
44 * @since S60 v3.1 |
|
45 */ |
|
46 class CSatUiIconHandler : public CBase |
|
47 { |
|
48 |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Constructor. |
|
53 */ |
|
54 static CSatUiIconHandler* NewL(); |
|
55 |
|
56 /* |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CSatUiIconHandler(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * The method, which fetches the icon. |
|
65 * |
|
66 * @since S60 v3.1 |
|
67 * @param aSatSession Session information for SatClient interface. |
|
68 * @param aIconId Id for icon to be fetched. |
|
69 * @param aOptWidth Optimal width of the icon to be fetched. |
|
70 * @param aOptHeight Optimal height of the icon to be fetched. |
|
71 * @param aIconSupport Flag to signal if icons are not supported at all |
|
72 * @return A pointer to the icon bitmap. |
|
73 */ |
|
74 CFbsBitmap* FetchIconL( const RSatSession& aSatSession, |
|
75 const TUint8 aIconId, |
|
76 const TInt aOptWidth, |
|
77 const TInt aOptHeight, |
|
78 TBool& aIconSupport ); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 * |
|
85 * @since S60 v3.1 |
|
86 */ |
|
87 CSatUiIconHandler(); |
|
88 |
|
89 /** |
|
90 * Sorts the icons into order of superiority and saves the order into a list |
|
91 * |
|
92 * @since S60 v3.1 |
|
93 * @param aIconEf List of icons |
|
94 * @param aSelectedIcons List into which order is saved |
|
95 * @param aOptWidth Optimal width of the icon to be fetched. |
|
96 * @param aOptHeight Optimal height of the icon to be fetched. |
|
97 */ |
|
98 void SortIconsL( const RIconEf& aIconEf, |
|
99 RArray<TInt>& aSelectedIcons, |
|
100 const TInt aOptWidth, |
|
101 const TInt aOptHeight ) const; |
|
102 |
|
103 private: // data |
|
104 |
|
105 /** |
|
106 * RSatService of the SatClient. |
|
107 */ |
|
108 RSatService iSatService; |
|
109 |
|
110 }; |
|
111 |
|
112 #endif // CSATUIICONHANDLER_H |
|