diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsbackuprestoreobserver_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsbackuprestoreobserver_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2010 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: Home screen Backup/Restore observer. +* +*/ + + +#include "hsdatabase.h" +#include "hsbackuprestoreobserver.h" + + +/*! + Singleton. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::instance() +{ + if (!mInstance) { + mInstance = new HsBackupRestoreObserver(); + } + return mInstance; +} + +/*! + Constructs a new observer with the given \a parent object. +*/ +HsBackupRestoreObserver::HsBackupRestoreObserver(QObject *parent) + : QObject(parent), + mBUROngoing(false) +{ +} + +/*! + Destructor. +*/ +HsBackupRestoreObserver::~HsBackupRestoreObserver() +{ +} + +/*! + Called when backup/restore is started. +*/ +void HsBackupRestoreObserver::backupRestoreStarted() +{ + mBUROngoing = true; + emit event_backupRestoreStarted(); +} + +/*! + Called when backup/restore is completed. +*/ +void HsBackupRestoreObserver::backupRestoreCompleted() +{ + mBUROngoing = false; + emit event_backupRestoreCompleted(); +} + +/*! + Called when Home screen is ready for backup/restore. +*/ +void HsBackupRestoreObserver::readyForBUR() +{ +} + +/*! + Returns true if bacup/restore is ongoing. +*/ +bool HsBackupRestoreObserver::checkBUR() +{ + if (mBUROngoing) { + return true; + } + return false; +} +/*! + Points to the observer instance. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::mInstance(0); + +// End of File