mulwidgets/alfviewwidget/inc/alfviewwidgetexception.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007 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:  View widget exception class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFVIEWWIDGETEXCEPTION_H
       
    20 #define ALFVIEWWIDGETEXCEPTION_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <alf/alfexception.h>
       
    24 #include <osn/ustring.h>
       
    25 
       
    26 namespace Alf
       
    27     {
       
    28 
       
    29 /**
       
    30  * Error codes used with AlfViewWidgetException.
       
    31  *
       
    32  * There is an offset in AlfViewWidgetException error codes, so that
       
    33  * AlfViewWidget specific exceptions can be separated from
       
    34  * osncore::AlfException base exceptions and exceptions of other widgets.
       
    35  */
       
    36 enum TAlfViewWidgetErrorCode
       
    37     {
       
    38     /**
       
    39      * Error occured in construction or initialization of the view
       
    40      * widget.
       
    41      */
       
    42     EInitializationError = 600,
       
    43 
       
    44     /**
       
    45      * Handle to status pane not found
       
    46      */
       
    47     EStatusPaneError,
       
    48 
       
    49     /**
       
    50      * Handle to control pane not found
       
    51      */
       
    52     EControlPaneError,
       
    53     
       
    54     /**
       
    55      * Control group id specified in the viewwidget constructor
       
    56      * already reserved.
       
    57      */
       
    58     EControlGroupAlreadyExists
       
    59     };
       
    60 
       
    61 /**
       
    62  * AlfViewWidgetException is a base class for all view widget
       
    63  * exceptions.
       
    64  *
       
    65  */
       
    66 class AlfViewWidgetException : public osncore::AlfException
       
    67     {
       
    68 public:
       
    69     // Constructors and destructor
       
    70 
       
    71     /**
       
    72      * Constructor with AlfViewWidget specific error code.
       
    73      *
       
    74      * Error code has to be one of the error codes specified in
       
    75      * Alf::TAlfViewWidgetErrorCode or a system-wide error code
       
    76      * represented by negative integer.
       
    77      *
       
    78      * @see osncore::AlfException::errorCode()
       
    79      *
       
    80      * @param aError Error code to describe the occured exception.
       
    81      */
       
    82     AlfViewWidgetException(int aError) throw();
       
    83 
       
    84     /**
       
    85      * Constructor with AlfViewWidget specific error code
       
    86      * and additional information.
       
    87      *
       
    88      * Error code has to be one of the error codes specified in
       
    89      * Alf::TAlfViewWidgetErrorCode or a system-wide error code
       
    90      * represented by negative integer.
       
    91      *
       
    92      * @see osncore::AlfException::errorCode()
       
    93      *
       
    94      * @param aError Error code to describe the occured exception.
       
    95      * @param aInfo Optional additional information or NULL.
       
    96         */
       
    97     AlfViewWidgetException(int aError, const char* aInfo) throw();
       
    98 
       
    99     /**
       
   100      * Constructor with AlfViewWidget specific error code,
       
   101      * additional information, source file and line of code.
       
   102      *
       
   103      * Error code has to be one of the error codes specified in
       
   104      * Alf::TAlfViewWidgetErrorCode or a system-wide error code
       
   105      * represented by negative integer.
       
   106      *
       
   107      * @see osncore::AlfException::errorCode()
       
   108      *
       
   109      * @param aError Error code to describe the occured exception.
       
   110      * @param aInfo Optional additional information or NULL.
       
   111         * @param aFileAndLine Optional file and line information or NULL.
       
   112         */
       
   113     AlfViewWidgetException(int aError, const char* aInfo, const char* aFileAndLine) throw();
       
   114 
       
   115     /**
       
   116      * Default destructor.
       
   117      */
       
   118     virtual ~AlfViewWidgetException() throw();
       
   119 
       
   120     /**
       
   121      * Returns the description of the exception.
       
   122      * @ret The description of the exception.
       
   123      */
       
   124     const char* what() const throw();
       
   125 
       
   126 private:
       
   127 
       
   128     /**
       
   129      * Error description
       
   130      */
       
   131     osncore::UString mDescription;
       
   132 
       
   133     };
       
   134 
       
   135     } // Namespace Alf
       
   136 
       
   137 #endif // ALFVIEWWIDGETEXCEPTION_H