idlefw/plugins/shortcutplugin/src/caiscutshortcutinfo.cpp
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Small container for shortcut info.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "caiscutshortcutinfo.h"
       
    20 
       
    21 // ======== MEMBER FUNCTIONS ========
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 //
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 CAiScutShortcutInfo::CAiScutShortcutInfo(TInt aId)
       
    28     : iId(aId)
       
    29 {
       
    30 }
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 //
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 void CAiScutShortcutInfo::ConstructL(const TDesC& aTarget)
       
    37 {
       
    38     iTarget = aTarget.AllocL();
       
    39 }
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CAiScutShortcutInfo* CAiScutShortcutInfo::NewL(TInt aId, const TDesC& aTarget)
       
    46 {
       
    47     CAiScutShortcutInfo* self = new(ELeave) CAiScutShortcutInfo(aId);
       
    48     CleanupStack::PushL(self);
       
    49     self->ConstructL(aTarget);
       
    50     CleanupStack::Pop(self);
       
    51     return self;
       
    52 }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CAiScutShortcutInfo::~CAiScutShortcutInfo()
       
    59 {
       
    60     delete iTarget;
       
    61 }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // Returns the shortcut id.
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 TInt32 CAiScutShortcutInfo::Id() const
       
    68 {
       
    69     return iId;
       
    70 }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // Returns the shortcut target string.
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 const TDesC& CAiScutShortcutInfo::Target()
       
    77     {
       
    78     if( iTarget )
       
    79         return *iTarget;
       
    80     else
       
    81         return KNullDesC;
       
    82     }
       
    83 
       
    84 // Eof