当前位置: 首页>>代码示例>>C++>>正文


C++ QSimCommand类代码示例

本文整理汇总了C++中QSimCommand的典型用法代码示例。如果您正苦于以下问题:C++ QSimCommand类的具体用法?C++ QSimCommand怎么用?C++ QSimCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QSimCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void DemoSimApplication::toneMenu( const QSimTerminalResponse& resp )
{
    QSimCommand cmd;

    if ( resp.result() == QSimTerminalResponse::Success ) {
        // Item selected.
        cmd.setType( QSimCommand::PlayTone );
        cmd.setDestinationDevice( QSimCommand::Earpiece );
        cmd.setTone( (QSimCommand::Tone)( resp.menuItem() ) );
        if ( cmd.tone() == QSimCommand::ToneDial )
            cmd.setDuration( 5000 );
        else if ( cmd.tone() == QSimCommand::ToneGeneralBeep ||
                  cmd.tone() == QSimCommand::TonePositiveBeep ||
                  cmd.tone() == QSimCommand::ToneNegativeBeep )
            cmd.setDuration( 1000 );
        else
            cmd.setDuration( 3000 );
        command( cmd, this, SLOT(sendToneMenu()) );
    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
        // Request to move backward.
        mainMenu();
    } else {
        // Unknown response - just go back to the main menu.
        mainMenu();
    }
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:26,代码来源:simapplication.cpp

示例2: sendBrowserMenu

void DemoSimApplication::sendBrowserMenu()
{
    QSimCommand cmd;
    QSimMenuItem item;
    QList<QSimMenuItem> items;

    cmd.setType( QSimCommand::SelectItem );
    cmd.setTitle( "Web Browser" );

    item.setIdentifier( 1 );
    item.setLabel( "Qt Extended" );
    items += item;

    item.setIdentifier( 2 );
    item.setLabel( "Google (normal)" );
    items += item;

    item.setIdentifier( 3 );
    item.setLabel( "Google (if browser not in use)" );
    items += item;

    item.setIdentifier( 4 );
    item.setLabel( "Google (clear history)" );
    items += item;

    item.setIdentifier( 5 );
    item.setLabel( "Default Home Page" );
    items += item;

    cmd.setMenuItems( items );

    command( cmd, this, SLOT(browserMenu(QSimTerminalResponse)) );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:33,代码来源:simapplication.cpp

示例3: sendSportsMenu

void DemoSimApplication::sendSportsMenu()
{
    QSimCommand cmd;
    QSimMenuItem item;
    QList<QSimMenuItem> items;

    cmd.setType( QSimCommand::SelectItem );
    cmd.setTitle( "Sports" );

    item.setIdentifier( SportsMenu_Chess );
    item.setLabel( "Chess" );
    items += item;

    item.setIdentifier( SportsMenu_Painting );
    item.setLabel( "Finger Painting" );
    items += item;

    item.setIdentifier( SportsMenu_Snakes );
    item.setLabel( "Snakes and Ladders" );
    items += item;

    item.setIdentifier( SportsMenu_Main );
    item.setLabel( "Return to main menu" );
    items += item;

    cmd.setMenuItems( items );

    command( cmd, this, SLOT(sportsMenu(QSimTerminalResponse)) );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:29,代码来源:simapplication.cpp

示例4: sendIconSEMenu

void DemoSimApplication::sendIconSEMenu()
{
    QSimCommand cmd;
    QSimMenuItem item;
    QList<QSimMenuItem> items;

    cmd.setType( QSimCommand::SelectItem );
    cmd.setTitle( "Icons SE" );

    item.setIdentifier( 1 );
    item.setLabel( "Basic Icon" );
    item.setIconId( 1 );
    item.setIconSelfExplanatory( true );
    items += item;

    item.setIdentifier( 2 );
    item.setLabel( "Color Icon" );
    item.setIconId( 2 );
    item.setIconSelfExplanatory( true );
    items += item;

    item.setIdentifier( 3 );
    item.setLabel( "Bad Icon" );
    item.setIconId( 70 );
    item.setIconSelfExplanatory( true );
    items += item;

    cmd.setMenuItems( items );

    command( cmd, this, SLOT(iconSEMenu(QSimTerminalResponse)) );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:31,代码来源:simapplication.cpp

示例5: listViewPreferred

bool SimApp::listViewPreferred(const QSimCommand& cmd)
{
    if (!cmd.softKeysPreferred())
        return true;
    // reserve one key for back button
    if ((QSoftMenuBar::keys().count() - 1) >= cmd.menuItems().count())
        return false;
    else
        return true;
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:10,代码来源:simapp.cpp

示例6: sendToneMenu

void DemoSimApplication::sendToneMenu()
{
    QSimCommand cmd;
    QSimMenuItem item;
    QList<QSimMenuItem> items;

    cmd.setType( QSimCommand::SelectItem );
    cmd.setTitle( "Tones" );

    item.setIdentifier( (uint)QSimCommand::ToneDial );
    item.setLabel( "Dial" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneBusy );
    item.setLabel( "Busy" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneCongestion );
    item.setLabel( "Congestion" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneRadioAck );
    item.setLabel( "Radio Ack" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneDropped );
    item.setLabel( "Dropped" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneError );
    item.setLabel( "Error" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneCallWaiting );
    item.setLabel( "Call Waiting" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneGeneralBeep );
    item.setLabel( "General Beep" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::TonePositiveBeep );
    item.setLabel( "Positive Beep" );
    items += item;

    item.setIdentifier( (uint)QSimCommand::ToneNegativeBeep );
    item.setLabel( "Negative Beep" );
    items += item;

    cmd.setMenuItems( items );

    command( cmd, this, SLOT(toneMenu(QSimTerminalResponse)) );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:53,代码来源:simapplication.cpp

示例7: getInputLoop

void DemoSimApplication::getInputLoop( const QSimTerminalResponse& resp )
{
    QSimCommand cmd;
    if ( resp.result() == QSimTerminalResponse::HelpInformationRequested ) {
        // Display help for the game.
        cmd.setType( QSimCommand::DisplayText );
        cmd.setDestinationDevice( QSimCommand::Display );
        cmd.setText("Enter code of the company." );
        command( cmd, this, SLOT(mainMenu()) );
    } else {
        mainMenu();
    }
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:13,代码来源:simapplication.cpp

示例8: mainMenu

void DemoSimApplication::mainMenu()
{
    QSimCommand cmd;
    QSimMenuItem item;
    QList<QSimMenuItem> items;

    cmd.setType( QSimCommand::SetupMenu );

    item.setIdentifier( MainMenu_News );
    item.setLabel( "News" );
    items += item;

    item.setIdentifier( MainMenu_Sports );
    item.setLabel( "Sports" );
    items += item;

    item.setIdentifier( MainMenu_Time );
    item.setLabel( "Time" );
    items += item;

    item.setIdentifier( MainMenu_SticksGame );
    item.setLabel( "Sticks Game" );
    items += item;

    item.setIdentifier( MainMenu_Tones );
    item.setLabel( "Tones" );
    items += item;

    item.setIdentifier( MainMenu_Icons );
    item.setLabel( "Icons (not self-explanatory)" );
    items += item;

    item.setIdentifier( MainMenu_IconsSE );
    item.setLabel( "Icons (self-explanatory)" );
    items += item;

    item.setIdentifier( MainMenu_Finance );
    item.setLabel( "Finance" );
    items += item;

    item.setIdentifier( MainMenu_Browser );
    item.setLabel( "Web Browser" );
    items += item;

    cmd.setMenuItems( items );

    command( cmd, 0, 0 );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:48,代码来源:simapplication.cpp

示例9: QFETCH

void tst_QSimToolkit::testEncodeSendDTMF()
{
    QFETCH( QByteArray, data );
    QFETCH( QByteArray, resp );
    QFETCH( int, resptype );
    QFETCH( QString, text );
    QFETCH( QString, number );
    QFETCH( int, iconId );
    QFETCH( bool, iconSelfExplanatory );
    QFETCH( QByteArray, textAttribute );
    QFETCH( QString, html );
    QFETCH( int, options );

    // Output a dummy line to give some indication of which test we are currently running.
    qDebug() << "";

    // Check that the command PDU can be parsed correctly.
    QSimCommand decoded = QSimCommand::fromPdu(data);
    QVERIFY( decoded.type() == QSimCommand::SendDTMF );
    QVERIFY( decoded.destinationDevice() == QSimCommand::Network );
    QCOMPARE( decoded.text(), text );
    QCOMPARE( decoded.number(), number );
    QCOMPARE( (int)decoded.iconId(), iconId );
    QCOMPARE( decoded.iconSelfExplanatory(), iconSelfExplanatory );
    QCOMPARE( decoded.textAttribute(), textAttribute );
    if ( !textAttribute.isEmpty() )
        QCOMPARE( decoded.textHtml(), html );

    // Check that the original command PDU can be reconstructed correctly.
    QByteArray encoded = decoded.toPdu( (QSimCommand::ToPduOptions)options );
    QCOMPARE( encoded, data );

    // Check that the terminal response PDU can be parsed correctly.
    QSimTerminalResponse decodedResp = QSimTerminalResponse::fromPdu(resp);
    QVERIFY( data.contains( decodedResp.commandPdu() ) );
    if ( resptype < 0x0100 ) {
        QVERIFY( decodedResp.result() == (QSimTerminalResponse::Result)resptype );
        QVERIFY( decodedResp.causeData().isEmpty() );
        QVERIFY( decodedResp.cause() == QSimTerminalResponse::NoSpecificCause );
    } else {
        QVERIFY( decodedResp.result() == (QSimTerminalResponse::Result)(resptype >> 8) );
        QVERIFY( decodedResp.causeData().size() == 1 );
        QVERIFY( decodedResp.cause() == (QSimTerminalResponse::Cause)(resptype & 0xFF) );
    }

    // Check that the original terminal response PDU can be reconstructed correctly.
    QCOMPARE( decodedResp.toPdu(), resp );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:48,代码来源:senddtmf.cpp

示例10: cmdSetupEventList

void SimApp::cmdSetupEventList(const QSimCommand &cmd)
{
    QByteArray events = cmd.extensionField(0x99);
    int newEvents = 0;
    foreach ( char ev, events )
        newEvents |= (1 << (int)(ev & 0xFF));
    changeEventList( newEvents );
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:8,代码来源:simapp.cpp

示例11: showNotification

// Shows info to user when, e.g. SMS is sent.
void SimApp::showNotification(const QSimCommand &cmd)
{
    if (!cmd.text().isEmpty() || !cmd.suppressUserFeedback()) {
        if (notification) {
            notification->setCommand(cmd);
            stack->setCurrentWidget(notification);
            emit viewChanged(notification);
        } else {
            if ( cmd.iconId() > 0 )
                createIconReader();
            notification = new SimText(cmd, iconReader, stack);
            stack->addWidget(notification);
            stack->setCurrentWidget(notification);
            emit viewChanged(notification);
        }
    }
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:18,代码来源:simapp.cpp

示例12: cmdIdleModeText

void SimApp::cmdIdleModeText(const QSimCommand &cmd)
{
    idleModeText = cmd;
    if ( cmd.iconId() != 0 ) {
        createIconReader();
        if ( iconReader->haveIcon( cmd.iconId() ) ) {
            // Icon already cached from last time.
            idleModeImage = iconReader->icon( cmd.iconId() );
        } else {
            // Request that the icon be fetched from the sim.
            iconReader->requestIcon( cmd.iconId() );
            idleModeImage = QImage();
        }
    } else {
        idleModeImage = QImage();
    }
    updateValueSpace();
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:18,代码来源:simapp.cpp

示例13: cmdTone

void SimApp::cmdTone(const QSimCommand & cmd )
{
    if ( cmd.iconId() > 0 )
        createIconReader();
    SimTone *tone = new SimTone(cmd, iconReader, stack);
    connect(tone, SIGNAL(sendResponse(QSimTerminalResponse)),
            this, SLOT(sendResponse(QSimTerminalResponse)) );
    setView(tone);
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:9,代码来源:simapp.cpp

示例14: cmdDisplayText

void SimApp::cmdDisplayText(const QSimCommand &cmd)
{
#ifndef QTOPIA_TEST
    // DisplayText with low priority came while screen is busy
    if ( !this->isVisible()
            && !(HomeScreenControl::instance()->homeScreen()->windowState() & Qt::WindowActive)
            && !cmd.highPriority() ) {
        QSimTerminalResponse resp;
        resp.setCommand(cmd);
        resp.setCause(QSimTerminalResponse::ScreenIsBusy);
        resp.setResult(QSimTerminalResponse::MEUnableToProcess);
        sendResponse( resp );
        return;
    }
#endif
    if ( cmd.iconId() > 0 )
        createIconReader();

    hasSustainedDisplayText = cmd.immediateResponse();

    if (view && qobject_cast<SimText*>(view)) {
        SimText *text = (SimText *)view;
        if (cmd.highPriority() || !text->hasHighPriority()) {
            if (cmd.iconId())
                text->setCommand(cmd, iconReader);
            else
                text->setCommand(cmd);
            stack->setCurrentWidget(text);
        } else {
            // send screen busy response
            QSimTerminalResponse resp;
            resp.setCommand(cmd);
            resp.setCause(QSimTerminalResponse::ScreenIsBusy);
            resp.setResult(QSimTerminalResponse::MEUnableToProcess);
            sendResponse( resp );
        }
    } else {
        SimText *text = new SimText(cmd, iconReader, stack);
        connect(text, SIGNAL(sendResponse(QSimTerminalResponse)),
                this, SLOT(sendResponse(QSimTerminalResponse)) );
        connect(text, SIGNAL(hideApp()), this, SLOT(hideApp()));
        setView(text);
    }
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:44,代码来源:simapp.cpp

示例15: cmdInKey

void SimApp::cmdInKey(const QSimCommand &cmd)
{
    if ( cmd.iconId() > 0 )
        createIconReader();

    SimInKey *inKey = new SimInKey(cmd, iconReader, stack);
    connect(inKey, SIGNAL(sendResponse(QSimTerminalResponse)),
            this, SLOT(sendResponse(QSimTerminalResponse)) );
    setView(inKey);
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:10,代码来源:simapp.cpp


注:本文中的QSimCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。