|
1 /* |
|
2 * Copyright (c) 2006, 2007 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: Header file for connectionmanager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CONNECTIONMANAGER_H |
|
20 #define CONNECTIONMANAGER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CDpsEngine; |
|
25 class CNotes; |
|
26 class CImagePrintUiAppUi; |
|
27 |
|
28 /** |
|
29 * CConnectionManager is an active object that sends an asynchronous request |
|
30 * to know about the connection status. |
|
31 */ |
|
32 class CConnectionManager : public CActive |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Factory method NewL |
|
39 * @param aAppUi the pointer to the AppUi instance |
|
40 * @param aEngine Instance to DpsEngine |
|
41 * @param aNotes Instance to Notes class |
|
42 * @return The new object. |
|
43 */ |
|
44 static CConnectionManager* NewL(CImagePrintUiAppUi* aAppUi, |
|
45 CDpsEngine* aEngine, CNotes* aNotes); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CConnectionManager(); |
|
51 |
|
52 /** |
|
53 * Starts search printer |
|
54 */ |
|
55 void StartSearchPrinter(); |
|
56 |
|
57 private: |
|
58 |
|
59 //from CActive |
|
60 |
|
61 /** |
|
62 * Implements CActive |
|
63 * @param none |
|
64 * @return none |
|
65 */ |
|
66 void RunL(); |
|
67 |
|
68 /** |
|
69 * Implements CActive |
|
70 * @param aError the error returned |
|
71 * @return error |
|
72 */ |
|
73 TInt RunError(TInt aError); |
|
74 |
|
75 /** |
|
76 * Implements CActive |
|
77 * @param none |
|
78 * @return none |
|
79 */ |
|
80 void DoCancel(); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * Starts listening for notifications. If already listening, nothing |
|
86 * happens. |
|
87 * @param none |
|
88 * @return none |
|
89 */ |
|
90 void StartListening(); |
|
91 |
|
92 /** |
|
93 * C++ default constructor |
|
94 * @param aAppUi the pointer to the AppUi instance |
|
95 * @param aEngine Instance of DpsEngine |
|
96 * @param aNotes Instance to Notes class |
|
97 */ |
|
98 CConnectionManager( CImagePrintUiAppUi* aAppUi, |
|
99 CDpsEngine* aEngine, CNotes* aNotes); |
|
100 |
|
101 private: //data |
|
102 |
|
103 |
|
104 CImagePrintUiAppUi* iAppUi; |
|
105 |
|
106 /** |
|
107 * Instance to DpsEngine to get connection status |
|
108 * Not own |
|
109 */ |
|
110 CDpsEngine* iDpsEngine; |
|
111 |
|
112 TBool iActiveNote; |
|
113 TBool iSetPrintCall; |
|
114 CNotes* iNotes; |
|
115 TInt iPreviousStatus; |
|
116 }; |
|
117 |
|
118 |
|
119 #endif // CONNECTIONMANAGER_H |
|
120 |
|
121 // End of File |