camerauis/cameraxui/cxui/inc/cxuierrormanager.h
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
    18 #define CXUIERRORMANAGER_H
    18 #define CXUIERRORMANAGER_H
    19 
    19 
    20 #include <QObject>
    20 #include <QObject>
    21 #include "cxeerror.h"
    21 #include "cxeerror.h"
    22 
    22 
       
    23 class HbAction;
    23 class HbDialog;
    24 class HbDialog;
    24 class CxuiDocumentLoader;
    25 class CxuiDocumentLoader;
    25 class CxuiCaptureKeyHandler;
       
    26 
    26 
    27 
    27 
    28 /*
    28 /*
    29 * class which handles errors and reports
    29 * class which handles errors and reports
    30 */
    30 */
    32 {
    32 {
    33     Q_OBJECT
    33     Q_OBJECT
    34 
    34 
    35 public:
    35 public:
    36 
    36 
    37     CxuiErrorManager(CxuiCaptureKeyHandler &keyHandler,CxuiDocumentLoader *documentLoader);
    37     CxuiErrorManager(CxuiDocumentLoader *documentLoader);
    38     ~CxuiErrorManager();
    38     ~CxuiErrorManager();
    39 
    39 
    40 signals:
    40 signals:
    41 
    41 
    42     void aboutToRecoverError();
    42     void errorPopupShown();
    43     void errorRecovered();
    43     void errorPopupClosed();
       
    44 
       
    45 public slots:
       
    46 
       
    47     void check(CxeError::Id error);
       
    48     void clear();
    44 
    49 
    45 private slots:
    50 private slots:
    46 
    51     void popupClosed(HbAction *action);
    47     void analyze(CxeError::Id error);
       
    48     void aboutToClosePopup();
       
    49     void closeApp();
    52     void closeApp();
    50 
    53 
    51 private:
    54 private:
    52 
    55 
    53     // error severity
    56     // error severity
    54     enum ErrorSeverity
    57     enum ErrorSeverity
    55     {
    58     {
    56         None = 0,
    59         None = 0,
    57         Warning, // Low severity, just warning user needed
    60         Warning,
    58         Severe, // when error cannot be recovered
    61         Error
    59         Critical // when error can be recovered, but needs actions e.g. camera in use
       
    60     };
    62     };
    61 
    63 
    62     void launchPopup(QString& errorMsgTxt);
    64     void launchPopup(const QString &errorText, const QString &buttonText);
    63     void showHighSeverityNote(QString& errorMsgTxt);
    65     void showErrorPopup(const QString &errorText, const QString &buttonText);
    64     void showLowSeverityNote(QString& errorMsgTxt);
    66     void showWarningPopup(const QString &errorText);
    65     QString getErrorDetails(CxeError::Id error);
    67     void getErrorDetails(QString &errorText, QString &buttonText);
    66 
    68 
    67 private:
    69 private:
    68 
    70 
    69     //data
    71     //data
    70     CxuiCaptureKeyHandler &mKeyHandler;
       
    71     CxuiDocumentLoader *mDocumentLoader; // not own
    72     CxuiDocumentLoader *mDocumentLoader; // not own
    72     HbDialog* mErrorMsgPopup;
    73     HbDialog* mErrorMsgPopup;
       
    74     CxeError::Id mErrorId;
    73     CxuiErrorManager::ErrorSeverity mErrorSeverity;
    75     CxuiErrorManager::ErrorSeverity mErrorSeverity;
    74 };
    76 };
    75 
    77 
    76 #endif // CXUIVIEWMANAGER_H
    78 #endif // CXUIVIEWMANAGER_H