1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 #include "tstask.h" |
|
18 |
|
19 #include <XQConversions> |
|
20 |
|
21 #include "tsentry.h" |
|
22 |
|
23 /*! |
|
24 @class TsTask |
|
25 @ingroup publicApi |
|
26 @brief TsTask object represents a single task. |
|
27 |
|
28 This class is one of the Qt interfaces for Task Monitor server. It can be |
|
29 used to set custom screenshot of the task, or to change the task visibility. |
|
30 */ |
|
31 |
|
32 /*! |
|
33 @internal |
|
34 Constructor. |
|
35 Takes ownership over @a entry. |
|
36 */ |
|
37 TsTask::TsTask(CTsEntry* entry) : mEntry(entry) |
|
38 { |
|
39 } |
|
40 |
|
41 /*! |
|
42 Destructor. |
|
43 */ |
|
44 TsTask::~TsTask() |
|
45 { |
|
46 delete mEntry; |
|
47 } |
|
48 |
|
49 /*! |
|
50 @return True if it's possible to close the task, false otherwise. |
|
51 */ |
|
52 bool TsTask::isClosable() const |
|
53 { |
|
54 return mEntry->CloseableApp(); |
|
55 } |
|
56 |
|
57 /*! |
|
58 @return Icon of the task. |
|
59 */ |
|
60 QPixmap TsTask::icon() const |
|
61 { |
|
62 QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconBitmap()); |
|
63 QPixmap mask = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconMask()); |
|
64 // @todo QPixmap::setAlphaChannel() is deprecated, change to code using QPainter |
|
65 pixmap.setAlphaChannel(mask); |
|
66 return pixmap; |
|
67 } |
|
68 |
|
69 /*! |
|
70 @return Screenshot of the task. |
|
71 */ |
|
72 QPixmap TsTask::screenshot() const |
|
73 { |
|
74 return QPixmap::fromSymbianCFbsBitmap(mEntry->Screenshot()); |
|
75 } |
|
76 |
|
77 /*! |
|
78 @return Name of the task. |
|
79 */ |
|
80 QString TsTask::name() const |
|
81 { |
|
82 return XQConversions::s60DescToQString(mEntry->AppName()); |
|
83 } |
|
84 |
|
85 /*! |
|
86 @fn TsTask::open() |
|
87 Start or bring the task to foreground. |
|
88 */ |
|
89 |
|
90 /*! |
|
91 @fn TsTask::close() |
|
92 Close the task. |
|
93 */ |
|