screensaver/devicedialogplugins/snsrdevicedialogplugin/inc/snsrdevicedialog.h
changeset 62 341166945d65
child 69 87476091b3f5
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
       
     1 /*
       
     2 * Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Default Screensaver runtime.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SNSRDEVICEDIALOG_H
       
    19 #define SNSRDEVICEDIALOG_H
       
    20 
       
    21 #include <HbPopup>
       
    22 #include <HbDeviceDialogInterface>
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 #include "snsrtest_global.h"
       
    28 
       
    29 class Screensaver;
       
    30 class SnsrUserActivityServiceInterface;
       
    31 class QGraphicsLinearLayout;
       
    32 class XQSettingsManager;
       
    33 
       
    34 SCREENSAVER_TEST_CLASS(T_SnsrDeviceDialogPlugin)
       
    35 
       
    36 class HbIndicatorInterface;
       
    37 
       
    38 
       
    39 class SnsrDeviceDialog: public HbPopup, public HbDeviceDialogInterface
       
    40 {
       
    41 
       
    42 Q_OBJECT
       
    43 
       
    44 public: // constants
       
    45     enum DisplayType {
       
    46         DisplayTypeRegular = 0,
       
    47         DisplayTypeOled,
       
    48         DisplayTypeRegularAndOled
       
    49     };
       
    50     
       
    51     enum ViewType {
       
    52         ViewTypeInitial = 0, // default initial state, depends on the configuration
       
    53         ViewTypeActive,
       
    54         ViewTypeStandby
       
    55     };
       
    56     
       
    57     static const char *dataKeyUnlock;
       
    58 
       
    59 public: // methods
       
    60 
       
    61     SnsrDeviceDialog(const QVariantMap &parameters, QGraphicsItem *parent = 0);
       
    62     ~SnsrDeviceDialog();
       
    63 
       
    64     virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    65     virtual int deviceDialogError() const;
       
    66     virtual void closeDeviceDialog(bool byClient);
       
    67     virtual HbPopup *deviceDialogWidget() const;
       
    68 
       
    69 signals:
       
    70 
       
    71     void deviceDialogClosed();
       
    72     void deviceDialogData(QVariantMap);
       
    73 
       
    74 private slots:
       
    75 
       
    76     void changeView(QGraphicsWidget *widget);
       
    77     void screensaverFaulted();
       
    78     void changeLayout(Qt::Orientation);
       
    79     void requestUnlock();
       
    80     // slots for signals emitted by HbIndicatorPluginManager
       
    81     void indicatorsActivated(const QList<HbIndicatorInterface*> &activatedIndicators);
       
    82     void indicatorActivated(HbIndicatorInterface *activatedIndicator);
       
    83     void indicatorRemoved(HbIndicatorInterface *indicatorRemoved);
       
    84 
       
    85 private:
       
    86 
       
    87     void showEvent(QShowEvent *event);
       
    88     void hideEvent(QHideEvent *event);
       
    89     void closeEvent(QCloseEvent *event);
       
    90 
       
    91 private:
       
    92 
       
    93     Screensaver *mScreensaver;
       
    94     QGraphicsLinearLayout *mLayout;
       
    95     XQSettingsManager *m_setManager;
       
    96     
       
    97     SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrDeviceDialogPlugin)
       
    98 };
       
    99 
       
   100 #endif // SNSRDEVICEDIALOG_H