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: Image push controller |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef BT_BIP_CONTROLLER_H |
|
21 #define BT_BIP_CONTROLLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "BTServiceClient.h" |
|
25 #include "BTServiceStarter.h" |
|
26 #include "BTSController.h" |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Control class for the Image sending |
|
32 */ |
|
33 NONSHARABLE_CLASS (CBTSBIPController) : public CBTSController, |
|
34 public MBTServiceClientObserver |
|
35 |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CBTSBIPController* NewL( MBTServiceObserver* aObserver, |
|
43 const TUint aRemotePort, |
|
44 const TBTDevAddr& aRemoteDevice, |
|
45 CBTServiceParameterList* aList ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CBTSBIPController(); |
|
51 |
|
52 void SendUnSupportedFiles(); |
|
53 |
|
54 private: // Functions from base classes |
|
55 |
|
56 /** |
|
57 * From MBTServiceClientObserver A Connect operation has been completed. |
|
58 * @param aStatus The status of the operation. |
|
59 * @return None. |
|
60 */ |
|
61 void ConnectCompleted( TInt aStatus ); |
|
62 |
|
63 /** |
|
64 * From MBTServiceClientObserver The client connection has been closed. |
|
65 * @param None. |
|
66 * @return None. |
|
67 */ |
|
68 void ClientConnectionClosed(); |
|
69 |
|
70 /** |
|
71 * From MBTServiceClientObserver A Put operation has been completed. |
|
72 * @param aStatus The status of the operation. |
|
73 * @param aPutResponse Response packet from remote device. |
|
74 * @return None. |
|
75 */ |
|
76 void PutCompleted( TInt aStatus, const CObexHeaderSet* aPutResponse ); |
|
77 |
|
78 /** |
|
79 * From MBTServiceClientObserver A Get operation has been completed. |
|
80 * @param aStatus The status of the operation. |
|
81 * @param aGetResponse Response packet from remote device. |
|
82 * @return None. |
|
83 */ |
|
84 void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse ); |
|
85 |
|
86 /** |
|
87 * From MBTServiceClientObserver A Connect operation is timed out. |
|
88 * @return None. |
|
89 */ |
|
90 void ConnectTimedOut(); |
|
91 |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * C++ default constructor. |
|
97 */ |
|
98 CBTSBIPController( MBTServiceObserver* aObserver, |
|
99 CBTServiceParameterList* aList ); |
|
100 |
|
101 /** |
|
102 * By default Symbian 2nd phase constructor is private. |
|
103 */ |
|
104 void ConstructL( const TUint aRemotePort, |
|
105 const TBTDevAddr& aRemoteDeviceAddr ); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * Send image |
|
111 * @param None. |
|
112 * @return None. |
|
113 */ |
|
114 void SendL(); |
|
115 |
|
116 /** |
|
117 * Send thumbnail image |
|
118 * @param aPutResponse Response packet containing the image handle |
|
119 * @return None. |
|
120 */ |
|
121 void SendThumbnailL( const CObexHeaderSet* aPutResponse ); |
|
122 |
|
123 /** |
|
124 * Get capabilities object from remote device |
|
125 * @param None. |
|
126 * @return None. |
|
127 */ |
|
128 void GetL(); |
|
129 |
|
130 /** |
|
131 * Create temp file |
|
132 * @param aFileName Name of the file that was created |
|
133 * @return None. |
|
134 */ |
|
135 void CreateTempFileL( TFileName& aFileName ); |
|
136 |
|
137 /** |
|
138 * Generate a temp file name |
|
139 * @param aFileName File name that was created. |
|
140 * @return None. |
|
141 */ |
|
142 void GenerateTempFileNameL( TFileName& aFileName ); |
|
143 |
|
144 /** |
|
145 * Delete a temp file |
|
146 * @param aFileName Name of the file. |
|
147 * @return None. |
|
148 */ |
|
149 void DeleteTempFile( TFileName& aFileName ); |
|
150 |
|
151 /** |
|
152 * Create image descriptor |
|
153 * @param None. |
|
154 * @return HBufC8*. |
|
155 */ |
|
156 HBufC8* CreateImageDescriptorL(); |
|
157 |
|
158 /** |
|
159 * Handle GetCompleteIndication |
|
160 * @param aGetResponse Get response packet from remote device |
|
161 * @return None. |
|
162 */ |
|
163 void HandleGetCompleteIndicationL( CObexBufObject* aGetResponse ); |
|
164 |
|
165 private: // Data |
|
166 |
|
167 TInt iFileIndex; |
|
168 TFileName iThumbnailFileName; |
|
169 TFileName iTempFileName; |
|
170 |
|
171 |
|
172 // Not owned |
|
173 // |
|
174 CBTServiceParameterList* iListPtr; |
|
175 MBTServiceObserver* iObserverPtr; |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // BT_BIP_CONTROLLER_H |
|
180 |
|
181 // End of File |
|