screensaver/devicedialogplugins/snsrdevicedialogplugin/src/snsrdevicedialog.cpp
author hgs
Fri, 23 Jul 2010 13:47:57 +0300
changeset 69 87476091b3f5
parent 62 341166945d65
child 73 94a8be33ee70
permissions -rw-r--r--
201029
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62
hgs
parents:
diff changeset
     1
/*
69
hgs
parents: 62
diff changeset
     2
* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
62
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: Default Screensaver runtime.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <QGraphicsLinearLayout>
69
hgs
parents: 62
diff changeset
    19
#include <QGraphicsSceneResizeEvent>
62
hgs
parents:
diff changeset
    20
#include <QPainter>
hgs
parents:
diff changeset
    21
#include <QDebug>
69
hgs
parents: 62
diff changeset
    22
#include <QServiceManager>
hgs
parents: 62
diff changeset
    23
#include <QServiceFilter>
hgs
parents: 62
diff changeset
    24
#include <QServiceInterfaceDescriptor>
hgs
parents: 62
diff changeset
    25
#include <XQSettingsManager>
hgs
parents: 62
diff changeset
    26
#include <HbMainWindow>
62
hgs
parents:
diff changeset
    27
#include <HbIndicatorInterface>
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
#include <screensaver.h>
69
hgs
parents: 62
diff changeset
    30
#include <screensaverdomaincrkeys.h>
62
hgs
parents:
diff changeset
    31
#include "snsrdevicedialog.h"
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
const char *gBigClockInterfaceName = "com.nokia.screensaver.ISnsrBigClockScreensaver";
hgs
parents:
diff changeset
    34
hgs
parents:
diff changeset
    35
/*!
hgs
parents:
diff changeset
    36
    \class SnsrDeviceDialog
hgs
parents:
diff changeset
    37
    \ingroup group_snsrdevicedialogplugin
hgs
parents:
diff changeset
    38
    \brief Screensaver Device Dialog.
hgs
parents:
diff changeset
    39
 */
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
extern const char *lViewType;
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
const char *SnsrDeviceDialog::dataKeyUnlock = "unlock";
69
hgs
parents: 62
diff changeset
    44
const char *SnsrDeviceDialog::dataKeySwitchLights = "switch_lights";
hgs
parents: 62
diff changeset
    45
const char *SnsrDeviceDialog::dataKeySwitchLowPower = "switch_low_power";
62
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
QTM_USE_NAMESPACE
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
/*!
hgs
parents:
diff changeset
    50
    Constructor.
hgs
parents:
diff changeset
    51
    \param viewType Initial view type (active or standby).
hgs
parents:
diff changeset
    52
    \param parent Parent.
hgs
parents:
diff changeset
    53
 */
hgs
parents:
diff changeset
    54
SnsrDeviceDialog::SnsrDeviceDialog(const QVariantMap &parameters, QGraphicsItem *parent) :
69
hgs
parents: 62
diff changeset
    55
        HbPopup(parent), 
hgs
parents: 62
diff changeset
    56
        mScreensaver(0), 
hgs
parents: 62
diff changeset
    57
        mLayout(0), 
hgs
parents: 62
diff changeset
    58
        m_setManager(0)
