85 #include <cntservicescontact.h> |
85 #include <cntservicescontact.h> |
86 #include <qnetworkconfigmanager.h> |
86 #include <qnetworkconfigmanager.h> |
87 #include <qnetworkconfiguration.h> |
87 #include <qnetworkconfiguration.h> |
88 #include <hbinputsettingproxy.h> |
88 #include <hbinputsettingproxy.h> |
89 #include <hbicon.h> |
89 #include <hbicon.h> |
|
90 #include <XQAiwRequest.h> |
|
91 #include <xqappmgr.h> |
|
92 #include <xqaiwdecl.h> |
90 #endif |
93 #endif |
91 |
94 |
92 #include <org_eclipse_swt_internal_qt_OS.h> |
95 #include <org_eclipse_swt_internal_qt_OS.h> |
93 #include "eventcallback.h" |
96 #include "eventcallback.h" |
94 #include "slotcallback.h" |
97 #include "slotcallback.h" |
3090 } |
3094 } |
3091 SWT_CATCH |
3095 SWT_CATCH |
3092 } |
3096 } |
3093 |
3097 |
3094 JNIEXPORT void JNICALL OS_NATIVE( QLabel_1setPixmap) |
3098 JNIEXPORT void JNICALL OS_NATIVE( QLabel_1setPixmap) |
3095 (JNIEnv* aJniEnv , jclass, jint aHandle, jint aImageHandle) |
3099 (JNIEnv* aJniEnv , jclass, jint aHandle, jint aPixmapHandle) |
|
3100 { |
|
3101 SWT_TRY |
|
3102 { |
|
3103 SWT_LOG_JNI_CALL(); |
|
3104 SWT_LOG_DATA_2("handle=%x pixmapHandle=%x", aHandle, aPixmapHandle ); |
|
3105 HANDLE_TO_POINTER( QLabel*, label, aHandle ); |
|
3106 if(aPixmapHandle == 0 ) |
|
3107 { |
|
3108 label->setPixmap(QPixmap()); |
|
3109 } |
|
3110 else |
|
3111 { |
|
3112 QPixmap* image = static_cast< QPixmap* >( reinterpret_cast< QPaintDevice* >( aPixmapHandle ) ); |
|
3113 label->setPixmap( *image ); |
|
3114 } |
|
3115 } |
|
3116 SWT_CATCH |
|
3117 } |
|
3118 |
|
3119 JNIEXPORT void JNICALL OS_NATIVE( QLabel_1swt_1setPixmap ) |
|
3120 ( JNIEnv* aJniEnv, jclass, jint aHandle, jint aImageHandle) |
3096 { |
3121 { |
3097 SWT_TRY |
3122 SWT_TRY |
3098 { |
3123 { |
3099 SWT_LOG_JNI_CALL(); |
3124 SWT_LOG_JNI_CALL(); |
3100 SWT_LOG_DATA_2("handle=%x imageHandle=%x", aHandle, aImageHandle ); |
3125 SWT_LOG_DATA_2("handle=%x imageHandle=%x", aHandle, aImageHandle ); |
4616 } |
4627 } |
4617 SWT_CATCH |
4628 SWT_CATCH |
4618 } |
4629 } |
4619 |
4630 |
4620 JNIEXPORT void JNICALL OS_NATIVE( QPalette_1swt_1setBrush ) |
4631 JNIEXPORT void JNICALL OS_NATIVE( QPalette_1swt_1setBrush ) |
4621 (JNIEnv* aJniEnv , jclass, jint aHandle, jint aRole, jint aPixmap) |
4632 (JNIEnv* aJniEnv , jclass, jint aHandle, jint aRole, jint aCgImage) |
4622 { |
4633 { |
4623 SWT_TRY |
4634 SWT_TRY |
4624 { |
4635 { |
4625 SWT_LOG_JNI_CALL(); |
4636 SWT_LOG_JNI_CALL(); |
4626 SWT_LOG_DATA_3( "handle=%x role=%x pixmap=%x", aHandle, aRole, aPixmap ); |
4637 SWT_LOG_DATA_3( "handle=%x role=%x cgImage=%x", aHandle, aRole, aCgImage ); |
4627 QPixmap* pixmap = reinterpret_cast<QPixmap*>(aPixmap); |
4638 Java::GFX::Image* image = reinterpret_cast<Java::GFX::Image*>(aCgImage); |
4628 QPalette* palette = reinterpret_cast< QPalette* > ( aHandle ); |
4639 QPalette* palette = reinterpret_cast< QPalette* > ( aHandle ); |
4629 if(pixmap) |
4640 if(aCgImage) |
4630 { |
4641 { |
4631 palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush( *pixmap ) ); |
4642 palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush( image->toPixmap() ) ); |
4632 } |
4643 } |
4633 else |
4644 else |
4634 { |
4645 { |
4635 palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush() ); |
4646 palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush() ); |
4636 } |
4647 } |
5346 delete [] detailImages; |
5357 delete [] detailImages; |
5347 throw std::bad_alloc(); |
5358 throw std::bad_alloc(); |
5348 } |
5359 } |
5349 for(int i = 0; i < aDetailImageCount; i++) |
5360 for(int i = 0; i < aDetailImageCount; i++) |
5350 { |
5361 { |
5351 detailImages[i] = reinterpret_cast< QPixmap* >( imagesHandles[i] ); |
5362 detailImages[i] = (reinterpret_cast< Java::GFX::Image* >( imagesHandles[i] ))->toPixmap(); |
5352 } |
5363 } |
5353 aJniEnv->ReleaseIntArrayElements(aDetailImageHandles, imagesHandles, JNI_ABORT); |
5364 aJniEnv->ReleaseIntArrayElements(aDetailImageHandles, imagesHandles, JNI_ABORT); |
5354 } |
5365 } |
5355 |
5366 |
5356 QPixmap** headingImages = new QPixmap*[aHeadingImageCount]; |
5367 QPixmap* headingImages = new QPixmap[aHeadingImageCount]; |
5357 if( !headingImages ) |
5368 if( !headingImages ) |
5358 { |
5369 { |
5359 delete [] detailImages; // allocated earlier |
5370 delete [] detailImages; // allocated earlier |
5360 throw std::bad_alloc(); |
5371 throw std::bad_alloc(); |
5361 } |
5372 } |
5368 delete [] headingImages; |
5379 delete [] headingImages; |
5369 throw std::bad_alloc(); |
5380 throw std::bad_alloc(); |
5370 } |
5381 } |
5371 for(int i = 0; i < aHeadingImageCount; i++) |
5382 for(int i = 0; i < aHeadingImageCount; i++) |
5372 { |
5383 { |
5373 headingImages[i] = reinterpret_cast< QPixmap* >( imagesHandles[i] ); |
5384 headingImages[i] = (reinterpret_cast< Java::GFX::Image* >( imagesHandles[i] ))->toPixmap(); |
5374 } |
5385 } |
5375 aJniEnv->ReleaseIntArrayElements(aHeadingImageHandles, imagesHandles, JNI_ABORT); |
5386 aJniEnv->ReleaseIntArrayElements(aHeadingImageHandles, imagesHandles, JNI_ABORT); |
5376 } |
5387 } |
5377 |
5388 |
5378 ListModel* listDataModel = reinterpret_cast< ListModel* > ( aHandle ); |
5389 ListModel* listDataModel = reinterpret_cast< ListModel* > ( aHandle ); |
5379 listDataModel->appendItem( swtApp->jniUtils().JavaStringToQString( aJniEnv, aDetailText ), |
5390 listDataModel->appendItem( swtApp->jniUtils().JavaStringToQString( aJniEnv, aDetailText ), |
5380 const_cast<const QPixmap**>(detailImages), aDetailImageCount, |
5391 const_cast<const QPixmap*>(detailImages), aDetailImageCount, |
5381 swtApp->jniUtils().JavaStringToQString( aJniEnv, aHeadingText ), |
5392 swtApp->jniUtils().JavaStringToQString( aJniEnv, aHeadingText ), |
5382 const_cast<const QPixmap**>(headingImages), aHeadingImageCount ); |
5393 const_cast<const QPixmap*>(headingImages), aHeadingImageCount ); |
5383 } |
5394 } |
5384 SWT_CATCH |
5395 SWT_CATCH |
5385 } |
5396 } |
5386 |
5397 |
5387 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1insert__ILjava_lang_String_2I ) |
5398 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1insert__ILjava_lang_String_2I ) |
6284 SWT_CATCH |
6295 SWT_CATCH |
6285 } |
6296 } |
6286 // |
6297 // |
6287 //QIcon |
6298 //QIcon |
6288 // |
6299 // |
6289 JNIEXPORT jint JNICALL OS_NATIVE( QIcon_1new__I ) |
6300 JNIEXPORT jint JNICALL OS_NATIVE( QIcon_1swt_1new ) |
6290 ( JNIEnv* aJniEnv , jclass, jint aPixmap ) |
6301 ( JNIEnv* aJniEnv , jclass, jint aImageHandle ) |
6291 { |
6302 { |
6292 QIcon* icon = NULL; |
6303 QIcon* icon = NULL; |
6293 SWT_TRY |
6304 SWT_TRY |
6294 { |
6305 { |
6295 SWT_LOG_JNI_CALL(); |
6306 SWT_LOG_JNI_CALL(); |
6296 SWT_LOG_DATA_1("aPixmap=%x", aPixmap); |
6307 SWT_LOG_DATA_1("image=%x", aImageHandle); |
6297 QPixmap* pixmap = reinterpret_cast< QPixmap* >( aPixmap ); |
6308 Java::GFX::Image* image = reinterpret_cast< Java::GFX::Image* >( aImageHandle ); |
6298 icon = new QIcon( *pixmap ); |
6309 icon = new QIcon(image->toPixmap()); |
6299 } |
6310 } |
6300 SWT_CATCH |
6311 SWT_CATCH |
6301 return reinterpret_cast< jint >( static_cast< QIcon* >( icon ) ); |
6312 return reinterpret_cast< jint >( static_cast< QIcon* >( icon ) ); |
6302 } |
6313 } |
6303 |
6314 |
6304 JNIEXPORT jint JNICALL OS_NATIVE ( QIcon_1new__ ) |
6315 JNIEXPORT jint JNICALL OS_NATIVE ( QIcon_1new ) |
6305 (JNIEnv* aJniEnv , jclass) |
6316 (JNIEnv* aJniEnv , jclass) |
6306 { |
6317 { |
6307 QIcon* icon = NULL; |
6318 QIcon* icon = NULL; |
6308 SWT_TRY |
6319 SWT_TRY |
6309 { |
6320 { |
6738 } |
6749 } |
6739 // |
6750 // |
6740 //QColorDialog |
6751 //QColorDialog |
6741 // |
6752 // |
6742 JNIEXPORT jint JNICALL OS_NATIVE( QColorDialog_1getColor ) |
6753 JNIEXPORT jint JNICALL OS_NATIVE( QColorDialog_1getColor ) |
6743 (JNIEnv* aJniEnv , jclass, jint aColorHandle, jint aParentHandle, jstring aDialogID, jint aLayoutDirection ) |
6754 (JNIEnv* aJniEnv , jclass, jint aRed, jint aGreen, jint aBlue, jint aParentHandle, jstring aDialogID, jint aLayoutDirection) |
6744 { |
6755 { |
6745 QColor* color = NULL; |
6756 QColor* color = NULL; |
6746 SWT_TRY |
6757 SWT_TRY |
6747 { |
6758 { |
6748 SWT_LOG_JNI_CALL(); |
6759 SWT_LOG_JNI_CALL(); |
6749 SWT_LOG_DATA_3("colorHandle=%x parentHandle=%x layoutDirection=%d", aColorHandle, aParentHandle, aLayoutDirection); |
6760 SWT_LOG_DATA_2("parentHandle=%x layoutDirection=%d", aParentHandle, aLayoutDirection); |
6750 HANDLE_TO_QCOLOR( initialColor, aColorHandle ); |
6761 HANDLE_TO_POINTER(QWidget*, parent, aParentHandle); |
6751 HANDLE_TO_POINTER( QWidget*, parent, aParentHandle ); |
6762 QColorDialog dialog(QColor(aRed, aGreen, aBlue), parent); |
6752 QColorDialog dialog( *initialColor, parent ); |
6763 dialog.setObjectName(swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID)); |
6753 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID) ); |
6764 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection)); |
6754 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
|
6755 AutoPopExecStack stackExec(&dialog); |
6765 AutoPopExecStack stackExec(&dialog); |
6756 int code = dialog.exec(); |
6766 int code = dialog.exec(); |
6757 if( code == QDialog::Accepted ) |
6767 if (code == QDialog::Accepted) |
6758 { |
6768 { |
6759 color = new QColor( dialog.selectedColor() ); |
6769 color = new QColor(dialog.selectedColor()); |
6760 } |
6770 } |
6761 } |
6771 } |
6762 SWT_CATCH |
6772 SWT_CATCH |
6763 return QCOLOR_TO_HANDLE( color ); |
6773 return QCOLOR_TO_HANDLE( color ); |
6764 } |
6774 } |
9964 return retValue; |
9974 return retValue; |
9965 } |
9975 } |
9966 |
9976 |
9967 JNIEXPORT void JNICALL OS_NATIVE(QMessageBox_1swt_1execTimer) |
9977 JNIEXPORT void JNICALL OS_NATIVE(QMessageBox_1swt_1execTimer) |
9968 (JNIEnv* aJniEnv , jclass, jint aIcon, jstring aTitle, jstring aText, |
9978 (JNIEnv* aJniEnv , jclass, jint aIcon, jstring aTitle, jstring aText, |
9969 jint aParent, jstring aDialogID, jint aLayoutDirection, jint aModality, jint aPixmapHandle) |
9979 jint aParent, jstring aDialogID, jint aLayoutDirection, jint aModality, jint aCgImageHandle) |
9970 { |
9980 { |
9971 SWT_TRY |
9981 SWT_TRY |
9972 { |
9982 { |
9973 // Define event filter which closes QMessageBox |
9983 // Define event filter which closes QMessageBox |
9974 // on any key press or mouse button release events. |
9984 // on any key press or mouse button release events. |
10001 QMessageBox& msgBox; |
10011 QMessageBox& msgBox; |
10002 }; |
10012 }; |
10003 |
10013 |
10004 |
10014 |
10005 SWT_LOG_JNI_CALL(); |
10015 SWT_LOG_JNI_CALL(); |
10006 SWT_LOG_DATA_5("dialogID=%s, parent=%x icon=%d, pixmap=%x, modality=%d", aDialogID, aParent, aIcon, aPixmapHandle, aModality); |
10016 SWT_LOG_DATA_5("dialogID=%s, parent=%x icon=%d, cgImage=%x, modality=%d", aDialogID, aParent, aIcon, aCgImageHandle, aModality); |
10007 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10017 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10008 |
10018 |
10009 QMessageBox msgBox( static_cast<QMessageBox::Icon>(aIcon), |
10019 QMessageBox msgBox( static_cast<QMessageBox::Icon>(aIcon), |
10010 swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle), |
10020 swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle), |
10011 swtApp->jniUtils().JavaStringToQString(aJniEnv, aText), |
10021 swtApp->jniUtils().JavaStringToQString(aJniEnv, aText), |
10016 msgBox.setStandardButtons(QMessageBox::NoButton); |
10026 msgBox.setStandardButtons(QMessageBox::NoButton); |
10017 msgBox.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID) ); |
10027 msgBox.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID) ); |
10018 msgBox.setWindowModality( static_cast<Qt::WindowModality>(aModality) ); |
10028 msgBox.setWindowModality( static_cast<Qt::WindowModality>(aModality) ); |
10019 msgBox.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10029 msgBox.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10020 |
10030 |
10021 if (aPixmapHandle) { |
10031 Java::GFX::Image* image = reinterpret_cast<Java::GFX::Image*>(aCgImageHandle); |
10022 msgBox.setIconPixmap( *reinterpret_cast<QPixmap*>(aPixmapHandle) ); |
10032 if(image) |
10023 } |
10033 { |
|
10034 QPixmap pixmap = image->toPixmap(); |
|
10035 if (!pixmap.isNull()) |
|
10036 { |
|
10037 msgBox.setIconPixmap( pixmap ); |
|
10038 } |
|
10039 } |
10024 |
10040 |
10025 TimedMsgBoxEventFilter filter(msgBox); |
10041 TimedMsgBoxEventFilter filter(msgBox); |
10026 QTimer::singleShot(KTimedMessageBoxTimeout, &msgBox, SLOT(reject())); |
10042 QTimer::singleShot(KTimedMessageBoxTimeout, &msgBox, SLOT(reject())); |
10027 AutoPopExecStack stackExec(&msgBox); |
10043 AutoPopExecStack stackExec(&msgBox); |
10028 msgBox.exec(); |
10044 msgBox.exec(); |
10416 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10432 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10417 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10433 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10418 QFileDialog dialog( parent, |
10434 QFileDialog dialog( parent, |
10419 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10435 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10420 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10436 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10421 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) ); |
10437 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) ); |
10422 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10438 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10423 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10439 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10424 dialog.setFileMode(QFileDialog::ExistingFile); |
10440 dialog.setFileMode(QFileDialog::ExistingFile); |
10425 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptOpen) ); |
10441 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptOpen) ); |
10426 if(aSelectedFilter != NULL) |
10442 if(aSelectedFilter != NULL) |
10450 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10466 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10451 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10467 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10452 QFileDialog dialog( parent, |
10468 QFileDialog dialog( parent, |
10453 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10469 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10454 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10470 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10455 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) ); |
10471 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) ); |
10456 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10472 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10457 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10473 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10458 dialog.setFileMode(QFileDialog::ExistingFiles); |
10474 dialog.setFileMode(QFileDialog::ExistingFiles); |
10459 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptOpen) ); |
10475 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptOpen) ); |
10460 if(aSelectedFilter != NULL) |
10476 if(aSelectedFilter != NULL) |
10484 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10500 SWT_LOG_DATA_2( "parent=%x direction=%d ", aParent, aLayoutDirection ); |
10485 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10501 HANDLE_TO_POINTER(QWidget*, parent, aParent); |
10486 QFileDialog dialog( parent, |
10502 QFileDialog dialog( parent, |
10487 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10503 aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(), |
10488 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10504 aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(), |
10489 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) ); |
10505 aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) ); |
10490 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10506 dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) ); |
10491 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10507 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10492 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptSave) ); |
10508 dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptSave) ); |
10493 dialog.setConfirmOverwrite ( false ); |
10509 dialog.setConfirmOverwrite ( false ); |
10494 dialog.setFileMode(QFileDialog::AnyFile); |
10510 dialog.setFileMode(QFileDialog::AnyFile); |
11525 #else |
11528 #else |
11526 return JNI_FALSE; |
11529 return JNI_FALSE; |
11527 #endif |
11530 #endif |
11528 } |
11531 } |
11529 |
11532 |
|
11533 // |
|
11534 // XQApplicationManager |
|
11535 // |
|
11536 |
|
11537 JNIEXPORT jint JNICALL OS_NATIVE( XQApplicationManager_1new ) |
|
11538 #ifdef __SYMBIAN32__ |
|
11539 (JNIEnv* aJniEnv, jclass) |
|
11540 #else |
|
11541 (JNIEnv* aJniEnv, jclass) |
|
11542 #endif |
|
11543 { |
|
11544 #ifdef __SYMBIAN32__ |
|
11545 XQApplicationManager* aiwMgr = NULL; |
|
11546 SWT_TRY |
|
11547 { |
|
11548 SWT_LOG_JNI_CALL(); |
|
11549 aiwMgr = new XQApplicationManager(); |
|
11550 } |
|
11551 SWT_CATCH |
|
11552 return reinterpret_cast<jint>(aiwMgr); |
|
11553 #else |
|
11554 return NULL; |
|
11555 #endif |
|
11556 } |
|
11557 |
|
11558 JNIEXPORT jint JNICALL OS_NATIVE( XQApplicationManager_1create ) |
|
11559 #ifdef __SYMBIAN32__ |
|
11560 (JNIEnv * aJniEnv, jclass,jint aHandle, jstring aService, jstring aInterface, jstring aOperation, jboolean aSynchronous) |
|
11561 #else |
|
11562 (JNIEnv *, jclass, jint, jstring, jstring, jstring, jboolean) |
|
11563 #endif |
|
11564 { |
|
11565 #ifdef __SYMBIAN32__ |
|
11566 XQAiwRequest* request = NULL; |
|
11567 SWT_TRY |
|
11568 { |
|
11569 SWT_LOG_JNI_CALL(); |
|
11570 XQApplicationManager* aiwmgr = reinterpret_cast<XQApplicationManager*>(aHandle); |
|
11571 request = aiwmgr->create(swtApp->jniUtils().JavaStringToQString(aJniEnv, aService), |
|
11572 swtApp->jniUtils().JavaStringToQString(aJniEnv, aInterface), |
|
11573 swtApp->jniUtils().JavaStringToQString(aJniEnv, aOperation), |
|
11574 aSynchronous == JNI_TRUE ? true : false); |
|
11575 } |
|
11576 SWT_CATCH |
|
11577 return reinterpret_cast<jint>(request); |
|
11578 #else |
|
11579 return NULL; |
|
11580 #endif |
|
11581 } |
|
11582 |
|
11583 // |
|
11584 // XQAiwRequest |
|
11585 // |
|
11586 JNIEXPORT void JNICALL OS_NATIVE( XQAiwRequest_1setArguments ) |
|
11587 #ifdef __SYMBIAN32__ |
|
11588 (JNIEnv* aJniEnv, jclass, jint aHandle, jstring aNumber) |
|
11589 #else |
|
11590 (JNIEnv* aJniEnv, jclass, jint, jstring) |
|
11591 #endif |
|
11592 { |
|
11593 #ifdef __SYMBIAN32__ |
|
11594 SWT_TRY |
|
11595 { |
|
11596 SWT_LOG_JNI_CALL(); |
|
11597 SWT_LOG_DATA_1( "handle=%x", aHandle ); |
|
11598 XQAiwRequest* request = reinterpret_cast<XQAiwRequest*>(aHandle); |
|
11599 if (request) |
|
11600 { |
|
11601 QList<QVariant> args; |
|
11602 args << swtApp->jniUtils().JavaStringToQString(aJniEnv, |
|
11603 aNumber); |
|
11604 request->setArguments(args); |
|
11605 } |
|
11606 } |
|
11607 SWT_CATCH |
|
11608 #endif |
|
11609 } |
|
11610 |
|
11611 JNIEXPORT void JNICALL OS_NATIVE( XQAiwRequest_1swtDialer_1setArguments ) |
|
11612 #ifdef __SYMBIAN32__ |
|
11613 (JNIEnv* aJniEnv, jclass, jint aHandle, jstring aNumber) |
|
11614 #else |
|
11615 (JNIEnv* aJniEnv, jclass, jint, jstring) |
|
11616 #endif |
|
11617 { |
|
11618 #ifdef __SYMBIAN32__ |
|
11619 SWT_TRY |
|
11620 { |
|
11621 SWT_LOG_JNI_CALL(); |
|
11622 SWT_LOG_DATA_1( "handle=%x", aHandle ); |
|
11623 XQAiwRequest* request = reinterpret_cast<XQAiwRequest*>(aHandle); |
|
11624 if (request) |
|
11625 { |
|
11626 QList<QVariant> args; |
|
11627 QVariantMap map; |
|
11628 map.insert(XQLOGS_VIEW_INDEX, QVariant(int(XQService::LogsViewAll))); |
|
11629 map.insert(XQLOGS_SHOW_DIALPAD, QVariant(true)); |
|
11630 map.insert(XQLOGS_DIALPAD_TEXT, QVariant(swtApp->jniUtils().JavaStringToQString(aJniEnv, |
|
11631 aNumber))); |
|
11632 args.append(QVariant(map)); |
|
11633 request->setArguments(args); |
|
11634 } |
|
11635 } |
|
11636 SWT_CATCH |
|
11637 #endif |
|
11638 } |
|
11639 |
|
11640 JNIEXPORT jboolean JNICALL OS_NATIVE( XQAiwRequest_1send ) |
|
11641 #ifdef __SYMBIAN32__ |
|
11642 (JNIEnv* aJniEnv, jclass, jint aHandle) |
|
11643 #else |
|
11644 (JNIEnv* aJniEnv, jclass, jint) |
|
11645 #endif |
|
11646 { |
|
11647 #ifdef __SYMBIAN32__ |
|
11648 bool result = false; |
|
11649 SWT_TRY |
|
11650 { |
|
11651 SWT_LOG_JNI_CALL(); |
|
11652 SWT_LOG_DATA_1( "handle=%x", aHandle ); |
|
11653 XQAiwRequest* request= reinterpret_cast<XQAiwRequest*>(aHandle); |
|
11654 if (request) |
|
11655 { |
|
11656 result = request->send(); |
|
11657 } |
|
11658 } |
|
11659 SWT_CATCH |
|
11660 return result ? JNI_TRUE : JNI_FALSE; |
|
11661 #else |
|
11662 return JNI_FALSE; |
|
11663 #endif |
|
11664 } |
11530 |
11665 |
11531 // |
11666 // |
11532 // CntServicesContactList |
11667 // CntServicesContactList |
11533 // |
11668 // |
11534 |
11669 |