|
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 * The purpose of this class is to observe if there are messages |
|
16 * in the outbox. |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef TESTOUTBOXOBSERVER_STUB_H_ |
|
21 #define TESTOUTBOXOBSERVER_STUB_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <msvapi.h> // for MMsvSessionObserver |
|
26 #include "msignalstrengthobserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 class CMsvSession; |
|
31 class COutboxSender; |
|
32 class MSignalStrengthHandler; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Observes if there are messages in the OutBox.. |
|
38 */ |
|
39 class CTestOutboxObserver: public MSignalStrengthObserver |
|
40 { |
|
41 public: |
|
42 // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * A Two-phased constructor. |
|
46 */ |
|
47 static CTestOutboxObserver* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CTestOutboxObserver(); |
|
53 |
|
54 private: |
|
55 // From MSignalStrengthObserver |
|
56 |
|
57 void SignalStrengthAndBarUpdatedL(TInt aNewSignalValue, TInt aNewBarValue); |
|
58 |
|
59 public: |
|
60 |
|
61 void HandleMsvSessionReadyL(CMsvSession& aMsvSession); |
|
62 void HandleMsvSessionClosedL(); |
|
63 |
|
64 public: |
|
65 // New functions |
|
66 |
|
67 /** |
|
68 * Informs the networkstatus to Outbox Sender |
|
69 */ |
|
70 void InformOutboxSenderL(const TInt& aNetworkBars); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * A C++ constructor. |
|
76 */ |
|
77 CTestOutboxObserver(); |
|
78 |
|
79 /** |
|
80 * By default Symbian OS constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 /** |
|
85 * Creates the Msv Session and sets the outbox |
|
86 * observer and outbox sender. |
|
87 * @param aMsvSession The Msv session to use. |
|
88 */ |
|
89 void StartSessionsL(CMsvSession& aMsvSession); |
|
90 |
|
91 /** |
|
92 * Delete session, outbox observer and outbox sender. |
|
93 */ |
|
94 void EndSessions(); |
|
95 |
|
96 private: |
|
97 // In-box folder entry. Note that the entry is not owned by this class. |
|
98 CMsvEntry* iOutboxFolder; |
|
99 // Pointer to Outbox Sender. |
|
100 COutboxSender* iOutboxSender; |
|
101 // Signal strength handler. Owned. |
|
102 MSignalStrengthHandler* iSignalStrengthHandler; |
|
103 }; |
|
104 |
|
105 #endif /* TESTOUTBOXOBSERVER_STUB_H_ */ |