contextframework/cfw/src/cfscriptengine/cfscriptinfo.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  CCFScriptInfo class implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // SYSTEM INCLUDES
       
    20 
       
    21 // USER INCLUDES
       
    22 #include "cfscriptinfo.h"
       
    23 #include "cftrace.h"
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ========
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // C++ constructor.
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CCFScriptInfo::CCFScriptInfo( TInt aScriptId,
       
    32     const TUid& aOwnerUid,
       
    33     TInt aLength,
       
    34     MCFScriptOwner* aScriptOwner ):
       
    35     iScriptId( aScriptId ),
       
    36     iOwnerUid( aOwnerUid ),
       
    37     iLength( aLength ),
       
    38     iScriptOwner( aScriptOwner )
       
    39     {
       
    40     FUNC_LOG;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // Symbian 2nd phase constructor.
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void CCFScriptInfo::ConstructL( const TDesC& aName )
       
    48     {
       
    49     FUNC_LOG;
       
    50     
       
    51     iName = aName.AllocL();
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // Symbian two phased constructor.
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CCFScriptInfo* CCFScriptInfo::NewL( const TDesC& aName,
       
    59     TInt aScriptId,
       
    60     const TUid& aOwner,
       
    61     TInt aLength,
       
    62     MCFScriptOwner* aScriptOwner )
       
    63     {
       
    64     FUNC_LOG;
       
    65 
       
    66     CCFScriptInfo* self = CCFScriptInfo::NewLC(
       
    67         aName, aScriptId, aOwner, aLength, aScriptOwner );
       
    68     CleanupStack::Pop ( self );
       
    69     return self;
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // Symbian two phased constructor.
       
    74 // Leaves pointer in the cleanup stack.
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 CCFScriptInfo* CCFScriptInfo::NewLC( const TDesC& aName,
       
    78     TInt aScriptId,
       
    79     const TUid& aOwner,
       
    80     TInt aLength,
       
    81     MCFScriptOwner* aScriptOwner )
       
    82     {
       
    83     FUNC_LOG;
       
    84 
       
    85     CCFScriptInfo* self = new( ELeave ) CCFScriptInfo(
       
    86         aScriptId, aOwner, aLength, aScriptOwner );
       
    87     CleanupStack::PushL( self );
       
    88     self->ConstructL( aName );
       
    89     return self;
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // C++ destructor.
       
    94 // ---------------------------------------------------------------------------
       
    95 //
       
    96 CCFScriptInfo::~CCFScriptInfo( )
       
    97     {
       
    98     FUNC_LOG;
       
    99     
       
   100     delete iName;
       
   101     }
       
   102 
       
   103 //------------------------------------------------------------------------------
       
   104 // CCFScriptInfo::Name
       
   105 //------------------------------------------------------------------------------
       
   106 //
       
   107 TPtrC CCFScriptInfo::Name() const
       
   108     {
       
   109     FUNC_LOG;
       
   110     
       
   111     TPtrC name( KNullDesC );
       
   112     if( iName )
       
   113         {
       
   114         name.Set( *iName );
       
   115         }
       
   116     return name;
       
   117     }
       
   118 
       
   119 //------------------------------------------------------------------------------
       
   120 // CCFScriptInfo::Id
       
   121 //------------------------------------------------------------------------------
       
   122 //
       
   123 TInt CCFScriptInfo::Id() const
       
   124     {
       
   125     FUNC_LOG;
       
   126     
       
   127     return iScriptId;
       
   128     }
       
   129 
       
   130 //------------------------------------------------------------------------------
       
   131 // CCFScriptInfo::OwnerUid
       
   132 //------------------------------------------------------------------------------
       
   133 //
       
   134 const TUid& CCFScriptInfo::OwnerUid() const
       
   135     {
       
   136     FUNC_LOG;
       
   137     
       
   138     return iOwnerUid;
       
   139     }
       
   140 
       
   141 //------------------------------------------------------------------------------
       
   142 // CCFScriptInfo::Length
       
   143 //------------------------------------------------------------------------------
       
   144 //
       
   145 TInt CCFScriptInfo::Length() const
       
   146     {
       
   147     FUNC_LOG;
       
   148     
       
   149     return iLength;
       
   150     }
       
   151 
       
   152 //------------------------------------------------------------------------------
       
   153 // CCFScriptInfo::OwnerSession
       
   154 //------------------------------------------------------------------------------
       
   155 //
       
   156 MCFScriptOwner* CCFScriptInfo::OwnerSession() const
       
   157     {
       
   158     FUNC_LOG;
       
   159     
       
   160     return iScriptOwner;
       
   161     }
       
   162 
       
   163 //------------------------------------------------------------------------------
       
   164 // CCFScriptInfo::SetOwnerSession
       
   165 //------------------------------------------------------------------------------
       
   166 //
       
   167 void CCFScriptInfo::SetOwnerSession( MCFScriptOwner* aScriptOwner )
       
   168     {
       
   169     FUNC_LOG;
       
   170     
       
   171     iScriptOwner = aScriptOwner;
       
   172     }
       
   173 
       
   174 // End of file