taskswitcher/server/tsrc/t_tsstorage/t_tsmodel.cpp
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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 "t_tsmodel.h"
       
    18 
       
    19 _LIT(KDisplayName, "TestName" );
       
    20 
       
    21 T_TsModel::T_TsModel(int items)
       
    22 {
       
    23     mItemsCount = items;
       
    24 }
       
    25 
       
    26 TInt T_TsModel::count() const
       
    27 {
       
    28     return mItemsCount;
       
    29 }
       
    30 
       
    31 void T_TsModel::setObserver(MTsModelObserver *observer)
       
    32 {
       
    33     mObserver = observer;
       
    34 }
       
    35 
       
    36 const TDesC& T_TsModel::displayNameL(TInt /*offset*/) const
       
    37 {
       
    38     return KDisplayName();
       
    39 }
       
    40 
       
    41 TInt T_TsModel::iconHandleL(TInt /*offset*/) const
       
    42 {
       
    43     return 0;
       
    44 }
       
    45 
       
    46 TTime T_TsModel::timestampL(TInt offset) const
       
    47 {
       
    48     if (0 == (offset %2)) {
       
    49         offset = 0;
       
    50     }else if(0 == (offset % 5)) {
       
    51         offset = 1;
       
    52     }
       
    53     return TTime(offset);
       
    54 }
       
    55 
       
    56 TTsModelItemKey T_TsModel::keyL(TInt offset) const
       
    57 {
       
    58     return TTsModelItemKey(offset, reinterpret_cast<TInt>(this));
       
    59 }
       
    60 
       
    61 TBool T_TsModel::isActiveL(TInt /*offset*/) const
       
    62 {
       
    63     return ETrue;
       
    64 }
       
    65 
       
    66 TBool T_TsModel::isClosableL(TInt /*offset*/) const
       
    67 {
       
    68     return ETrue;
       
    69 }
       
    70 
       
    71 TBool T_TsModel::closeL(TTsModelItemKey) const
       
    72 {
       
    73     return ETrue;
       
    74 }
       
    75 
       
    76 TBool T_TsModel::launchL(TTsModelItemKey ) const
       
    77 {
       
    78     return ETrue;
       
    79 }