taskswitcher/utils/src/tsunregscreenshotmsg.cpp
changeset 116 305818acdca4
equal deleted inserted replaced
112:dbfb5e38438b 116:305818acdca4
       
     1 /*
       
     2 * Copyright (c) 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:  Task list entry
       
    15 *
       
    16 */
       
    17 #include "tsunregscreenshotmsg.h"
       
    18 #include <s32mem.h>
       
    19 // -----------------------------------------------------------------------------
       
    20 CTsUnregisterScreenshotMsg* CTsUnregisterScreenshotMsg::NewLC(RReadStream& stream)
       
    21 {
       
    22     CTsUnregisterScreenshotMsg* self = new(ELeave)CTsUnregisterScreenshotMsg();
       
    23     CleanupStack::PushL(self);
       
    24     self->ConstructL(stream);
       
    25     return self;
       
    26 }
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 CTsUnregisterScreenshotMsg* CTsUnregisterScreenshotMsg::NewLC(TInt windowGroupId)
       
    30 {
       
    31     CTsUnregisterScreenshotMsg* self = new(ELeave)CTsUnregisterScreenshotMsg();
       
    32     CleanupStack::PushL(self);
       
    33     self->ConstructL(windowGroupId);
       
    34     return self;
       
    35 }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 CTsUnregisterScreenshotMsg::CTsUnregisterScreenshotMsg()
       
    39 {
       
    40     //No implementation required
       
    41 }
       
    42 // -----------------------------------------------------------------------------
       
    43 void CTsUnregisterScreenshotMsg::ConstructL(RReadStream &stream)
       
    44 {
       
    45     stream >> (*this);
       
    46 }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 void CTsUnregisterScreenshotMsg::ConstructL(TInt windowGroupId)
       
    50 {
       
    51     mWindowGroupId = windowGroupId;
       
    52 }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 TInt CTsUnregisterScreenshotMsg::size()
       
    56 {
       
    57     return sizeof(TInt);
       
    58 }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 CTsUnregisterScreenshotMsg::~CTsUnregisterScreenshotMsg()
       
    62 {
       
    63     //No implementation required
       
    64 }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 TInt CTsUnregisterScreenshotMsg::windowGroupId() const
       
    68 {
       
    69     return mWindowGroupId;
       
    70 }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 HBufC8* CTsUnregisterScreenshotMsg::ExternalizeLC() const
       
    74 {
       
    75     HBufC8* retVal = HBufC8::NewLC(size());
       
    76     TPtr8 des(retVal->Des());
       
    77     RDesWriteStream stream(des);
       
    78     CleanupClosePushL(stream);
       
    79     stream << (*this);
       
    80     CleanupStack::PopAndDestroy(&stream);
       
    81     return retVal;
       
    82 }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 void CTsUnregisterScreenshotMsg::ExternalizeL(RWriteStream &stream) const
       
    86 {
       
    87     stream.WriteInt32L(mWindowGroupId);
       
    88 }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 void CTsUnregisterScreenshotMsg::InternalizeL(RReadStream &stream)
       
    92 {
       
    93     mWindowGroupId = stream.ReadInt32L();
       
    94 }