62
hgs
parents:
diff changeset
    59
{
hgs
parents:
diff changeset
    60
    qDebug("SnsrDeviceDialog::SnsrDeviceDialog()");
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
    
hgs
parents:
diff changeset
    63
    // load screensaver plugin
hgs
parents:
diff changeset
    64
    // Workaround to QtSF bug. Create in stack after the bug is fixed.
hgs
parents:
diff changeset
    65
    QServiceManager manager;
hgs
parents:
diff changeset
    66
    QServiceFilter filter(gBigClockInterfaceName);
hgs
parents:
diff changeset
    67
    QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(
hgs
parents:
diff changeset
    68
        filter);
hgs
parents:
diff changeset
    69
    Q_ASSERT(interfaces.count());
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
    mScreensaver = manager.loadLocalTypedInterface<Screensaver>(
hgs
parents:
diff changeset
    72
        interfaces.first().interfaceName() );
hgs
parents:
diff changeset
    73
    if (mScreensaver) {
hgs
parents:
diff changeset
    74
        mScreensaver->setParent(this);
hgs
parents:
diff changeset
    75
    } else {
hgs
parents:
diff changeset
    76
        // TODO: error state
hgs
parents:
diff changeset
    77
    }
hgs
parents:
diff changeset
    78
    connect(mScreensaver, SIGNAL(viewChanged(QGraphicsWidget*)),
hgs
parents:
diff changeset
    79
        SLOT(changeView(QGraphicsWidget*)));
hgs
parents:
diff changeset
    80
    connect(mScreensaver, SIGNAL(faulted()),
hgs
parents:
diff changeset
    81
        SLOT(screensaverFaulted()));
69
hgs
parents: 62
diff changeset
    82
    connect( mScreensaver, SIGNAL(unlockRequested()),
hgs
parents: 62
diff changeset
    83
        SLOT(requestUnlock()) );
hgs
parents: 62
diff changeset
    84
    connect( mScreensaver, SIGNAL(screenPowerModeRequested(Screensaver::ScreenPowerMode)),
hgs
parents: 62
diff changeset
    85
        SLOT(requestScreenMode(Screensaver::ScreenPowerMode)) );
62
hgs
parents:
diff changeset
    86
    
hgs
parents:
diff changeset
    87
    mScreensaver->initialize();
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
    setBackgroundItem(0);
hgs
parents:
diff changeset
    90
hgs
parents:
diff changeset
    91
    setDismissPolicy(HbPopup::NoDismiss);
hgs
parents:
diff changeset
    92
    setTimeout(HbPopup::NoTimeout);
69
hgs
parents: 62
diff changeset
    93
    
hgs
parents: 62
diff changeset
    94
    mainWindow()->setAutomaticOrientationEffectEnabled(false);
62
hgs
parents:
diff changeset
    95
hgs
parents:
diff changeset
    96
    setDeviceDialogParameters( parameters );
hgs
parents:
diff changeset
    97
}
hgs
parents:
diff changeset
    98
hgs
parents:
diff changeset
    99
/*!
hgs
parents:
diff changeset
   100
    Destructor.
hgs
parents:
diff changeset
   101
 */
hgs
parents:
diff changeset
   102
SnsrDeviceDialog::~SnsrDeviceDialog()
hgs
parents:
diff changeset
   103
{
hgs
parents:
diff changeset
   104
    qDebug("SnsrDeviceDialog::~SnsrDeviceDialog()");
hgs
parents:
diff changeset
   105
    QServiceManager serviceManager;
hgs
parents:
diff changeset
   106
    serviceManager.removeService(gBigClockInterfaceName);
hgs
parents:
diff changeset
   107
}
hgs
parents:
diff changeset
   108
hgs
parents:
diff changeset
   109
/*!
hgs
parents:
diff changeset
   110
    Sets device dialog parameters.
hgs
parents:
diff changeset
   111
    \param parameters Device Dialog's parameters to be set.
hgs
parents:
diff changeset
   112
    \ret return true if parameters are correct.
hgs
parents:
diff changeset
   113
 */
hgs
parents:
diff changeset
   114
