|
1 /* |
|
2 * Copyright (c) 2010 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: Home screen Backup/Restore observer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "hsdatabase.h" |
|
20 #include "hsbackuprestoreobserver.h" |
|
21 |
|
22 |
|
23 /*! |
|
24 Singleton. |
|
25 */ |
|
26 HsBackupRestoreObserver *HsBackupRestoreObserver::instance() |
|
27 { |
|
28 if (!mInstance) { |
|
29 mInstance = new HsBackupRestoreObserver(); |
|
30 } |
|
31 return mInstance; |
|
32 } |
|
33 |
|
34 /*! |
|
35 Constructs a new observer with the given \a parent object. |
|
36 */ |
|
37 HsBackupRestoreObserver::HsBackupRestoreObserver(QObject *parent) |
|
38 : QObject(parent), |
|
39 mBUROngoing(false) |
|
40 { |
|
41 } |
|
42 |
|
43 /*! |
|
44 Destructor. |
|
45 */ |
|
46 HsBackupRestoreObserver::~HsBackupRestoreObserver() |
|
47 { |
|
48 } |
|
49 |
|
50 /*! |
|
51 Called when backup/restore is started. |
|
52 */ |
|
53 void HsBackupRestoreObserver::backupRestoreStarted() |
|
54 { |
|
55 mBUROngoing = true; |
|
56 emit event_backupRestoreStarted(); |
|
57 } |
|
58 |
|
59 /*! |
|
60 Called when backup/restore is completed. |
|
61 */ |
|
62 void HsBackupRestoreObserver::backupRestoreCompleted() |
|
63 { |
|
64 mBUROngoing = false; |
|
65 emit event_backupRestoreCompleted(); |
|
66 } |
|
67 |
|
68 /*! |
|
69 Called when Home screen is ready for backup/restore. |
|
70 */ |
|
71 void HsBackupRestoreObserver::readyForBUR() |
|
72 { |
|
73 } |
|
74 |
|
75 /*! |
|
76 Returns true if bacup/restore is ongoing. |
|
77 */ |
|
78 bool HsBackupRestoreObserver::checkBUR() |
|
79 { |
|
80 if (mBUROngoing) { |
|
81 return true; |
|
82 } |
|
83 return false; |
|
84 } |
|
85 /*! |
|
86 Points to the observer instance. |
|
87 */ |
|
88 HsBackupRestoreObserver *HsBackupRestoreObserver::mInstance(0); |
|
89 |
|
90 // End of File |