1 /* |
|
2 * Copyright (c) 2004-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSERVERDISCOVERYGUARD_H |
|
20 #define CSERVERDISCOVERYGUARD_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "imageprint.h" |
|
25 #include "tdiscoveryguarddata.h" |
|
26 |
|
27 class CImagePrintBody; |
|
28 class TMessageWrp2; |
|
29 |
|
30 class CServerDiscoveryGuard : public CBase, public MPrinterDiscoveryObserver |
|
31 { |
|
32 public: |
|
33 |
|
34 /** |
|
35 * 2-phase constructor |
|
36 * |
|
37 * @param aEngine printing engine |
|
38 * @return new object |
|
39 */ |
|
40 static CServerDiscoveryGuard* NewL( CImagePrintBody& aEngine ); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~CServerDiscoveryGuard(); |
|
46 |
|
47 private: // from MPrinterDiscoveryObserver |
|
48 |
|
49 void FoundPrinterL(const TPrinter& aPrinterInfo); |
|
50 void DiscoveryStatusL(TInt aStatus, TInt aErrorCode, TInt aErrorStringCode); |
|
51 void RemovePrinterL(const TPrinter& aPrinterInfo); |
|
52 |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Start discovery and set this object as discovery events observer |
|
57 * |
|
58 * @param aMessage message contains OR:ed protocol ids |
|
59 */ |
|
60 TInt StartL( TMessageWrp2& aMessage ); |
|
61 |
|
62 /** |
|
63 * Continue waiting for discovery events |
|
64 * |
|
65 * @param aMessage message completed upon event arrival |
|
66 */ |
|
67 void ContinueL( TMessageWrp2& aMessage ); |
|
68 |
|
69 /** |
|
70 * Stop waiting for discovery events. Cancel waiting message |
|
71 */ |
|
72 void Stop(); |
|
73 |
|
74 private: |
|
75 |
|
76 CServerDiscoveryGuard( CImagePrintBody& aEngine ); |
|
77 void ConstructL(); |
|
78 void ProcessL(); |
|
79 |
|
80 private: // data |
|
81 |
|
82 CImagePrintBody& iEngine; |
|
83 TMessageWrp2* iMessage; |
|
84 RArray<TDiscoveryGuardData> iBuffer; |
|
85 TBool iRequestActive; |
|
86 }; |
|
87 |
|
88 |
|
89 #endif // CSERVERDISCOVERYGUARD_H |
|
90 |
|
91 // End of File |
|