bool SnsrDeviceDialog::setDeviceDialogParameters(const QVariantMap &parameters)
hgs
parents:
diff changeset
   115
{
hgs
parents:
diff changeset
   116
    qDebug("SnsrDeviceDialog::setDeviceDialogParameters()");
hgs
parents:
diff changeset
   117
hgs
parents:
diff changeset
   118
    // default to initial state if no other state given
hgs
parents:
diff changeset
   119
    int viewType( ViewTypeInitial );
hgs
parents:
diff changeset
   120
        
hgs
parents:
diff changeset
   121
    QVariantMap::const_iterator it = parameters.find(lViewType);
hgs
parents:
diff changeset
   122
    if (it != parameters.end() && !it.value().isNull() && it.value().isValid()) {
hgs
parents:
diff changeset
   123
        bool ok(false);
hgs
parents:
diff changeset
   124
        viewType = it.value().toInt(&ok);
hgs
parents:
diff changeset
   125
        if ( !ok ) {
hgs
parents:
diff changeset
   126
            qWarning() << "SnsrDeviceDialog::setDeviceDialogParameters() - int cast failed";
hgs
parents:
diff changeset
   127
            return false;
hgs
parents:
diff changeset
   128
        }
hgs
parents:
diff changeset
   129
    }
hgs
parents:
diff changeset
   130
        
hgs
parents:
diff changeset
   131
    // Check initial view from repository
hgs
parents:
diff changeset
   132
    if (viewType == ViewTypeInitial ) {
69
hgs
parents: 62
diff changeset
   133
        XQSettingsManager::Error error;
62
hgs
parents:
diff changeset
   134
        int startupView = 0; 
69
hgs
parents: 62
diff changeset
   135
        XQCentralRepositorySettingsKey settingsKey(
62
hgs
parents:
diff changeset
   136
                 KCRUidScreensaverSettings.iUid, KScreensaverStartupView ); // TUid as same repository used in control panel via Symbian APIs 
hgs
parents:
diff changeset
   137
        m_setManager = new XQSettingsManager(this);
69
hgs
parents: 62
diff changeset
   138
        if (m_setManager) {
hgs
parents: 62
diff changeset
   139
            startupView = m_setManager->readItemValue(settingsKey, XQSettingsManager::TypeInt).toInt();
62
hgs
parents:
diff changeset
   140
            error = m_setManager->error();
69
hgs
parents: 62
diff changeset
   141
            if (error == XQSettingsManager::NoError) {
62
hgs
parents:
diff changeset
   142
                viewType = startupView;
69
hgs
parents: 62
diff changeset
   143
            }
62
hgs
parents:
diff changeset
   144
            delete m_setManager;
69
hgs
parents: 62
diff changeset
   145
        }
62
hgs
parents:
diff changeset
   146
    }
hgs
parents:
diff changeset
   147
hgs
parents:
diff changeset
   148
    switch (viewType) {
hgs
parents:
diff changeset
   149
    case SnsrDeviceDialog::ViewTypeActive:
hgs
parents:
diff changeset
   150
        mScreensaver->foreground();
hgs
parents:
diff changeset
   151
        return true;
hgs
parents:
diff changeset
   152
    case SnsrDeviceDialog::ViewTypeStandby:
hgs
parents:
diff changeset
   153
        mScreensaver->partialForeground();
hgs
parents:
diff changeset
   154
        return true;
hgs
parents:
diff changeset
   155
    default:
hgs
parents:
diff changeset
   156
        qWarning() << QString("SnsrDeviceDialog::setDeviceDialogParameters() "
hgs
parents:
diff changeset
   157
          "- unspecefied view type: %1").arg(viewType);
hgs
parents:
diff changeset
   158
    }
hgs
parents:
diff changeset
   159
    
hgs
parents:
diff changeset
   160
    return false;
hgs
parents:
diff changeset
   161
}
hgs
parents:
diff changeset
   162
hgs
parents:
diff changeset
   163
/*!
hgs
parents:
diff changeset
   164
    Returns error code.
hgs
parents:
diff changeset
   165
    \ret error code.
hgs
parents:
diff changeset
   166
 */
hgs
parents:
diff changeset
   167
int SnsrDeviceDialog::deviceDialogError() const
hgs
parents:
diff changeset
   168
{
hgs
parents:
diff changeset
   169
    return 0;
hgs
parents:
diff changeset
   170
}
hgs
parents:
diff changeset
   171
hgs
parents:
diff changeset
   172
/*!
hgs
parents:
diff changeset
   173
    Closes device dialog.
hgs
parents:
diff changeset
   174
    \param byClient If dialog is close by client.
hgs
parents:
diff changeset
   175
 */
hgs
parents:
diff changeset
   176
void SnsrDeviceDialog::closeDeviceDialog(bool byClient)
hgs
parents:
diff changeset
   177
{
hgs
parents:
diff changeset
   178
    qDebug("SnsrDeviceDialog::closeDeviceDialog()");
hgs
parents:
diff changeset
   179
    Q_UNUSED(byClient)
hgs
parents:
diff changeset
   180
    hide();
hgs
parents:
diff changeset
   181
    emit deviceDialogClosed();
hgs
parents:
diff changeset
   182
}
hgs
parents:
diff changeset
   183
hgs
parents:
diff changeset
   184
/*!
hgs
parents:
diff changeset
   185
    Returns device dialog instance.
hgs
parents:
diff changeset
   186
    \ret Device dialog instance.
hgs
parents:
diff changeset
   187
 */
hgs
parents:
diff changeset
   188
HbPopup *SnsrDeviceDialog::deviceDialogWidget() const
hgs
parents:
diff changeset
   189
{
hgs
parents:
diff changeset
   190
    return const_cast<SnsrDeviceDialog*>(this);
hgs
parents:
diff changeset
   191
}
hgs
parents:
diff changeset
   192
