taskswitcher/client/src/tstask.cpp
changeset 127 7b66bc3c6dc9
parent 116 305818acdca4
equal deleted inserted replaced
126:efda7c0771b9 127:7b66bc3c6dc9
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
       
    17 #include <xqconversions.h>
    17 #include "tstask.h"
    18 #include "tstask.h"
    18 
    19 #include "tscliententry.h"
    19 #include "tstaskcontent.h"
       
    20 #include "tstasklauncher.h"
    20 #include "tstasklauncher.h"
    21 
    21 
    22 /*!
    22 /*!
    23     @class TsTask
    23     @class TsTask
    24     @ingroup publicApi
    24     @ingroup publicApi
    30 
    30 
    31 /*!
    31 /*!
    32     @internal
    32     @internal
    33     Constructor. 
    33     Constructor. 
    34 */
    34 */
    35 TsTask::TsTask(const QSharedPointer<TsTaskContent> &content, TsTaskLauncher &launcher) : mContent(content), mLauncher(launcher)
    35 TsTask::TsTask(const QSharedPointer<CTsClientEntry> &content, TsTaskLauncher &launcher) : mContent(content), mLauncher(launcher)
    36 {
    36 {
    37 }
    37 }
    38 
    38 
    39 /*!
    39 /*!
    40     Destructor.
    40     Destructor.
    46 /*!
    46 /*!
    47     @return True if it's possible to close the task, false otherwise.
    47     @return True if it's possible to close the task, false otherwise.
    48 */
    48 */
    49 bool TsTask::isClosable() const
    49 bool TsTask::isClosable() const
    50 {
    50 {
    51     return mContent->mClosable;
    51     return EFalse != mContent->IsClosable();
    52 }
    52 }
    53 
    53 
    54 /*!
    54 /*!
    55     @return True if the task is running, false otherwise.
    55     @return True if the task is running, false otherwise.
    56 */
    56 */
    57 bool TsTask::isActive() const
    57 bool TsTask::isActive() const
    58 {
    58 {
    59     return mContent->mActive;
    59     return EFalse != mContent->IsActive();
    60 }
    60 }
    61 
    61 
    62 /*!
    62 /*!
    63     @return Screenshot of the task.
    63     @return Screenshot of the task.
    64 */
    64 */
    65 QPixmap TsTask::screenshot() const
    65 QPixmap TsTask::screenshot() const
    66 {
    66 {
    67     return mContent->mScreenshot;
    67     
       
    68     return mContent->Icon() ? QPixmap::fromSymbianCFbsBitmap(mContent->Icon()) :
       
    69                               QPixmap();
    68 }
    70 }
    69 
    71 
    70 /*!
    72 /*!
    71     @return Name of the task.
    73     @return Name of the task.
    72 */
    74 */
    73 QString TsTask::name() const
    75 QString TsTask::name() const
    74 {
    76 {
    75     return mContent->mName;
    77     return XQConversions::s60DescToQString(mContent->DisplayName());
    76 }
    78 }
    77 
    79 
    78 /*!
    80 /*!
    79     Start or bring the task to foreground.
    81     Start or bring the task to foreground.
    80 */
    82 */
    81 void TsTask::open()
    83 void TsTask::open()
    82 {
    84 {
    83     mLauncher.openTask(mContent->mKey);
    85     
       
    86     mLauncher.openTask(*mContent);
    84 }
    87 }
    85 
    88 
    86 /*!
    89 /*!
    87     Close the task.
    90     Close the task.
    88 */
    91 */
    89 void TsTask::close()
    92 void TsTask::close()
    90 {
    93 {
    91     mLauncher.closeTask(mContent->mKey);
    94     mLauncher.closeTask(*mContent);
    92 }
    95 }