taskswitcherapp/tsserviceplugin/src/s60/tslongpresswatcher_p.cpp
changeset 39 4e8ebe173323
parent 36 cdae8c6c3876
child 42 517f4fb5ec74
child 46 23b5d6a29cce
--- a/taskswitcherapp/tsserviceplugin/src/s60/tslongpresswatcher_p.cpp	Fri Apr 16 14:54:01 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "tslongpresswatcher_p.h"
-#include "tslongpresswatcher.h"
-
-// AknCapServer UID, used for P&S category
-const TUid KTaskswitcherStateCategory = { 0x10207218 };
-// Taskswitcher UI, used as P&S key
-const TUint KTaskswitcherStateKey = 0x2002677D;
-// Values for Taskswitcher launching P&S
-const TInt KTaskswitcherBackgroundValue = 1;
-const TInt KTaskswitcherForegroundValue = KTaskswitcherBackgroundValue << 1;
-const TInt KTaskswitcherLongAppKeyPressed = KTaskswitcherForegroundValue << 1;
-
-/*!
-    \class TsLongPressWatcherPrivate
-    \ingroup group_tsserviceplugin
-    \brief Private implementation of long press app key watcher.
-*/
-
-TsLongPressWatcherPrivate::TsLongPressWatcherPrivate(TsLongPressWatcher *parent) : CActive(CActive::EPriorityStandard), mParent(parent)
-{
-    CActiveScheduler::Add(this);
-    TInt err = mProperty.Attach(KTaskswitcherStateCategory, KTaskswitcherStateKey);
-    if (err == KErrNone) {
-        mProperty.Subscribe(iStatus);
-        SetActive();
-    }
-}
-
-TsLongPressWatcherPrivate::~TsLongPressWatcherPrivate()
-{
-    Cancel();
-    mProperty.Close();
-}
-
-void TsLongPressWatcherPrivate::setBackgroundState()
-{
-    TInt value(0);
-    mProperty.Get(value);
-    value &= ~KTaskswitcherForegroundValue;
-    value &= ~KTaskswitcherLongAppKeyPressed;
-    value |= KTaskswitcherBackgroundValue;
-    mProperty.Set(value);
-}
-
-void TsLongPressWatcherPrivate::DoCancel()
-{
-    mProperty.Cancel();
-}
-
-void TsLongPressWatcherPrivate::RunL()
-{
-    if (iStatus.Int() != KErrCancel) {
-        if (checkLongPressFlag()) {
-            setBackgroundState();
-            QT_TRYCATCH_LEAVING(emit mParent->applicationKeyLongPress());
-        }
-        mProperty.Subscribe(iStatus);
-        SetActive();
-    }
-}
-
-bool TsLongPressWatcherPrivate::checkLongPressFlag()
-{
-    TInt value(0);
-    bool res = false;
-    mProperty.Get(KTaskswitcherStateCategory, KTaskswitcherStateKey, value);
-    if (value & KTaskswitcherLongAppKeyPressed) {
-        res = true;
-    }
-    return res;
-}