hgs
parents:
diff changeset
   193
/*!
hgs
parents:
diff changeset
   194
    Shows widget.
hgs
parents:
diff changeset
   195
    \param event.
hgs
parents:
diff changeset
   196
 */
hgs
parents:
diff changeset
   197
void SnsrDeviceDialog::showEvent(QShowEvent *event)
hgs
parents:
diff changeset
   198
{
hgs
parents:
diff changeset
   199
    qDebug("SnsrDeviceDialog::showEvent()");
hgs
parents:
diff changeset
   200
hgs
parents:
diff changeset
   201
    HbPopup::showEvent(event);
hgs
parents:
diff changeset
   202
    
hgs
parents:
diff changeset
   203
    // workaround for duplicating connections and emiting two signals
hgs
parents:
diff changeset
   204
    // showEvent is called for HbDeviceDialogManager showDeviceDialog()
hgs
parents:
diff changeset
   205
    // and for HbPopup itemChange(), both events are set to QEvent::Show type
hgs
parents:
diff changeset
   206
    disconnect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
hgs
parents:
diff changeset
   207
        this, SLOT(changeLayout(Qt::Orientation)));
hgs
parents:
diff changeset
   208
    connect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
hgs
parents:
diff changeset
   209
        this, SLOT(changeLayout(Qt::Orientation)));
hgs
parents:
diff changeset
   210
hgs
parents:
diff changeset
   211
    changeLayout(mainWindow()->orientation());
hgs
parents:
diff changeset
   212
}
hgs
parents:
diff changeset
   213
hgs
parents:
diff changeset
   214
#ifdef COVERAGE_MEASUREMENT
hgs
parents:
diff changeset
   215
#pragma CTC SKIP
hgs
parents:
diff changeset
   216
#endif //COVERAGE_MEASUREMENT
hgs
parents:
diff changeset
   217
hgs
parents:
diff changeset
   218
/*!
hgs
parents:
diff changeset
   219
    Hides widget.
hgs
parents:
diff changeset
   220
    \param event.
hgs
parents:
diff changeset
   221
 */
hgs
parents:
diff changeset
   222
void SnsrDeviceDialog::hideEvent(QHideEvent *event)
hgs
parents:
diff changeset
   223
{
hgs
parents:
diff changeset
   224
    qDebug("SnsrDeviceDialog::hideEvent()");
hgs
parents:
diff changeset
   225
hgs
parents:
diff changeset
   226
    HbPopup::hideEvent(event);
hgs
parents:
diff changeset
   227
    mScreensaver->background();
hgs
parents:
diff changeset
   228
}
hgs
parents:
diff changeset
   229
hgs
parents:
diff changeset
   230
#ifdef COVERAGE_MEASUREMENT
hgs
parents:
diff changeset
   231
#pragma CTC ENDSKIP
hgs
parents:
diff changeset
   232
#endif //COVERAGE_MEASUREMENT
hgs
parents:
diff changeset
   233
hgs
parents:
diff changeset
   234
/*!
hgs
parents:
diff changeset
   235
    Close widget.
hgs
parents:
diff changeset
   236
    \param event.
hgs
parents:
diff changeset
   237
 */
hgs
parents:
diff changeset
   238
void SnsrDeviceDialog::closeEvent(QCloseEvent *event)
hgs
parents:
diff changeset
   239
{
hgs
parents:
diff changeset
   240
    qDebug("SnsrDeviceDialog::closeEvent()");
hgs
parents:
diff changeset
   241
hgs
parents:
diff changeset
   242
    HbPopup::closeEvent(event);
hgs
parents:
diff changeset
   243
hgs
parents:
diff changeset
   244
    disconnect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), 
hgs
parents:
diff changeset
   245
        this, SLOT(changeLayout(Qt::Orientation)));
hgs
parents:
diff changeset
   246
    mScreensaver->close();
hgs
parents:
diff changeset
   247
}
hgs
parents:
diff changeset
   248
hgs
parents:
diff changeset
   249
/*!
hgs
parents:
diff changeset
   250
    Replaces layout's item.
hgs
parents:
diff changeset
   251
    \param widget New item to be added to layout.
hgs
parents:
diff changeset
   252
 */
hgs
parents:
diff changeset
   253
