16 */ |
16 */ |
17 #include "tstask.h" |
17 #include "tstask.h" |
18 |
18 |
19 #include <XQConversions> |
19 #include <XQConversions> |
20 |
20 |
21 #include "tsfswentry.h" |
21 #include "tsentry.h" |
22 |
22 |
23 TsTask::TsTask(CTsFswEntry* entry) : mEntry(entry) |
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) |
24 { |
38 { |
25 } |
39 } |
26 |
40 |
|
41 /*! |
|
42 Destructor. |
|
43 */ |
27 TsTask::~TsTask() |
44 TsTask::~TsTask() |
28 { |
45 { |
29 delete mEntry; |
46 delete mEntry; |
30 } |
47 } |
31 |
48 |
|
49 /*! |
|
50 @return True if it's possible to close the task, false otherwise. |
|
51 */ |
32 bool TsTask::isClosable() const |
52 bool TsTask::isClosable() const |
33 { |
53 { |
34 return mEntry->CloseableApp(); |
54 return mEntry->CloseableApp(); |
35 } |
55 } |
36 |
56 |
|
57 /*! |
|
58 @return Icon of the task. |
|
59 */ |
37 QPixmap TsTask::icon() const |
60 QPixmap TsTask::icon() const |
38 { |
61 { |
39 QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconBitmap()); |
62 QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconBitmap()); |
40 QPixmap mask = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconMask()); |
63 QPixmap mask = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconMask()); |
41 // @todo QPixmap::setAlphaChannel() is deprecated, change to code using QPainter |
64 // @todo QPixmap::setAlphaChannel() is deprecated, change to code using QPainter |
42 pixmap.setAlphaChannel(mask); |
65 pixmap.setAlphaChannel(mask); |
43 return pixmap; |
66 return pixmap; |
44 } |
67 } |
45 |
68 |
|
69 /*! |
|
70 @return Screenshot of the task. |
|
71 */ |
46 QPixmap TsTask::screenshot() const |
72 QPixmap TsTask::screenshot() const |
47 { |
73 { |
48 return QPixmap::fromSymbianCFbsBitmap(mEntry->Screenshot()); |
74 return QPixmap::fromSymbianCFbsBitmap(mEntry->Screenshot()); |
49 } |
75 } |
50 |
76 |
|
77 /*! |
|
78 @return Name of the task. |
|
79 */ |
51 QString TsTask::name() const |
80 QString TsTask::name() const |
52 { |
81 { |
53 return XQConversions::s60DescToQString(mEntry->AppName()); |
82 return XQConversions::s60DescToQString(mEntry->AppName()); |
54 } |
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 */ |