phonesim: Add GET_INPUT test case
PATCH 1/1 phonesim: Add GET_INPUT test case
This test case is used to check the immediate digit response flag.
--- src/conformancesimapplication.cpp | 25 ++++++++++++++++++++----- src/qsimcommand.cpp | 32 ++++++++++++++++++++++++++++++++ src/qsimcommand.h | 3 +++ 3 files changed, 55 insertions(+), 5 deletions(-)
src/conformancesimapplication.cpp +20 -5
@@ -81,11 +81,12 @@ const QString ConformanceSimApplication::getName() #define GetInkeyMenu_Cyrillic_Display_2 4 #define GetInkeyMenu_Cyrillic_Entry 5 #define GetInkeyMenu_YesNo_Response 6 -#define GetInkeyMenu_Icon 7 -#define GetInkeyMenu_Help 8 -#define GetInkeyMenu_Variable_Timeout 9 -#define GetInkeyMenu_Text_Attribute 10 -#define GetInkeyMenu_Main 11 +#define GetInkeyMenu_ImmediateResponse 7 +#define GetInkeyMenu_Icon 8 +#define GetInkeyMenu_Help 9 +#define GetInkeyMenu_Variable_Timeout 10 +#define GetInkeyMenu_Text_Attribute 11 +#define GetInkeyMenu_Main 12 #define GetInputMenu_Normal 1 #define GetInputMenu_No_Response 2
@@ -677,6 +678,10 @@ void ConformanceSimApplication::sendGetInkeyMenu() item.setLabel( "Yes/No response for the input" ); items += item; + item.setIdentifier( GetInkeyMenu_ImmediateResponse ); + item.setLabel( "Immediate response for the digit input" ); + items += item; + item.setIdentifier( GetInkeyMenu_Icon ); item.setLabel( "Display of icon" ); items += item;
@@ -887,6 +892,16 @@ void ConformanceSimApplication::GetInkeyMenu( const QSimTerminalResponse& resp ) } break; + case GetInkeyMenu_ImmediateResponse: + { + cmd.setType( QSimCommand::GetInkey ); + cmd.setDestinationDevice( QSimCommand::ME ); + cmd.setWantImmediateResponse( true ); + cmd.setText( "Enter 1" ); + command( cmd, this, SLOT(sendGetInkeyMenu()) ); + } + break; + case GetInkeyMenu_Icon: { sendGetInkeyIconMenu();
src/qsimcommand.cpp +32 -0
@@ -1312,6 +1312,38 @@ void QSimCommand::setWantYesNo( bool value ) /*! + Returns true if \c GetInkey wants that the response is immediately sent + after key press. The default value is false. + + Applies to: \c GetInkey + + \sa setWantImmediateResponse() +*/ +bool QSimCommand::wantImmediateResponse() const +{ + if ( d->type == QSimCommand::GetInkey ) + return d->qualifierBit( 0x08 ); + else + return false; +} + + +/*! + Sets the flag that determines if \c GetInkey wants that + the response is immediately sent after key press. + + Applies to: \c GetInkey + + \sa wantImmediateResponse() +*/ +void QSimCommand::setWantImmediateResponse( bool value ) +{ + if ( d->type == QSimCommand::GetInkey ) + dwrite()->setQualifierBit( 0x08, value ); +} + + +/*! Returns the minimum text length for input. The default value is 0. Applies to: \c GetInput.
src/qsimcommand.h +3 -0
@@ -292,6 +292,9 @@ public: bool echo() const; void setEcho( bool value ); + bool wantImmediateResponse() const; + void setWantImmediateResponse( bool value ); + QSimCommand::Disposition disposition() const; void setDisposition( QSimCommand::Disposition value );
Signature · 1 line
1.7.9.5
Hi Philippe,
Quoted 5 lines · Philippe Nunes
This test case is used to check the immediate digit response flag.
--- src/conformancesimapplication.cpp | 25 ++++++++++++++++++++----- src/qsimcommand.cpp | 32 ++++++++++++++++++++++++++++++++ src/qsimcommand.h | 3 +++
Please break this up into two, one for conformancesimapplication.cpp and the rest.
Quoted 66 lines
3 files changed, 55 insertions(+), 5 deletions(-)src/conformancesimapplication.cpp +20
-5@@ -81,11 +81,12 @@ const QString ConformanceSimApplication::getName() #define GetInkeyMenu_Cyrillic_Display_2 4 #define GetInkeyMenu_Cyrillic_Entry 5 #define GetInkeyMenu_YesNo_Response 6 -#define GetInkeyMenu_Icon 7 -#define GetInkeyMenu_Help 8 -#define GetInkeyMenu_Variable_Timeout 9 -#define GetInkeyMenu_Text_Attribute 10 -#define GetInkeyMenu_Main 11 +#define GetInkeyMenu_ImmediateResponse 7 +#define GetInkeyMenu_Icon 8 +#define GetInkeyMenu_Help 9 +#define GetInkeyMenu_Variable_Timeout 10 +#define GetInkeyMenu_Text_Attribute 11 +#define GetInkeyMenu_Main 12 #define GetInputMenu_Normal 1 #define GetInputMenu_No_Response 2@@ -677,6 +678,10 @@ void ConformanceSimApplication::sendGetInkeyMenu() item.setLabel( "Yes/No response for the input" ); items += item; + item.setIdentifier( GetInkeyMenu_ImmediateResponse ); + item.setLabel( "Immediate response for the digit input" ); + items += item; + item.setIdentifier( GetInkeyMenu_Icon ); item.setLabel( "Display of icon" ); items += item;@@ -887,6 +892,16 @@ void ConformanceSimApplication::GetInkeyMenu( const QSimTerminalResponse& resp ) } break; + case GetInkeyMenu_ImmediateResponse: + { + cmd.setType( QSimCommand::GetInkey ); + cmd.setDestinationDevice( QSimCommand::ME ); + cmd.setWantImmediateResponse( true ); + cmd.setText( "Enter 1" ); + command( cmd, this, SLOT(sendGetInkeyMenu()) ); + } + break; + case GetInkeyMenu_Icon: { sendGetInkeyIconMenu();src/qsimcommand.cpp +6
-0@@ -1312,6 +1312,38 @@ void QSimCommand::setWantYesNo( bool value ) /*! + Returns true if \c GetInkey wants that the response is immediately sent + after key press. The default value is false. + + Applies to: \c GetInkey + + \sa setWantImmediateResponse()
src/qsimcommand.cpp void QSimCommand::setWantYesNo( bool value ) · line 1330
Quoted 10 lines
src/qsimcommand.cpp +10
-0+*/ +bool QSimCommand::wantImmediateResponse() const +{ + if ( d->type == QSimCommand::GetInkey ) + return d->qualifierBit( 0x08 ); + else + return false; +} + +
Why two empty lines?
Quoted 5 lines
src/qsimcommand.cpp +5
-0+/*! + Sets the flag that determines if \c GetInkey wants that + the response is immediately sent after key press. + + Applies to: \c GetInkey
src/qsimcommand.cpp void QSimCommand::setWantYesNo( bool value ) · line 1345
Quoted 10 lines
src/qsimcommand.cpp +10
-0+ + \sa wantImmediateResponse() +*/ +void QSimCommand::setWantImmediateResponse( bool value ) +{ + if ( d->type == QSimCommand::GetInkey ) + dwrite()->setQualifierBit( 0x08, value ); +} + +
And again?
Quoted 9 lines
src/qsimcommand.cpp +1
-0+/*! Returns the minimum text length for input. The default value is 0. Applies to: \c GetInput.src/qsimcommand.h +0
-0
src/qsimcommand.h public: · line 300
Quoted 9 lines
src/qsimcommand.h +3
-0@@ -292,6 +292,9 @@ public: bool echo() const; void setEcho( bool value ); + bool wantImmediateResponse() const; + void setWantImmediateResponse( bool value ); + QSimCommand::Disposition disposition() const; void setDisposition( QSimCommand::Disposition value );
Regards,
-Denis