void SnsrDeviceDialog::changeView(QGraphicsWidget *widget)
hgs
parents:
diff changeset
   254
{
hgs
parents:
diff changeset
   255
    qDebug("SnsrDeviceDialog::changeView() - widget: 0x%X", (int)widget);
hgs
parents:
diff changeset
   256
    if (!mLayout) {
hgs
parents:
diff changeset
   257
        mLayout = new QGraphicsLinearLayout(Qt::Vertical);
hgs
parents:
diff changeset
   258
        mLayout->setContentsMargins(0,0,0,0);
hgs
parents:
diff changeset
   259
        setLayout(mLayout);
hgs
parents:
diff changeset
   260
    }
hgs
parents:
diff changeset
   261
    
hgs
parents:
diff changeset
   262
    if (mLayout->count()) {
hgs
parents:
diff changeset
   263
        mLayout->removeAt(0);
69
hgs
parents: 62
diff changeset
   264
    }
62
hgs
parents:
diff changeset
   265
    if (widget) {
hgs
parents:
diff changeset
   266
        widget->show();
hgs
parents:
diff changeset
   267
        mLayout->addItem(widget);
69
hgs
parents: 62
diff changeset
   268
hgs
parents: 62
diff changeset
   269
        if ( isVisible() ) {
hgs
parents: 62
diff changeset
   270
           changeLayout( mainWindow()->orientation() );
hgs
parents: 62
diff changeset
   271
        }
62
hgs
parents:
diff changeset
   272
    }
69
hgs
parents: 62
diff changeset
   273
    
hgs
parents: 62
diff changeset
   274
62
hgs
parents:
diff changeset
   275
}
hgs
parents:
diff changeset
   276
hgs
parents:
diff changeset
   277
/*!
hgs
parents:
diff changeset
   278
    Handles faults in loaded screensaver model.
hgs
parents:
diff changeset
   279
 */
hgs
parents:
diff changeset
   280
void SnsrDeviceDialog::screensaverFaulted()
hgs
parents:
diff changeset
   281
{
hgs
parents:
diff changeset
   282
    qWarning() << "SnsrDeviceDialog::screensaverFaulted()";
hgs
parents:
diff changeset
   283
    // TODO: some error handling
hgs
parents:
diff changeset
   284
}
hgs
parents:
diff changeset
   285
hgs
parents:
diff changeset
   286
/*!
hgs
parents:
diff changeset
   287
    Resize device dialog.
hgs
parents:
diff changeset
   288
    \param orientation New orientation value.
hgs
parents:
diff changeset
   289
 */
hgs
parents:
diff changeset
   290
void SnsrDeviceDialog::changeLayout(Qt::Orientation orientation)
hgs
parents:
diff changeset
   291
{
hgs
parents:
diff changeset
   292
    Q_UNUSED(orientation)
hgs
parents:
diff changeset
   293
    
hgs
parents:
diff changeset
   294
    QRectF rect = mainWindow()->layoutRect();
hgs
parents:
diff changeset
   295
    setMinimumSize( rect.size() );
hgs
parents:
diff changeset
   296
    setPreferredPos( QPointF(0,0) );
69
hgs
parents: 62
diff changeset
   297
    QGraphicsSceneResizeEvent sceneResize;
hgs
parents: 62
diff changeset
   298
    sceneResize.setNewSize( rect.size() );
hgs
parents: 62
diff changeset
   299
    event( &sceneResize );
hgs
parents: 62
diff changeset
   300
    mScreensaver->updateLayout();
62
hgs
parents:
diff changeset
   301
}
hgs
parents:
diff changeset
   302
hgs
parents:
diff changeset
   303
/*!
hgs
parents:
diff changeset
   304
    Send unlock signal to autolock.
hgs
parents:
diff changeset
   305
 */
hgs
parents:
diff changeset
   306
void SnsrDeviceDialog::requestUnlock()
hgs
parents:
diff changeset
   307
{
hgs
parents:
diff changeset
   308
    QVariantMap data;
hgs
parents:
diff changeset
   309
    data.insert(dataKeyUnlock, 1);
hgs
parents:
diff changeset
   310
    emit deviceDialogData(data);
hgs
parents:
diff changeset
   311
}
69
hgs
parents: 62
diff changeset
   312
hgs
parents: 62
diff changeset
   313
/*!
hgs
parents: 62
diff changeset
   314
    Send low power mode on/off request to autolock.
hgs
parents: 62
diff changeset
   315
 */
hgs
parents: 62
diff changeset
   316
