40
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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: Basic printing controller
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef BT_SERVICE_BPP_CONTROLLER_H
|
|
21 |
#define BT_SERVICE_BPP_CONTROLLER_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <obexutilsdialog.h>
|
|
25 |
#include "BTServiceStarter.h"
|
|
26 |
#include "BTServiceParameterList.h"
|
|
27 |
#include "BTServiceClient.h"
|
|
28 |
#include "BTSBPPObjectServer.h"
|
|
29 |
#include "BTSBPPServerWait.h"
|
|
30 |
#include "BTSController.h"
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
// CLASS DECLARATION
|
|
36 |
|
|
37 |
/**
|
|
38 |
* A class controlling printing service using Basic Printing Profile.
|
|
39 |
*/
|
|
40 |
NONSHARABLE_CLASS (CBTSBPPController) : public CBTSController,
|
|
41 |
public MBTServiceClientObserver,
|
|
42 |
public MBTSBPPObjectServerObserver,
|
|
43 |
public MBTSBPPServerWaitObserver
|
|
44 |
{
|
|
45 |
public: // Constructors and destructor
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Two-phased constructor.
|
|
49 |
*/
|
|
50 |
static CBTSBPPController* NewL( MBTServiceObserver* aObserver,
|
|
51 |
const TUint aRemotePort,
|
|
52 |
const TBTDevAddr& aRemoteDevice,
|
|
53 |
const CBTServiceParameterList* aList,
|
|
54 |
CBTEngDiscovery* aBTEngDiscoveryPtr );
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Destructor.
|
|
58 |
*/
|
|
59 |
virtual ~CBTSBPPController();
|
|
60 |
|
|
61 |
|
|
62 |
private: // Functions from base classes
|
|
63 |
|
|
64 |
/**
|
|
65 |
* From MBTServiceClientObserver A Connect operation has been completed.
|
|
66 |
* @param aStatus The status of the operation.
|
|
67 |
* @return None.
|
|
68 |
*/
|
|
69 |
void ConnectCompleted( TInt aStatus );
|
|
70 |
|
|
71 |
/**
|
|
72 |
* From MBTServiceClientObserver A Put operation has been completed.
|
|
73 |
* @param aStatus The status of the operation.
|
|
74 |
* @param aPutResponse The response object.
|
|
75 |
* @return None.
|
|
76 |
*/
|
|
77 |
void PutCompleted( TInt aStatus,const CObexHeaderSet* aPutResponse );
|
|
78 |
|
|
79 |
/**
|
|
80 |
* From MBTServiceClientObserver A Get operation has been completed.
|
|
81 |
* @param aStatus The status of the operation.
|
|
82 |
* @param aGetResponse The response object.
|
|
83 |
* @return None.
|
|
84 |
*/
|
|
85 |
void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* From MBTServiceClientObserver The client connection has been closed.
|
|
89 |
* @return None.
|
|
90 |
*/
|
|
91 |
void ClientConnectionClosed();
|
|
92 |
|
|
93 |
/**
|
|
94 |
* From MBTServiceClientObserver A filehandle can be reseted.
|
|
95 |
* @return None.
|
|
96 |
*/
|
|
97 |
void ResetFileHandleL();
|
|
98 |
/**
|
|
99 |
* From MBTPSServerObserver An error in server has occurred.
|
|
100 |
* @param aError The error.
|
|
101 |
* @return None.
|
|
102 |
*/
|
|
103 |
void ServerError( TInt aError );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* From MBTPSServerObserver The server connection has been established.
|
|
107 |
* @param None.
|
|
108 |
* @return None.
|
|
109 |
*/
|
|
110 |
void ServerConnectionEstablished();
|
|
111 |
|
|
112 |
/**
|
|
113 |
* From MBTPSServerObserver The server connection has been closed.
|
|
114 |
* @param None.
|
|
115 |
* @return None.
|
|
116 |
*/
|
|
117 |
void ServerConnectionClosed();
|
|
118 |
|
|
119 |
/**
|
|
120 |
* From MBTPSServerWaitObserver The server wait has completed.
|
|
121 |
* @param None.
|
|
122 |
* @return None.
|
|
123 |
*/
|
|
124 |
void WaitComplete();
|
|
125 |
|
|
126 |
/**
|
|
127 |
* From MBTServiceClientObserver A Connect operation is timed out.
|
|
128 |
* @return None.
|
|
129 |
*/
|
|
130 |
void ConnectTimedOut();
|
|
131 |
|
|
132 |
private:
|
|
133 |
|
|
134 |
/**
|
|
135 |
* C++ default constructor.
|
|
136 |
*/
|
|
137 |
CBTSBPPController( MBTServiceObserver* aObserver,
|
|
138 |
const CBTServiceParameterList* aList );
|
|
139 |
|
|
140 |
/**
|
|
141 |
* By default Symbian 2nd phase constructor is private.
|
|
142 |
*/
|
|
143 |
void ConstructL( const TBTDevAddr& aRemoteDevice,
|
|
144 |
const TUint aRemotePort,
|
|
145 |
CBTEngDiscovery* aBTEngDiscoveryPtr );
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Selects the next document to send and issues a send request
|
|
149 |
* to Obex client.
|
|
150 |
* @return None.
|
|
151 |
*/
|
|
152 |
void SelectAndSendL();
|
|
153 |
|
|
154 |
private: // Data definitions
|
|
155 |
|
|
156 |
enum TBTSBPPObjectServerState
|
|
157 |
{
|
|
158 |
EBTSBPPSrvIdle,
|
|
159 |
EBTSBPPSrvServing,
|
|
160 |
EBTSBPPSrvDone
|
|
161 |
};
|
|
162 |
|
|
163 |
private: // Data
|
|
164 |
|
|
165 |
// Owned
|
|
166 |
//
|
|
167 |
CBTSBPPObjectServer* iServer;
|
|
168 |
CBTSBPPServerWait* iServerWait;
|
|
169 |
|
|
170 |
TInt iSendIndex;
|
|
171 |
TUint iClientChannel;
|
|
172 |
TBTSBPPObjectServerState iServerState;
|
|
173 |
TBool iClientDone;
|
|
174 |
|
|
175 |
// Not owned
|
|
176 |
//
|
|
177 |
MBTServiceObserver* iObserverPtr;
|
|
178 |
const CBTServiceParameterList* iListPtr;
|
|
179 |
|
|
180 |
};
|
|
181 |
|
|
182 |
#endif // BT_SERVICE_BPP_CONTROLLER_H
|
|
183 |
|
|
184 |
// End of File
|