diff -r 1f0034e370aa -r 71ad690e91f5 javauis/runtimeui_qt/src.s60/jni.cpp --- a/javauis/runtimeui_qt/src.s60/jni.cpp Fri Sep 17 16:44:34 2010 +0300 +++ b/javauis/runtimeui_qt/src.s60/jni.cpp Mon Oct 04 11:29:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: RuntimeUI JNI interface. * */ @@ -26,11 +26,8 @@ using namespace java::runtimeui; JNIEXPORT jboolean JNICALL Java_com_nokia_mj_impl_rt_ui_qt_RuntimeUiQt__1confirm -(JNIEnv * aEnv, jobject, jstring aAppName, jobject aConfirmData, jboolean /*aIdentified*/) +(JNIEnv * aEnv, jobject, jstring aAppName, jobject aConfirmData, jboolean aIdentified) { - // Identified parameter is not used. It was earlier used to add icon to query header - // and that is currently not supported. - CActiveScheduler* newScheduler = 0; if (CActiveScheduler::Current() == 0) @@ -49,10 +46,32 @@ aConfirmData, getQuestionMethod); JStringUtils question(*aEnv, jQuestion); - int answer = -1; + std::vector answerOptions; + jmethodID getAnswerOptionsMethod = aEnv->GetMethodID( + confirmDataClass,"getAnswerOptions", "()[Ljava/lang/String;"); + jobjectArray jAnswerOptions = (jobjectArray)aEnv->CallObjectMethod( + aConfirmData, getAnswerOptionsMethod); + if (jAnswerOptions != NULL) + { + int len = aEnv->GetArrayLength(jAnswerOptions); + answerOptions.reserve(len); + + for (int i=0; iGetObjectArrayElement( + jAnswerOptions, i); + JStringUtils answerOption(*aEnv, jAnswerOption); + answerOptions.push_back(answerOption.Alloc()); // If alloc fails NULL is added. + } + } + + // Answer suggestion is not supported because of touch UIs. + ConfirmData confirmData(question, answerOptions, -1); + + int answer = ConfirmData::NO_ANSWER; bool result = false; - TRAPD(err, answer = RuntimeUiQt::confirmL(appName, question)); + TRAPD(err, answer = RuntimeUiQt::confirmL(appName, question, confirmData, aIdentified)); if (KErrNone != err) { @@ -66,12 +85,20 @@ result = true; } + for (int i=0; i