os/persistentdata/loggingservices/eventlogger/LogCli/src/LogViewWindowLockObserver.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "LogViewWindowLockObserver.h"
    17 
    18 // User includes
    19 #include "logservcli.h"
    20 
    21 
    22 /////////////////////////////////////////////////////////////////////////////////////////
    23 // -----> CLogViewWindowLockObserver (source)
    24 /////////////////////////////////////////////////////////////////////////////////////////
    25 
    26 CLogViewWindowLockObserver::CLogViewWindowLockObserver(RLogSession& aSession, TLogViewId aViewId, MLogViewWindowLockObserver& aObserver, TInt aPriority)
    27 :	CLogActive(aPriority), iSession(aSession), iViewId(aViewId), iObserver(aObserver)
    28 	{
    29 	}
    30 
    31 CLogViewWindowLockObserver::~CLogViewWindowLockObserver()
    32 	{
    33 	Cancel();
    34 	}
    35 
    36 void CLogViewWindowLockObserver::ConstructL()
    37 	{
    38 	IssueRequest();
    39 	}
    40 
    41 /////////////////////////////////////////////////////////////////////////////////////////
    42 /////////////////////////////////////////////////////////////////////////////////////////
    43 /////////////////////////////////////////////////////////////////////////////////////////
    44 
    45 void CLogViewWindowLockObserver::DoRunL()
    46 	{
    47 	User::LeaveIfError(iStatus.Int());
    48 	const TLogViewLockStatus state = static_cast<TLogViewLockStatus>(iStatus.Int());
    49 	//
    50 	IssueRequest();
    51 	iObserver.HandleWindowLockStatusChangeL(state);
    52 	}
    53 
    54 void CLogViewWindowLockObserver::DoCancel()
    55 	{
    56 	iSession.Send(ELogViewNotifyLockStatusChangeCancel, TIpcArgs(iViewId));
    57 	}
    58 
    59 TInt CLogViewWindowLockObserver::RunError(TInt /*aError*/)
    60 	{
    61 	return KErrNone;
    62 	}
    63 
    64 
    65 /////////////////////////////////////////////////////////////////////////////////////////
    66 /////////////////////////////////////////////////////////////////////////////////////////
    67 /////////////////////////////////////////////////////////////////////////////////////////
    68 
    69 void CLogViewWindowLockObserver::IssueRequest()
    70 	{
    71 	iSession.Send(ELogViewNotifyLockStatusChange, TIpcArgs(iViewId), iStatus);
    72 	SetActive();
    73 	}
    74