camerauis/cameraxui/cxui/inc/cxuierrormanager.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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 HbAction;
       
    24 class HbDialog;
       
    25 class CxuiDocumentLoader;
       
    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(CxuiDocumentLoader *documentLoader);
       
    38     ~CxuiErrorManager();
       
    39 
       
    40 signals:
       
    41 
       
    42     void errorPopupShown();
       
    43     void errorPopupClosed();
       
    44 
       
    45 public slots:
       
    46 
       
    47     void check(CxeError::Id error);
       
    48     void clear();
       
    49 
       
    50 private slots:
       
    51     void popupClosed(HbAction *action);
       
    52     void closeApp();
       
    53 
       
    54 private:
       
    55 
       
    56     // error severity
       
    57     enum ErrorSeverity
       
    58     {
       
    59         None = 0,
       
    60         Warning,
       
    61         Error
       
    62     };
       
    63 
       
    64     void launchPopup(const QString &errorText, const QString &buttonText);
       
    65     void showErrorPopup(const QString &errorText, const QString &buttonText);
       
    66     void showWarningPopup(const QString &errorText);
       
    67     void getErrorDetails(QString &errorText, QString &buttonText);
       
    68 
       
    69 private:
       
    70 
       
    71     //data
       
    72     CxuiDocumentLoader *mDocumentLoader; // not own
       
    73     HbDialog* mErrorMsgPopup;
       
    74     CxeError::Id mErrorId;
       
    75     CxuiErrorManager::ErrorSeverity mErrorSeverity;
       
    76 };
       
    77 
       
    78 #endif // CXUIVIEWMANAGER_H