1.1 --- a/epoc32/include/mw/errorui.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/errorui.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,128 @@
1.4 -errorui.h
1.5 +/*
1.6 +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#if !defined ERROR_UI_H
1.24 +#define ERROR_UI_H
1.25 +
1.26 +#include <coemain.h> // CCoeEnv
1.27 +#include <textresolver.h>
1.28 +
1.29 +/**
1.30 +* Utility class to display error notes by applications.
1.31 +* This is the default error display class to be used by
1.32 +* applications.
1.33 +* The features of the class are:
1.34 +* - maps given error to error text to be displayed
1.35 +* - displays error note using timed, global note
1.36 +* - does not display error if it is already "on"
1.37 +* - offers a reference to internal TextResolver instance
1.38 +*
1.39 +* Usage (typically as instance variable)
1.40 +* iErrorUI = CErrorUI::NewL(); // iCoeEnv can be given as argument, no need to that though
1.41 +* ... some code causing an error ...
1.42 +* if ( err != KErrNone )
1.43 +* iErrorUI->ShowGlobalErrorNoteL(err);
1.44 +*
1.45 +*/
1.46 +
1.47 +class CErrorUI : public CBase
1.48 +{
1.49 +public:
1.50 +
1.51 +public:
1.52 +
1.53 + /**
1.54 + * This constructor method should be used by servers, does not put the created object into CleanupStack
1.55 + */
1.56 + IMPORT_C static CErrorUI* NewL();
1.57 +
1.58 + /**
1.59 + * This constructor method should be used by servers, puts the created object into CleanupStack
1.60 + */
1.61 + IMPORT_C static CErrorUI* NewLC();
1.62 +
1.63 + /**
1.64 + * This constructor method should be used by applications, does not put the created object into CleanupStack
1.65 + * @param aEnv Reference to caller's control environment
1.66 + */
1.67 + IMPORT_C static CErrorUI* NewL(CCoeEnv& aEnv);
1.68 +
1.69 + /**
1.70 + * This constructor method should be used by applications, puts the created object into CleanupStack
1.71 + * @param aEnv Reference to caller's control environment
1.72 + */
1.73 + IMPORT_C static CErrorUI* NewLC(CCoeEnv& aEnv);
1.74 +
1.75 +
1.76 + /**
1.77 + * Destructor
1.78 + */
1.79 + IMPORT_C ~CErrorUI();
1.80 +
1.81 + /**
1.82 + * Shows a global error note which is created by
1.83 + * resolving to a display text from the given error code.
1.84 + * The is the default method to be called by applications to
1.85 + * display error messages.
1.86 + * @param aError Any error code, for example ETel error or Email
1.87 + * error.
1.88 + * @param aContext The context of the error, needed in special cases
1.89 + * such as WAP errors, usually (and by default) ECtxAutomatic
1.90 + * @return ETrue if error was displayed, EFalse otherwise.
1.91 + */
1.92 + IMPORT_C TBool ShowGlobalErrorNoteL(
1.93 + TInt aError,
1.94 + CTextResolver::TErrorContext aContext = CTextResolver::ECtxAutomatic
1.95 + );
1.96 +
1.97 + /**
1.98 + * Offers a reference to internal TextResolver instance
1.99 + * @return reference to ErrorUI's internal TextResolver instance
1.100 + */
1.101 + inline CTextResolver& TextResolver(){ return *iTextResolver; }
1.102 +
1.103 + /**
1.104 + * Shows a global error query with OK key, which is created by
1.105 + * resolving to a display text from the given error code.
1.106 + * The is the default method to be called by applications to
1.107 + * display error queries.
1.108 + * @param aError Any error code, for example ETel error or Email
1.109 + * error.
1.110 + * @param aContext The context of the error, needed in special cases
1.111 + * such as WAP errors, usually (and by default) ECtxAutomatic
1.112 + * @return ETrue if error was displayed, EFalse otherwise.
1.113 + */
1.114 + IMPORT_C TBool ShowGlobalErrorQueryL(
1.115 + TInt aError,
1.116 + CTextResolver::TErrorContext aContext = CTextResolver::ECtxAutomatic
1.117 + );
1.118 +
1.119 +private:
1.120 +
1.121 + void ConstructL();
1.122 + static CErrorUI* ConstructLC();
1.123 +
1.124 +private:
1.125 +
1.126 + // Text resolver used by this module
1.127 + CTextResolver* iTextResolver;
1.128 +};
1.129 +
1.130 +#endif // ERROR_UI_H
1.131 +
1.132 +// End of File