22 //INCLUDES |
22 //INCLUDES |
23 |
23 |
24 #include <e32base.h> |
24 #include <e32base.h> |
25 #include <obex.h> |
25 #include <obex.h> |
26 #include <obexutilsmessagehandler.h> |
26 #include <obexutilsmessagehandler.h> |
27 #include <obexutilsuilayer.h> |
|
28 #include <obexutilsdialog.h> |
|
29 #include "obexutilspropertynotifier.h" |
27 #include "obexutilspropertynotifier.h" |
30 #include "debug.h" |
28 #include "debug.h" |
31 #include <SrcsInterface.h> |
29 #include <SrcsInterface.h> |
32 #include <obexutilspropertynotifier.h> |
30 #include <obexutilspropertynotifier.h> |
33 #include <obexutilsglobalprogressdialog.h> |
|
34 #include <btengsettings.h> |
31 #include <btengsettings.h> |
35 #include "btengdevman.h" |
32 #include "btengdevman.h" |
36 #include <obexutilsdialog.h> |
33 #include <obexutilsdialog.h> |
|
34 #include <hbdevicedialogsymbian.h> |
|
35 #include <hbsymbianvariant.h> |
37 |
36 |
38 // FORWARD DECLARATIONS |
37 // FORWARD DECLARATIONS |
39 |
38 |
40 class CBIPCapabilityHandler; |
39 class CBIPCapabilityHandler; |
41 class CBIPImageHandler; |
40 class CBIPImageHandler; |
42 |
41 |
|
42 /** |
|
43 * Backup status. |
|
44 * The value is controlled by FileManager |
|
45 */ |
|
46 enum TFileManagerBkupStatusType |
|
47 { |
|
48 EFileManagerBkupStatusUnset = 0x00000000, |
|
49 EFileManagerBkupStatusBackup = 0x00000001, |
|
50 EFileManagerBkupStatusRestore = 0x00000002 |
|
51 }; |
|
52 |
|
53 const TUid KUidMsgTypeBt = {0x10009ED5}; |
43 |
54 |
44 // CLASS DECLARATION |
55 // CLASS DECLARATION |
45 |
56 |
46 /** |
57 /** |
47 * The main controller for Basic Imaging Profile. |
58 * The main controller for Basic Imaging Profile. |
48 */ |
59 */ |
49 NONSHARABLE_CLASS (CBIPController): public CSrcsInterface, public MObexServerNotify, |
60 NONSHARABLE_CLASS (CBIPController): public CSrcsInterface, public MObexServerNotify, |
50 public MObexUtilsPropertyNotifyHandler, |
61 public MObexUtilsPropertyNotifyHandler, |
51 public MGlobalProgressCallback, public MGlobalNoteCallback, |
62 public MObexUtilsDialogObserver, |
52 public MBTEngDevManObserver |
63 public MBTEngDevManObserver, |
|
64 public MHbDeviceDialogObserver |
53 { |
65 { |
54 public: |
66 public: |
55 static CBIPController* NewL(); |
67 static CBIPController* NewL(); |
56 ~CBIPController(); |
68 ~CBIPController(); |
57 |
69 |
76 void AbortIndication(); |
88 void AbortIndication(); |
77 |
89 |
78 private: // from MObexUtilsPropertyNotifyHandler |
90 private: // from MObexUtilsPropertyNotifyHandler |
79 void HandleNotifyL(TMemoryPropertyCheckType aCheckType); |
91 void HandleNotifyL(TMemoryPropertyCheckType aCheckType); |
80 |
92 |
81 private: // from MGlobalProgressCallback |
|
82 void HandleGlobalProgressDialogL(TInt aSoftkey); |
|
83 |
|
84 private: // from MGlobalNoteCallback |
|
85 void HandleGlobalNoteDialogL(TInt aSoftkey); |
|
86 |
93 |
87 private: // from MBTEngDevManObserver |
94 private: // from MBTEngDevManObserver |
88 void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); |
95 void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); |
|
96 |
|
97 private: //from MObexUtilsDialogObserver |
|
98 void DialogDismissed(TInt aButtonId); |
89 |
99 |
90 private: |
100 private: |
91 CBIPController(); |
101 CBIPController(); |
92 void ConstructL(); |
102 void ConstructL(); |
93 |
103 |
99 TInt HandlePutCompleteIndication(); |
109 TInt HandlePutCompleteIndication(); |
100 TInt RemoveCapabilityObject(); |
110 TInt RemoveCapabilityObject(); |
101 |
111 |
102 TBool CheckCapacityL(); |
112 TBool CheckCapacityL(); |
103 void LaunchReceivingIndicatorL(); |
113 void LaunchReceivingIndicatorL(); |
104 inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); } |
114 inline TBool ReceivingIndicatorActive() const { return (iDialogActive); } |
105 void UpdateReceivingIndicator(); |
115 void UpdateReceivingIndicatorL(); |
106 void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); |
116 void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); |
107 TInt GetDriveWithMaximumFreeSpaceL(); |
117 TInt GetDriveWithMaximumFreeSpaceL(); |
|
118 TBool IsBackupRunning(); |
|
119 TBool ProcessExists( const TSecureId& aSecureId ); |
|
120 |
|
121 private: |
|
122 void DataReceived(CHbSymbianVariantMap& aData); |
|
123 void DeviceDialogClosed(TInt aCompletionCode); |
108 |
124 |
109 private: |
125 private: |
110 enum TBipTransferState |
126 enum TBipTransferState |
111 { |
127 { |
112 ETransferIdle, |
128 ETransferIdle, |
114 ETransferGet, |
130 ETransferGet, |
115 ETransferPutDiskError, |
131 ETransferPutDiskError, |
116 ETransferPutInitError, |
132 ETransferPutInitError, |
117 ETransferPutCancel, |
133 ETransferPutCancel, |
118 }; |
134 }; |
|
135 |
119 |
136 |
120 private: // Data |
137 private: // Data |
121 CBIPCapabilityHandler* iBIPCapabilityHandler; |
138 CBIPCapabilityHandler* iBIPCapabilityHandler; |
122 CObexBufObject* iBTObject; |
139 CObexBufObject* iBTObject; |
123 CObexServer* iBTObexServer; |
140 CObexServer* iBTObexServer; |
136 TFileName iDefaultFolder; |
153 TFileName iDefaultFolder; |
137 TFileName iPreviousDefaultFolder; |
154 TFileName iPreviousDefaultFolder; |
138 CBufFlat *iBuf; |
155 CBufFlat *iBuf; |
139 TBool iLengthHeaderReceived; |
156 TBool iLengthHeaderReceived; |
140 TInt iTotalSizeByte; |
157 TInt iTotalSizeByte; |
141 CGlobalProgressDialog* iProgressDialog; |
|
142 CGlobalDialog* iWaitDialog; |
|
143 TBool iNoteDisplayed; |
158 TBool iNoteDisplayed; |
144 CBTEngDevMan* iDevMan; |
159 CBTEngDevMan* iDevMan; |
145 CBTDeviceArray* iResultArray; |
160 CBTDeviceArray* iResultArray; |
146 TBTDeviceName iRemoteDeviceName; |
161 TBTDeviceName iRemoteDeviceName; |
147 TFileName iReceivingFileName; |
162 TFileName iReceivingFileName; |
148 TFileName iCenRepFolder; |
163 TFileName iCenRepFolder; |
|
164 CObexUtilsDialog* iDialog; |
|
165 CHbDeviceDialogSymbian* iProgressDialog; |
|
166 TBool iDialogActive; |
|
167 TInt iFileCount; |
149 }; |
168 }; |
150 |
169 |
151 _LIT(KBipPanicCategory, "BIP"); |
170 _LIT(KBipPanicCategory, "BIP"); |
152 enum TBipPanicCode |
171 enum TBipPanicCode |
153 { |
172 { |