camerauis/cameraxui/cxui/inc/cxuierrormanager.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 CXUIERRORMANAGER_H
       
    18 #define CXUIERRORMANAGER_H
       
    19 
       
    20 #include <QObject>
       
    21 #include "cxeerror.h"
       
    22 
       
    23 class HbDialog;
       
    24 class CxuiDocumentLoader;
       
    25 class CxuiCaptureKeyHandler;
       
    26 
       
    27 
       
    28 /*
       
    29 * class which handles errors and reports 
       
    30 */
       
    31 class CxuiErrorManager : public QObject
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36 
       
    37     CxuiErrorManager(CxuiCaptureKeyHandler &keyHandler,CxuiDocumentLoader *documentLoader);
       
    38     ~CxuiErrorManager();
       
    39 
       
    40 signals:
       
    41     
       
    42     void aboutToRecoverError();
       
    43     void errorRecovered();
       
    44     
       
    45 private slots:
       
    46 
       
    47     /*
       
    48 	* slot which handles reporting of errors to the client
       
    49 	*/
       
    50     void analyze(CxeError::Id error);
       
    51 
       
    52     /*
       
    53      * slot which handles cases to be considered when we are about to close
       
    54      * the pop-up
       
    55      */
       
    56     void aboutToClosePopup();
       
    57     
       
    58     /*
       
    59      * slot to close camera app
       
    60      */
       
    61     void closeApp();
       
    62 
       
    63 private:
       
    64 
       
    65     // error severity
       
    66     enum ErrorSeverity
       
    67     {
       
    68         Severe     = 0x01, // when error cannot be recovered
       
    69         Critical   = 0x02, // when error can be recovered, but needs actions e.g. camera in use
       
    70         None       = 0x08, // we can ignore the error
       
    71     };
       
    72 
       
    73     /*
       
    74      * Activates popup which displays the error messages based on the
       
    75      * error severity
       
    76      */
       
    77     void launchPopup(QString& errorMsgTxt);
       
    78     
       
    79     /*
       
    80      *  check the error severity and get the error msg
       
    81      */
       
    82     QString getErrorDetails(CxeError::Id error);
       
    83 
       
    84 private:
       
    85     //data
       
    86     CxuiCaptureKeyHandler &mKeyHandler;
       
    87     CxuiDocumentLoader *mDocumentLoader; // not own
       
    88     HbDialog* mErrorMsgPopup;
       
    89     CxuiErrorManager::ErrorSeverity mErrorSeverity;
       
    90 };
       
    91 
       
    92 #endif // CXUIVIEWMANAGER_H