24 // INCLUDES |
24 // INCLUDES |
25 |
25 |
26 |
26 |
27 #include <e32base.h> |
27 #include <e32base.h> |
28 #include <obexutilsmessagehandler.h> |
28 #include <obexutilsmessagehandler.h> |
29 #include <obexutilsuilayer.h> |
|
30 #include "obexutilspropertynotifier.h" |
29 #include "obexutilspropertynotifier.h" |
31 #include <SrcsInterface.h> |
30 #include <SrcsInterface.h> |
32 #include "btengdevman.h" |
31 #include "btengdevman.h" |
33 |
32 |
34 #include <obexutilspropertynotifier.h> |
33 #include <obexutilspropertynotifier.h> |
35 #include <obexutilsglobalprogressdialog.h> |
|
36 |
34 |
37 #include <AiwServiceHandler.h> // The AIW service handler |
35 #include <obexutilsdialog.h> |
|
36 #include <hbdevicedialogsymbian.h> |
|
37 #include <hbsymbianvariant.h> |
38 |
38 |
39 _LIT( KUniqueTransportName, "RFCOMM" ); |
39 |
40 const TInt KBtStartReserveChannel = 9; |
40 const TInt KBtStartReserveChannel = 9; |
41 const TInt KBtEndReserveChannel = 30; |
41 const TInt KBtEndReserveChannel = 30; |
42 |
42 |
|
43 // todo @ QT migration: take official definition from Messaging at app layer (btmsgtypeuid.h) |
|
44 const TUid KUidMsgTypeBt = {0x10009ED5}; |
|
45 /** |
|
46 * Backup status. |
|
47 * The value is controlled by FileManager |
|
48 */ |
|
49 enum TFileManagerBkupStatusType |
|
50 { |
|
51 EFileManagerBkupStatusUnset = 0x00000000, |
|
52 EFileManagerBkupStatusBackup = 0x00000001, |
|
53 EFileManagerBkupStatusRestore = 0x00000002 |
|
54 }; |
43 /** |
55 /** |
44 * CBtListenActive |
56 * CBtListenActive |
45 * Class to implement IrObex permanent listen |
57 * Class to implement IrObex permanent listen |
46 */ |
58 */ |
47 class COPPController : public CSrcsInterface, public MObexServerNotify, |
59 class COPPController : public CSrcsInterface, public MObexServerNotify, |
48 public MObexUtilsPropertyNotifyHandler, |
60 public MObexUtilsPropertyNotifyHandler, |
49 public MGlobalProgressCallback, public MGlobalNoteCallback, |
61 public MObexUtilsDialogObserver, |
50 public MBTEngDevManObserver |
62 public MBTEngDevManObserver, |
|
63 public MHbDeviceDialogObserver |
51 { |
64 { |
52 public: |
65 public: |
53 static COPPController* NewL(); |
66 static COPPController* NewL(); |
54 ~COPPController(); |
67 ~COPPController(); |
55 |
68 |
74 void AbortIndication(); |
87 void AbortIndication(); |
75 |
88 |
76 private: // from MObexUtilsPropertyNotifyHandler |
89 private: // from MObexUtilsPropertyNotifyHandler |
77 void HandleNotifyL(TMemoryPropertyCheckType aCheckType); |
90 void HandleNotifyL(TMemoryPropertyCheckType aCheckType); |
78 |
91 |
79 private: // from MGlobalProgressCallback |
|
80 void HandleGlobalProgressDialogL(TInt aSoftkey); |
|
81 |
|
82 private: // from MGlobalNoteCallback |
|
83 void HandleGlobalNoteDialogL(TInt aSoftkey); |
|
84 |
92 |
85 private: // from MBTEngDevManObserver |
93 private: // from MBTEngDevManObserver |
86 void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); |
94 void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); |
|
95 |
|
96 private: //from MObexUtilsDialogObserver |
|
97 void DialogDismissed(TInt aButtonId); |
87 |
98 |
88 private: |
99 private: |
89 COPPController(); |
100 COPPController(); |
90 void ConstructL(); |
101 void ConstructL(); |
91 |
102 |
94 TInt HandlePutCompleteIndication(); |
105 TInt HandlePutCompleteIndication(); |
95 void HandleError(TBool aAbort); |
106 void HandleError(TBool aAbort); |
96 |
107 |
97 TBool CheckCapacityL(); |
108 TBool CheckCapacityL(); |
98 void LaunchReceivingIndicatorL(); |
109 void LaunchReceivingIndicatorL(); |
99 inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); } |
110 inline TBool ReceivingIndicatorActive() const { return (iDialogActive); } |
100 void UpdateReceivingIndicator(); |
111 void UpdateReceivingIndicatorL(); |
101 void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); |
112 void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); |
102 TInt GetDriveWithMaximumFreeSpaceL(); |
113 TInt GetDriveWithMaximumFreeSpaceL(); |
|
114 TBool IsBackupRunning(); |
|
115 TBool ProcessExists( const TSecureId& aSecureId ); |
|
116 |
|
117 private: |
|
118 void DataReceived(CHbSymbianVariantMap& aData); |
|
119 void DeviceDialogClosed(TInt aCompletionCode); |
103 |
120 |
104 private: |
121 private: |
105 enum TObexTransferState |
122 enum TObexTransferState |
106 { |
123 { |
107 ETransferIdle, |
124 ETransferIdle, |
130 CBufFlat* iBuf; |
147 CBufFlat* iBuf; |
131 TBool iLengthHeaderReceived; |
148 TBool iLengthHeaderReceived; |
132 TSrcsMediaType iMediaType; |
149 TSrcsMediaType iMediaType; |
133 TInt iTotalSizeByte; |
150 TInt iTotalSizeByte; |
134 TFileName iReceivingFileName; |
151 TFileName iReceivingFileName; |
135 CGlobalProgressDialog* iProgressDialog; |
|
136 CGlobalDialog* iWaitDialog; |
|
137 TBool iNoteDisplayed; |
152 TBool iNoteDisplayed; |
138 CBTEngDevMan* iDevMan; |
153 CBTEngDevMan* iDevMan; |
139 CBTDeviceArray* iResultArray; |
154 CBTDeviceArray* iResultArray; |
140 TBTDeviceName iRemoteDeviceName; |
155 TBTDeviceName iRemoteDeviceName; |
|
156 CObexUtilsDialog* iDialog; |
|
157 CHbDeviceDialogSymbian* iProgressDialog; |
|
158 TBool iDialogActive; |
141 }; |
159 }; |
142 |
160 |
143 #endif // OPPCONTROLLER_H |
161 #endif // OPPCONTROLLER_H |
144 |
162 |
145 // End of File |
163 // End of File |