void SnsrDeviceDialog::requestScreenMode(Screensaver::ScreenPowerMode mode)
hgs
parents: 62
diff changeset
   317
{
hgs
parents: 62
diff changeset
   318
    QVariantMap data;
hgs
parents: 62
diff changeset
   319
    QVariantList rowLimits;
hgs
parents: 62
diff changeset
   320
    if ( mode == Screensaver::ScreenModeOff ) {
hgs
parents: 62
diff changeset
   321
        data.insert(dataKeySwitchLights, 0);
hgs
parents: 62
diff changeset
   322
        data.insert(dataKeySwitchLowPower, rowLimits); // empty list means "low power off"
hgs
parents: 62
diff changeset
   323
    }
hgs
parents: 62
diff changeset
   324
    else if ( mode == Screensaver::ScreenModeLowPower ) {
hgs
parents: 62
diff changeset
   325
        //data.insert(dataKeySwitchLights, 0);
hgs
parents: 62
diff changeset
   326
        int firstRow;
hgs
parents: 62
diff changeset
   327
        int lastRow;
hgs
parents: 62
diff changeset
   328
        mScreensaver->getActiveScreenRows(&firstRow, &lastRow);
hgs
parents: 62
diff changeset
   329
        rowLimits.append( firstRow );
hgs
parents: 62
diff changeset
   330
        rowLimits.append( lastRow );
hgs
parents: 62
diff changeset
   331
        data.insert(dataKeySwitchLowPower, rowLimits);
hgs
parents: 62
diff changeset
   332
    }
hgs
parents: 62
diff changeset
   333
    else if ( mode == Screensaver::ScreenModeFullPower ) {
hgs
parents: 62
diff changeset
   334
        data.insert(dataKeySwitchLights, 30);
hgs
parents: 62
diff changeset
   335
        data.insert(dataKeySwitchLowPower, rowLimits); // empty list means "low power off"
hgs
parents: 62
diff changeset
   336
    }
hgs
parents: 62
diff changeset
   337
    
hgs
parents: 62
diff changeset
   338
    emit deviceDialogData(data);
hgs
parents: 62
diff changeset
   339
}
hgs
parents: 62
diff changeset
   340
62
hgs
parents:
diff changeset
   341
/*!
hgs
parents:
diff changeset
   342
    Called when the dialog is created if they are any currently
hgs
parents:
diff changeset
   343
    activate universal indicators present.
hgs
parents:
diff changeset
   344
 */
hgs
parents:
diff changeset
   345
void SnsrDeviceDialog::indicatorsActivated(
hgs
parents:
diff changeset
   346
        const QList<HbIndicatorInterface*> &activatedIndicators)
hgs
parents:
diff changeset
   347
{
hgs
parents:
diff changeset
   348
    mScreensaver->handleActiveIndicators(activatedIndicators);
hgs
parents:
diff changeset
   349
}
hgs
parents:
diff changeset
   350
hgs
parents:
diff changeset
   351
/*!
hgs
parents:
diff changeset
   352
    Called when some universal indicator is activated.
hgs
parents:
diff changeset
   353
    Ownership of activatedIndicator is not transferred.
hgs
parents:
diff changeset
   354
 */
hgs
parents:
diff changeset
   355
void SnsrDeviceDialog::indicatorActivated(
hgs
parents:
diff changeset
   356
        HbIndicatorInterface *activatedIndicator)
hgs
parents:
diff changeset
   357
{
hgs
parents:
diff changeset
   358
    mScreensaver->handleActivatedIndicator(activatedIndicator);
hgs
parents:
diff changeset
   359
}
hgs
parents:
diff changeset
   360
hgs
parents:
diff changeset
   361
/*!
hgs
parents:
diff changeset
   362
    Called when some universal indicator is deactivated.
hgs
parents:
diff changeset
   363
 */
hgs
parents:
diff changeset
   364
void SnsrDeviceDialog::indicatorRemoved(
hgs
parents:
diff changeset
   365
        HbIndicatorInterface *indicatorRemoved)
hgs
parents:
diff changeset
   366
{
hgs
parents:
diff changeset
   367
    mScreensaver->handleDeactivatedIndicator(indicatorRemoved);
hgs
parents:
diff changeset
   368
}
hgs
parents:
diff changeset
   369
hgs
parents:
diff changeset
   370
// end of file
hgs
parents:
diff changeset
   371