|
1 /* |
|
2 * Copyright (c) 2004 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: Bip controller class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _BIPCONTROLLER_H |
|
20 #define _BIPCONTROLLER_H |
|
21 |
|
22 //INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <obex.h> |
|
26 #include <obexutilsmessagehandler.h> |
|
27 #include <obexutilsuilayer.h> |
|
28 #include <obexutilsdialog.h> |
|
29 #include "obexutilspropertynotifier.h" |
|
30 #include "debug.h" |
|
31 #include <SrcsInterface.h> |
|
32 #include <obexutilspropertynotifier.h> |
|
33 #include <obexutilsglobalprogressdialog.h> |
|
34 #include <btengsettings.h> |
|
35 #include "btengdevman.h" |
|
36 #include <obexutilsdialog.h> |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 |
|
40 class CBIPCapabilityHandler; |
|
41 class CBIPImageHandler; |
|
42 |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * The main controller for Basic Imaging Profile. |
|
48 */ |
|
49 NONSHARABLE_CLASS (CBIPController): public CSrcsInterface, public MObexServerNotify, |
|
50 public MObexUtilsPropertyNotifyHandler, |
|
51 public MGlobalProgressCallback, public MGlobalNoteCallback, |
|
52 public MBTEngDevManObserver |
|
53 { |
|
54 public: |
|
55 static CBIPController* NewL(); |
|
56 ~CBIPController(); |
|
57 |
|
58 private: // from CSrcsInterface |
|
59 TBool IsOBEXActive(); |
|
60 void SetMediaType(TSrcsMediaType aMediaType); |
|
61 TInt SetObexServer(CObexServer* aServer); |
|
62 |
|
63 private: // from MObexServerNotify |
|
64 void ErrorIndication(TInt aError); |
|
65 void TransportUpIndication(); |
|
66 void TransportDownIndication(); |
|
67 TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo); |
|
68 void ObexDisconnectIndication(const TDesC8& aInfo); |
|
69 CObexBufObject* PutRequestIndication(); |
|
70 TInt PutPacketIndication(); |
|
71 TInt PutCompleteIndication(); |
|
72 CObexBufObject* GetRequestIndication(CObexBaseObject* aRequiredObject); |
|
73 TInt GetPacketIndication(); |
|
74 TInt GetCompleteIndication(); |
|
75 TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo); |
|
76 void AbortIndication(); |
|
77 |
|
78 private: // from MObexUtilsPropertyNotifyHandler |
|
79 void HandleNotifyL(TMemoryPropertyCheckType aCheckType); |
|
80 |
|
81 private: // from MGlobalProgressCallback |
|
82 void HandleGlobalProgressDialogL(TInt aSoftkey); |
|
83 |
|
84 private: // from MGlobalNoteCallback |
|
85 void HandleGlobalNoteDialogL(TInt aSoftkey); |
|
86 |
|
87 private: // from MBTEngDevManObserver |
|
88 void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); |
|
89 |
|
90 private: |
|
91 CBIPController(); |
|
92 void ConstructL(); |
|
93 |
|
94 void CancelTransfer(); |
|
95 |
|
96 void HandleError(TBool aAbort); |
|
97 void HandleGetCapabilityRequestL(); |
|
98 void HandlePutImageRequestL(); |
|
99 TInt HandlePutCompleteIndication(); |
|
100 TInt RemoveCapabilityObject(); |
|
101 |
|
102 TBool CheckCapacityL(); |
|
103 void LaunchReceivingIndicatorL(); |
|
104 inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); } |
|
105 void UpdateReceivingIndicator(); |
|
106 void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); |
|
107 void ShowFileReceivedQueryL(); |
|
108 TInt GetDriveWithMaximumFreeSpaceL(); |
|
109 |
|
110 private: |
|
111 enum TBipTransferState |
|
112 { |
|
113 ETransferIdle, |
|
114 ETransferPut, |
|
115 ETransferGet, |
|
116 ETransferPutDiskError, |
|
117 ETransferPutInitError, |
|
118 ETransferPutCancel, |
|
119 }; |
|
120 |
|
121 private: // Data |
|
122 CBIPCapabilityHandler* iBIPCapabilityHandler; |
|
123 CObexBufObject* iBTObject; |
|
124 CObexServer* iBTObexServer; |
|
125 TBipTransferState iBTTransferState; |
|
126 TInt iDrive; |
|
127 CBIPImageHandler* iBIPImageHandler; |
|
128 CObexBufObject* iGetObject; |
|
129 CObexUtilsPropertyNotifier* iLowMemoryActiveCDrive; |
|
130 CObexUtilsPropertyNotifier* iLowMemoryActiveMMC; |
|
131 TMsvId iMsvIdParent; |
|
132 TMsvId iMsvIdAttach; |
|
133 RFile iFile; |
|
134 RFs iFs; |
|
135 TFileName iFullPathFilename; |
|
136 TFileName iCapabilityFileName; |
|
137 TFileName iDefaultFolder; |
|
138 TFileName iPreviousDefaultFolder; |
|
139 CBufFlat *iBuf; |
|
140 TBool iLengthHeaderReceived; |
|
141 TInt iTotalSizeByte; |
|
142 CGlobalProgressDialog* iProgressDialog; |
|
143 CGlobalDialog* iWaitDialog; |
|
144 TBool iNoteDisplayed; |
|
145 CBTEngDevMan* iDevMan; |
|
146 CBTDeviceArray* iResultArray; |
|
147 TBTDeviceName iRemoteDeviceName; |
|
148 TFileName iReceivingFileName; |
|
149 RArray<TMsvId> iMsvIdArray; |
|
150 TFileName iCenRepFolder; |
|
151 }; |
|
152 |
|
153 _LIT(KBipPanicCategory, "BIP"); |
|
154 enum TBipPanicCode |
|
155 { |
|
156 EBipPanicNotBluetoothMediaType = 0, |
|
157 }; |
|
158 |
|
159 #endif //_BIPCONTROLLER_H |
|
160 |
|
161 // End of File |