javaextensions/pim/javapimloc/src.s60/cpimlocalizationmanager.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2004-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:  A factory for Localization Data objects
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMLOCALIZATIONMANAGER_H
       
    20 #define CPIMLOCALIZATIONMANAGER_H
       
    21 
       
    22 // INTERNAL INCLUDES
       
    23 #include "pimtypes.h"
       
    24 #include "mpimlocalizationmanager.h"
       
    25 
       
    26 // EXTERNAL INCLUDES
       
    27 #include <e32base.h>
       
    28 #include <f32file.h>
       
    29 
       
    30 // Forward declarations
       
    31 class MPIMLocalizationData;
       
    32 class RResourceFile;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36  * A Concrete factory class for MPIMLocalizationData objects
       
    37  */
       
    38 NONSHARABLE_CLASS(CPIMLocalizationManager) : public CBase,
       
    39         public MPIMLocalizationManager
       
    40 {
       
    41 public: // Constructors and a destructor
       
    42 
       
    43     /**
       
    44      * Two-phased constructor.
       
    45      */
       
    46     static CPIMLocalizationManager* NewL();
       
    47 
       
    48     /**
       
    49      * destructor
       
    50      */
       
    51     virtual ~CPIMLocalizationManager();
       
    52 
       
    53 public: // From MPIMLocalizationManager
       
    54 
       
    55     /**
       
    56      * Creates an instance of MPIMLocalizationData.
       
    57      * Caller takes ownership of the returned object.
       
    58      *
       
    59      * @param aType Type of the list, which of data to localize.
       
    60      *              This can be KPIMLocalizationIdContact,
       
    61      *              KPIMLocalizationIdSIM, KPIMLocalizationIdEvent or
       
    62      *              KPIMLocalizationidToDo
       
    63      *
       
    64      * @return MPIMLocalizationData object for the requested list type.
       
    65      * @par Leaving:
       
    66      * The method leaves on error. Error codes should be interpreted as
       
    67      * follows:
       
    68      * @li \c KErrArgument - \a aType is not valid
       
    69      * @li \c KErrNotFound - The resource file cannot be read
       
    70      */
       
    71     MPIMLocalizationData* GetPIMLocalizationDataL(
       
    72         TPIMLocalizationDataID aType);
       
    73 
       
    74     /**
       
    75      * Creates an instance of MPIMLocalizationData.
       
    76      * Caller takes ownership of the returned object.
       
    77      *
       
    78      * @param aType Type of the list, which of data to localize.
       
    79      *              This can be KPIMLocalizationIdContact,
       
    80      *              KPIMLocalizationIdSIM, KPIMLocalizationIdEvent or
       
    81      *              KPIMLocalizationidToDo
       
    82      *
       
    83      * @param aSubType List name identifier. Currently only Event lists
       
    84      *              can have list name identifiers (all other list should
       
    85      *              use zero).
       
    86      *
       
    87      * @return MPIMLocalizationData object for the requested list type.
       
    88      * @par Leaving:
       
    89      * The method leaves on error. Error codes should be interpreted as
       
    90      * follows:
       
    91      * @li \c KErrArgument - \a aType is not valid, or \a aSubType is not
       
    92      * valid for \a aType.
       
    93      * @li \c KErrNotFound - The resource file cannot be read
       
    94      */
       
    95     MPIMLocalizationData* GetPIMLocalizationDataL(
       
    96         TPIMLocalizationDataID aType,
       
    97         TPIMLocalizationDataID aSubType);
       
    98 
       
    99 
       
   100 
       
   101 protected:
       
   102 
       
   103     /**
       
   104      * C++ default constructor.
       
   105      */
       
   106     CPIMLocalizationManager();
       
   107 
       
   108     /**
       
   109      * Symbian 2nd phase constructor
       
   110      */
       
   111     void ConstructL();
       
   112 
       
   113 
       
   114 
       
   115 private:
       
   116 
       
   117     // File system server. Owned
       
   118     RFs iRFs;
       
   119 
       
   120 };
       
   121 
       
   122 
       
   123 
       
   124 #endif // CPIMLOCALIZATIONMANAGER_H
       
   125 
       
   126 // End of file