wvuing/wvuieng/EngSrc/CCAErrorData.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003-2005 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:  Holds error message information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCAERRORDATA_H
       
    20 #define CCAERRORDATA_H
       
    21 
       
    22 // INCLUDES
       
    23 #include    <e32base.h>
       
    24 
       
    25 #include    "MCAError.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class       CImpsDetailedResult;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  CCAErrorData holds the message information.
       
    34 *
       
    35 *
       
    36 *  @lib CAEngine.lib
       
    37 *  @since 1.2
       
    38 */
       
    39 class CCAErrorData : public CBase,
       
    40             public MCAError
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         * @param aDetailedResults defines the error data that will be copied
       
    47         * to internal data structures.
       
    48         */
       
    49         static CCAErrorData* NewL(
       
    50             const CImpsDetailedResult& aDetailedResult );
       
    51 
       
    52         /**
       
    53         * Two-phased constructor. More wider API for testing purposes.
       
    54         * @param aCode specifies the additional error code.
       
    55         * @param aDescription is the textual description.
       
    56         * @param aUserIDs specifies user ID list.
       
    57         * @param aGroupIds specifies group ID list.
       
    58         * @param aMessageIDs specifies message IDs.
       
    59         * @param aScreenNames specify the used screen names in the
       
    60         * corresponding groups i.e. aScreenNameGroup.
       
    61         * @param aScreeNameGroup specifies the groups for the screen names.
       
    62         * Index 0 in the group array corresponds to the screen name in
       
    63         * screen name array index 0.
       
    64         */
       
    65         static CCAErrorData* NewL(
       
    66             TInt                aCode,
       
    67             const TDesC&        aDescription,
       
    68             const CPtrC16Array* aUserIDs,
       
    69             const CPtrC16Array* aGroupIDs,
       
    70             const CPtrC16Array* aMessageIDs,
       
    71             const CPtrC16Array* aScreenNames,
       
    72             const CPtrC16Array* aScreenNameGroup );
       
    73 
       
    74 
       
    75         /**
       
    76         * Destructor.
       
    77         */
       
    78         virtual ~CCAErrorData();
       
    79 
       
    80     public: // Functions derived from MCAError
       
    81 
       
    82         /**
       
    83         * Returns the error code.
       
    84         * @return Error code.
       
    85         */
       
    86         IMPORT_C TInt Code() const;
       
    87 
       
    88         /**
       
    89         * Textual description from the error.
       
    90         * @return Plain text explanation.
       
    91         */
       
    92         IMPORT_C const TDesC& Description() const;
       
    93 
       
    94         /**
       
    95         * Return user IDs.
       
    96         * @return Array that holds the user IDs.
       
    97         */
       
    98         IMPORT_C const CDesCArray& UserIDs() const;
       
    99 
       
   100         /**
       
   101         * Return group IDs.
       
   102         * @return Array that holds the group IDs.
       
   103         */
       
   104         IMPORT_C const CDesCArray& GroupIDs() const;
       
   105 
       
   106         /**
       
   107         * Return message IDs.
       
   108         * @return Array that holds the message IDs.
       
   109         */
       
   110         IMPORT_C const CDesCArray& MessageIDs() const;
       
   111 
       
   112         /**
       
   113         * Return screen names. The corresponding group is found from
       
   114         * corresponding array index in the ScreenNameGroup().
       
   115         * @return Array that holds the screen names.
       
   116         */
       
   117         IMPORT_C const CDesCArray& ScreenNames() const;
       
   118 
       
   119         /**
       
   120         * Return group IDs.
       
   121         * @return Array that holds the group IDs.
       
   122         */
       
   123         IMPORT_C const CDesCArray& ScreenNameGroup() const;
       
   124 
       
   125 
       
   126     private:
       
   127 
       
   128         /**
       
   129         * By default Symbian OS constructor is private.
       
   130         * @see CCAErrorData::NewL.
       
   131         */
       
   132         void ConstructL( const CImpsDetailedResult& aDetailedResult );
       
   133 
       
   134         /**
       
   135         * By default Symbian OS constructor is private.
       
   136         * @see CCAErrorData::NewL.
       
   137         */
       
   138         void ConstructL(
       
   139             TInt                aCode,
       
   140             const TDesC&        aDescription,
       
   141             const CPtrC16Array* aUserIDs,
       
   142             const CPtrC16Array* aGroupIDs,
       
   143             const CPtrC16Array* aMessageIDs,
       
   144             const CPtrC16Array* aScreenNames,
       
   145             const CPtrC16Array* aScreenNameGroup );
       
   146 
       
   147         /**
       
   148         * C++ default constructor.
       
   149         */
       
   150         CCAErrorData();
       
   151 
       
   152         /**
       
   153         * Sets the error code value.
       
   154         * @param aCode specifies the error code.
       
   155         */
       
   156         void SetCode( TInt aCode  );
       
   157 
       
   158         /**
       
   159         * Sets the error user IDs.
       
   160         * @param aUserIDs specify array of User IDs.
       
   161         */
       
   162         void SetUserIDsL( const CPtrC16Array* aUserIDs );
       
   163 
       
   164         /**
       
   165         * Sets the group IDs.
       
   166         * @param aGroupIDs specify array of group IDs.
       
   167         */
       
   168         void SetGroupIDsL( const CPtrC16Array* aGroupIDs );
       
   169 
       
   170         /**
       
   171         * Sets the message IDs.
       
   172         * @param aMessageIDs specify the array of message IDs.
       
   173         */
       
   174         void SetMessageIDsL( const CPtrC16Array* aMessageIDs );
       
   175 
       
   176         /**
       
   177         * Sets the screen names.
       
   178         * @param aScreenNames specify the array of screen names.
       
   179         */
       
   180         void SetScreenNamesL( const CPtrC16Array* aScreenNames );
       
   181 
       
   182         /**
       
   183         * Sets the screen name groups.
       
   184         * @param aScreenNameGroups specify the groups in a such
       
   185         * way that the corresponding screen name is found from the
       
   186         * screen name array with the corresponding array index.
       
   187         */
       
   188         void SetScreenNamesGroupsL( const CPtrC16Array* aScreenNameGroups );
       
   189 
       
   190     private:    // Data
       
   191 
       
   192         // Specifies the error code
       
   193         TInt iCode;
       
   194 
       
   195         // Owns: Textual description from the error
       
   196         HBufC* iDescription;
       
   197 
       
   198         // Owns: user WV IDs
       
   199         CDesCArrayFlat* iUserIDs;
       
   200 
       
   201         // Owns: group WV IDs
       
   202         CDesCArrayFlat* iGroupIDs;
       
   203 
       
   204         // Owns: Message IDs
       
   205         CDesCArrayFlat* iMsgIDs;
       
   206 
       
   207         // Owns: Screen names
       
   208         CDesCArrayFlat* iScreenNames;
       
   209 
       
   210         // Owns: Screen name in group the corresponding screen name
       
   211         // is found with the same index from the iScreenNames
       
   212         CDesCArrayFlat* iScreenNameGroup;
       
   213 
       
   214     };
       
   215 
       
   216 #endif      // CCAERRORDATA_H     
       
   217 
       
   218 // End of File