camerauis/cameraxui/cxui/inc/cxuiselftimer.h
changeset 19 d9aefe59d544
child 21 fa6d9f75d6a6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 #ifndef CXUISELFTIMER_H
       
    18 #define CXUISELFTIMER_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QTimer>
       
    22 
       
    23 class CxeSettings;
       
    24 class CxuiDocumentLoader;
       
    25 class HbLabel;
       
    26 class HbPushButton;
       
    27 class HbWidget;
       
    28 
       
    29 class CxuiSelfTimer : public QObject
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34     explicit CxuiSelfTimer(CxeSettings &mSettings);
       
    35     ~CxuiSelfTimer();
       
    36 
       
    37     void loadSelftimerWidgets(CxuiDocumentLoader *documentLoader);
       
    38     bool isEnabled();
       
    39     bool isOngoing();
       
    40 
       
    41 signals:
       
    42     void timerFinished();
       
    43     void cancelled();
       
    44 
       
    45 public slots:
       
    46     void changeTimeOut(int seconds);
       
    47     void startTimer();
       
    48     void reset();
       
    49     void cancel();
       
    50 
       
    51 protected slots:
       
    52     void timeout();
       
    53 
       
    54 private:
       
    55     void reset(bool update);
       
    56     void updateWidgets();
       
    57     void showWidgets();
       
    58     void hideWidgets();
       
    59 
       
    60 private:
       
    61     Q_DISABLE_COPY(CxuiSelfTimer)
       
    62 
       
    63     int mDelay;
       
    64     int mCounter;
       
    65     QTimer mTimer;
       
    66     int mOldPostCaptureTimeOut;
       
    67 
       
    68     // UI widgets, not own
       
    69     HbWidget *mIndicatorContainer;
       
    70     HbWidget *mButtonContainer;
       
    71     HbLabel *mTimerLabel;
       
    72     HbPushButton *mCancelButton;
       
    73     HbPushButton *mStartButton;
       
    74 
       
    75     // settings, not own
       
    76     CxeSettings &mSettings;
       
    77 
       
    78 };
       
    79 
       
    80 #endif // CXUISELFTIMER_H