|
1 // Copyright (c) 1997-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 _TRANPPROT_H |
|
17 #define _TRANPPROT_H |
|
18 |
|
19 class BFTP; |
|
20 |
|
21 NONSHARABLE_CLASS(CTranpProtocol) : public CBase |
|
22 { |
|
23 public: |
|
24 CTranpProtocol(MTranpNotification& aNotifier); |
|
25 ~CTranpProtocol(); |
|
26 |
|
27 // Constructs a TranP Session |
|
28 static CTranpProtocol* NewL(MTranpNotification& aNotifier); |
|
29 void ConstructL(const MTranpNotification& aNotifier); |
|
30 |
|
31 // Methods for establishing a connection |
|
32 void Connect(); |
|
33 void Disconnect(); |
|
34 void Abort(); |
|
35 |
|
36 // Query capabilities of peer |
|
37 void Query(CTranpSession::TTranP aWhat); |
|
38 |
|
39 // Receive picture from peer |
|
40 void Get(TTranpPicture& aPicture); |
|
41 |
|
42 // Send picture to peer |
|
43 void Put(const TTranpPicture& aPicture); |
|
44 |
|
45 // Change configuration parameters |
|
46 void Config(const TTranpConfig& aConfig); |
|
47 TTranpConfig Config(const TTranpConfig& aConfig) const; |
|
48 |
|
49 public: |
|
50 // Sets ownership of allocated memory to TTranpPicture object passed in Get() method |
|
51 void SetHeapData(HBufC8* aHeapData) {iTranpPicture->iHeapData=aHeapData;} |
|
52 // Removes allocated memory from the TTranpPicture object passed in Get() method |
|
53 void DeleteHeapData() {if((iTranpPicture->iHeapData)!=NULL) |
|
54 { |
|
55 delete iTranpPicture->iHeapData; |
|
56 iTranpPicture->iHeapData=NULL; |
|
57 } |
|
58 } |
|
59 |
|
60 void SetPicture(TDesC8& aPicture, TDesC8& aFilename, TDesC8& aUPFPicture, TDesC8& aLongFilename); |
|
61 |
|
62 private: |
|
63 BFTP* iBFTP; |
|
64 TTranpPicture* iTranpPicture; |
|
65 MTranpNotification& iNotifier; |
|
66 }; |
|
67 |
|
68 #endif //_TRANPPROT_H |