taskswitcher/server/src/tsrunningappimp.cpp
author hgs
Wed, 06 Oct 2010 16:00:22 +0300
changeset 125 26079c1bb561
child 127 7b66bc3c6dc9
permissions -rw-r--r--
201039_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
125
26079c1bb561 201039_01
hgs
parents:
diff changeset
     1
/*
26079c1bb561 201039_01
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
26079c1bb561 201039_01
hgs
parents:
diff changeset
     3
 * All rights reserved.
26079c1bb561 201039_01
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
26079c1bb561 201039_01
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
26079c1bb561 201039_01
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
26079c1bb561 201039_01
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
26079c1bb561 201039_01
hgs
parents:
diff changeset
     8
 *
26079c1bb561 201039_01
hgs
parents:
diff changeset
     9
 * Initial Contributors:
26079c1bb561 201039_01
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
26079c1bb561 201039_01
hgs
parents:
diff changeset
    11
 *
26079c1bb561 201039_01
hgs
parents:
diff changeset
    12
 * Contributors:
26079c1bb561 201039_01
hgs
parents:
diff changeset
    13
 *
26079c1bb561 201039_01
hgs
parents:
diff changeset
    14
 * Description :
26079c1bb561 201039_01
hgs
parents:
diff changeset
    15
 *
26079c1bb561 201039_01
hgs
parents:
diff changeset
    16
 */
26079c1bb561 201039_01
hgs
parents:
diff changeset
    17
26079c1bb561 201039_01
hgs
parents:
diff changeset
    18
#include <apgwgnam.h>
26079c1bb561 201039_01
hgs
parents:
diff changeset
    19
26079c1bb561 201039_01
hgs
parents:
diff changeset
    20
#include "tsrunningappimp.h"
26079c1bb561 201039_01
hgs
parents:
diff changeset
    21
#include "tsresourcemanager.h"
26079c1bb561 201039_01
hgs
parents:
diff changeset
    22
26079c1bb561 201039_01
hgs
parents:
diff changeset
    23
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    24
CTsRunningApp* CTsRunningApp::NewLC( 
26079c1bb561 201039_01
hgs
parents:
diff changeset
    25
                             MTsResourceManager& aResources,
26079c1bb561 201039_01
hgs
parents:
diff changeset
    26
                             const RWsSession::TWindowGroupChainInfo& aInfo )
26079c1bb561 201039_01
hgs
parents:
diff changeset
    27
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    28
    CTsRunningApp* self = new(ELeave) CTsRunningApp(aResources, aInfo);
26079c1bb561 201039_01
hgs
parents:
diff changeset
    29
    CleanupStack::PushL( self );
26079c1bb561 201039_01
hgs
parents:
diff changeset
    30
    return self;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    31
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    32
26079c1bb561 201039_01
hgs
parents:
diff changeset
    33
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    34
CTsRunningApp::~CTsRunningApp()
26079c1bb561 201039_01
hgs
parents:
diff changeset
    35
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    36
    delete iWindowGroupName;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    37
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    38
26079c1bb561 201039_01
hgs
parents:
diff changeset
    39
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    40
CTsRunningApp::CTsRunningApp( MTsResourceManager& aResources,
26079c1bb561 201039_01
hgs
parents:
diff changeset
    41
               const RWsSession::TWindowGroupChainInfo& aInfo )
26079c1bb561 201039_01
hgs
parents:
diff changeset
    42
:
26079c1bb561 201039_01
hgs
parents:
diff changeset
    43
iResources(aResources),
26079c1bb561 201039_01
hgs
parents:
diff changeset
    44
iWindowGroupInfo(aInfo)
26079c1bb561 201039_01
hgs
parents:
diff changeset
    45
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    46
    //No implementation required
26079c1bb561 201039_01
hgs
parents:
diff changeset
    47
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    48
26079c1bb561 201039_01
hgs
parents:
diff changeset
    49
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    50
const CApaWindowGroupName& CTsRunningApp::WindowGroupNameL() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    51
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    52
    if( 0 == iWindowGroupName )
26079c1bb561 201039_01
hgs
parents:
diff changeset
    53
        {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    54
        iWindowGroupName = CApaWindowGroupName::NewL( iResources.WsSession(), 
26079c1bb561 201039_01
hgs
parents:
diff changeset
    55
                                                      WindowGroupId() );
26079c1bb561 201039_01
hgs
parents:
diff changeset
    56
        }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    57
    return *iWindowGroupName;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    58
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    59
26079c1bb561 201039_01
hgs
parents:
diff changeset
    60
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    61
TUid CTsRunningApp::UidL()const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    62
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    63
    return WindowGroupNameL().AppUid();
26079c1bb561 201039_01
hgs
parents:
diff changeset
    64
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    65
26079c1bb561 201039_01
hgs
parents:
diff changeset
    66
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    67
const TDesC& CTsRunningApp::CaptionL() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    68
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    69
    iCaption.Set(WindowGroupNameL().Caption());
26079c1bb561 201039_01
hgs
parents:
diff changeset
    70
    return iCaption;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    71
    
26079c1bb561 201039_01
hgs
parents:
diff changeset
    72
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    73
26079c1bb561 201039_01
hgs
parents:
diff changeset
    74
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    75
TInt CTsRunningApp::WindowGroupId() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    76
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    77
    return iWindowGroupInfo.iId;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    78
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    79
26079c1bb561 201039_01
hgs
parents:
diff changeset
    80
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    81
TInt CTsRunningApp::ParentWindowGroupId() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    82
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    83
    return iWindowGroupInfo.iParentId;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    84
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    85
26079c1bb561 201039_01
hgs
parents:
diff changeset
    86
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    87
TBool CTsRunningApp::IsEmbeded() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    88
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    89
    return 0 < iWindowGroupInfo.iParentId;
26079c1bb561 201039_01
hgs
parents:
diff changeset
    90
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    91
26079c1bb561 201039_01
hgs
parents:
diff changeset
    92
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    93
TBool CTsRunningApp::IsHiddenL() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
    94
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
    95
    return WindowGroupNameL().Hidden();
26079c1bb561 201039_01
hgs
parents:
diff changeset
    96
    }
26079c1bb561 201039_01
hgs
parents:
diff changeset
    97
26079c1bb561 201039_01
hgs
parents:
diff changeset
    98
//------------------------------------------------------------------------------
26079c1bb561 201039_01
hgs
parents:
diff changeset
    99
TBool CTsRunningApp::IsSystemL() const
26079c1bb561 201039_01
hgs
parents:
diff changeset
   100
    {
26079c1bb561 201039_01
hgs
parents:
diff changeset
   101
    return  WindowGroupNameL().IsSystem();
26079c1bb561 201039_01
hgs
parents:
diff changeset
   102
    }