taskswitcher/server/src/tsrunningappimp.cpp
changeset 125 26079c1bb561
child 127 7b66bc3c6dc9
equal deleted inserted replaced
123:d1dadafc5584 125:26079c1bb561
       
     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 
       
    18 #include <apgwgnam.h>
       
    19 
       
    20 #include "tsrunningappimp.h"
       
    21 #include "tsresourcemanager.h"
       
    22 
       
    23 //------------------------------------------------------------------------------
       
    24 CTsRunningApp* CTsRunningApp::NewLC( 
       
    25                              MTsResourceManager& aResources,
       
    26                              const RWsSession::TWindowGroupChainInfo& aInfo )
       
    27     {
       
    28     CTsRunningApp* self = new(ELeave) CTsRunningApp(aResources, aInfo);
       
    29     CleanupStack::PushL( self );
       
    30     return self;
       
    31     }
       
    32 
       
    33 //------------------------------------------------------------------------------
       
    34 CTsRunningApp::~CTsRunningApp()
       
    35     {
       
    36     delete iWindowGroupName;
       
    37     }
       
    38 
       
    39 //------------------------------------------------------------------------------
       
    40 CTsRunningApp::CTsRunningApp( MTsResourceManager& aResources,
       
    41                const RWsSession::TWindowGroupChainInfo& aInfo )
       
    42 :
       
    43 iResources(aResources),
       
    44 iWindowGroupInfo(aInfo)
       
    45     {
       
    46     //No implementation required
       
    47     }
       
    48 
       
    49 //------------------------------------------------------------------------------
       
    50 const CApaWindowGroupName& CTsRunningApp::WindowGroupNameL() const
       
    51     {
       
    52     if( 0 == iWindowGroupName )
       
    53         {
       
    54         iWindowGroupName = CApaWindowGroupName::NewL( iResources.WsSession(), 
       
    55                                                       WindowGroupId() );
       
    56         }
       
    57     return *iWindowGroupName;
       
    58     }
       
    59 
       
    60 //------------------------------------------------------------------------------
       
    61 TUid CTsRunningApp::UidL()const
       
    62     {
       
    63     return WindowGroupNameL().AppUid();
       
    64     }
       
    65 
       
    66 //------------------------------------------------------------------------------
       
    67 const TDesC& CTsRunningApp::CaptionL() const
       
    68     {
       
    69     iCaption.Set(WindowGroupNameL().Caption());
       
    70     return iCaption;
       
    71     
       
    72     }
       
    73 
       
    74 //------------------------------------------------------------------------------
       
    75 TInt CTsRunningApp::WindowGroupId() const
       
    76     {
       
    77     return iWindowGroupInfo.iId;
       
    78     }
       
    79 
       
    80 //------------------------------------------------------------------------------
       
    81 TInt CTsRunningApp::ParentWindowGroupId() const
       
    82     {
       
    83     return iWindowGroupInfo.iParentId;
       
    84     }
       
    85 
       
    86 //------------------------------------------------------------------------------
       
    87 TBool CTsRunningApp::IsEmbeded() const
       
    88     {
       
    89     return 0 < iWindowGroupInfo.iParentId;
       
    90     }
       
    91 
       
    92 //------------------------------------------------------------------------------
       
    93 TBool CTsRunningApp::IsHiddenL() const
       
    94     {
       
    95     return WindowGroupNameL().Hidden();
       
    96     }
       
    97 
       
    98 //------------------------------------------------------------------------------
       
    99 TBool CTsRunningApp::IsSystemL() const
       
   100     {
       
   101     return  WindowGroupNameL().IsSystem();
       
   102     }