|
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: |
|
15 * This class follows the offline status of the phone. When the mode is |
|
16 * changed from online to offline, the sending operation is started. When |
|
17 * the mode is changed from online to offline, the current sending |
|
18 * operation is cancelled. |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 #ifndef TESTOUTBOXSENDER_STUB_H_ |
|
24 #define TESTOUTBOXSENDER_STUB_H_ |
|
25 |
|
26 // INCLUDES |
|
27 #include <msvapi.h> |
|
28 #include <MuiuMsvSingleOpWatcher.h> |
|
29 #include <cenrepnotifyhandler.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CRepository; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 class CTestOutboxSender: public MMsvSingleOpWatcher |
|
37 { |
|
38 public: |
|
39 // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * A two-phased constructor. |
|
43 */ |
|
44 static CTestOutboxSender* NewL(CMsvSession& aMsvSession); |
|
45 |
|
46 /** |
|
47 * A destructor. |
|
48 */ |
|
49 virtual ~CTestOutboxSender(); |
|
50 |
|
51 public: |
|
52 // New functions |
|
53 |
|
54 /** |
|
55 * Starts the message sending operation for sms-messages. |
|
56 */ |
|
57 void StartSendingL(); |
|
58 |
|
59 /** |
|
60 * Cancels current message sending operation. |
|
61 */ |
|
62 void CancelSending(); |
|
63 |
|
64 /** |
|
65 * Checks if the sending operation is currently active. |
|
66 */ |
|
67 TBool IsSending() const; |
|
68 |
|
69 /** |
|
70 * Confirms the network status and starts sending messages |
|
71 */ |
|
72 void CheckAndStartSendingL(const TInt& aNetworkBars); |
|
73 |
|
74 public: |
|
75 // Functions from base classes |
|
76 |
|
77 /** |
|
78 * From MMsvSingleOpWatcher. Deletes the sending operation. |
|
79 */ |
|
80 virtual void OpCompleted(CMsvSingleOpWatcher& aOpWatcher, TInt aCompletionCode); |
|
81 |
|
82 private: |
|
83 /** |
|
84 * A C++ Constructor |
|
85 */ |
|
86 CTestOutboxSender(CMsvSession& aMsvSession); |
|
87 |
|
88 /** |
|
89 * Creates the connection to shared data and |
|
90 * begins listening the KGSNetworkConnectionAllowed-key. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 /** |
|
95 * Checks whether SMS sending is needed in boot-phase and |
|
96 * launches the sending operation |
|
97 */ |
|
98 void CheckBootPhaseL(); |
|
99 |
|
100 private: |
|
101 enum TCleanupFlags |
|
102 { |
|
103 EUserSettingsConnected = 0x01, |
|
104 EUserSettingsNotifierSet = 0x02, |
|
105 EOffllineSendingNeeded = 0x10 |
|
106 }; |
|
107 }; |
|
108 |
|
109 #endif /* TESTOUTBOXSENDER_STUB_H_ */ |