|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef _SERVERPACKETACCESSUI_H |
|
17 #define _SERVERPACKETACCESSUI_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <obex/extensionapis/mobexserverrequestpacketnotify.h> |
|
21 |
|
22 |
|
23 class CObexServerHandlerBase; |
|
24 class CConsoleBase; |
|
25 class CObexServerPacketAccessExtension; |
|
26 class CObexServer; |
|
27 |
|
28 |
|
29 NONSHARABLE_CLASS(CObexServerPacketAccessUi) : public CActive, MObexServerRequestPacketNotify |
|
30 { |
|
31 |
|
32 public: |
|
33 static CObexServerPacketAccessUi* NewL(CObexServerHandlerBase& aHandler, CObexServer& aServer); |
|
34 ~CObexServerPacketAccessUi(); |
|
35 |
|
36 void SetKeypressActive(); |
|
37 CConsoleBase& Console() const; |
|
38 |
|
39 private: |
|
40 // MObexServerRequestPacketNotify |
|
41 virtual TBool RequestPacket(TObexRequestCode aRequest, TObexResponse& aResponse); |
|
42 virtual TBool RequestPacket(TObexRequestCode aRequest, TObexConnectInfo& aConnectInfo, TObexResponse& aResponse); |
|
43 virtual TBool RequestPacket(TObexRequestCode aRequest, CObex::TSetPathInfo& aSetPathInfo, TObexResponse& aResponse); |
|
44 |
|
45 private: |
|
46 CObexServerPacketAccessUi(CObexServerHandlerBase& aHandler, CObexServer& aServer); |
|
47 void ConstructL(); |
|
48 |
|
49 void RunL(); |
|
50 void DoCancel(); |
|
51 |
|
52 void ProcessKeyPressL(TChar aChar); |
|
53 |
|
54 void PrintHeadersL(CObexHeaderSet& aHeaderSet) const; |
|
55 void PrintHeader(CObexHeader& aHeader) const; |
|
56 void PrintHex(const TUint8* aPtr, TInt aLength) const; |
|
57 |
|
58 TBool RequestPacketReturn(TObexResponse& aResponse); |
|
59 |
|
60 private: |
|
61 CObexServerHandlerBase& iHandler; |
|
62 CObexServer& iServer; |
|
63 |
|
64 CConsoleBase* iConsole; |
|
65 CObexServerPacketAccessExtension* iPacketAccess; |
|
66 |
|
67 TBool iInteractive; |
|
68 |
|
69 }; |
|
70 |
|
71 |
|
72 #endif // _SERVERPACKETACCESSUI_H |