phonebookengines/VirtualPhonebook/VPbkSimStore/inc/CContactStoreDomain.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Implements the sim store domain
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VPBKSIMSTORE_CCONTACTSTOREDOMAIN_H
       
    21 #define VPBKSIMSTORE_CCONTACTSTOREDOMAIN_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <CVPbkContactStoreDomain.h>
       
    25 #include <f32file.h>
       
    26 
       
    27 class CVPbkContactStoreList;
       
    28 class CVPbkContactOperationFactory;
       
    29 
       
    30 namespace VPbkEngUtils {
       
    31 class CTextStore;
       
    32 }
       
    33     
       
    34 namespace VPbkSimStore {
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CFieldTypeMappings;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Implements the sim store domain
       
    43 *
       
    44 */
       
    45 NONSHARABLE_CLASS( CContactStoreDomain ): 
       
    46         public CVPbkContactStoreDomain
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49         
       
    50         /**
       
    51         * Creates a new instance of this class.
       
    52         *
       
    53         * @param aURIList A list of sim store name URIs.
       
    54         * @param aURIDomain the URI domain name
       
    55         * @param aMasterFieldTypeList the master field type list.
       
    56         * @param aSecurityInfo Security information of client
       
    57         * @return A new instance of this class.
       
    58         */
       
    59         static CContactStoreDomain* NewL
       
    60             ( const CVPbkContactStoreUriArray& aURIList, 
       
    61             const TDesC& aURIDomain,
       
    62             const MVPbkFieldTypeList& aMasterFieldTypeList,
       
    63             const TSecurityInfo& aSecurityInfo );
       
    64 
       
    65         /**
       
    66         * Two-phased constructor. Only for ECom use.
       
    67         * @param aParam   ecom paramater.
       
    68         * @return a new instance of this class
       
    69         */
       
    70         static CContactStoreDomain* NewL(TAny* aParam);
       
    71         
       
    72         /**
       
    73         * Destructor.
       
    74         */
       
    75         virtual ~CContactStoreDomain();
       
    76 
       
    77     public: // New functions
       
    78         
       
    79         /**
       
    80         * Returns the field type mappings vpbk <-> sim
       
    81         * @return the field type mappings vpbk <-> sim
       
    82         */
       
    83         inline CFieldTypeMappings& FieldTypeMappings();
       
    84 
       
    85         /**
       
    86         * @return the master field type list
       
    87         */
       
    88         inline const MVPbkFieldTypeList& MasterFieldTypeList() const;
       
    89         
       
    90         /**
       
    91          * Reference to security information of client
       
    92          * @return Security information of client.
       
    93          */
       
    94         inline const TSecurityInfo& SecurityInformation() const;
       
    95         
       
    96         /**
       
    97          * Returns the file server session.
       
    98          */
       
    99         RFs& FsSession() const;
       
   100 
       
   101     public: // Functions from base classes
       
   102 
       
   103         /**
       
   104          * From CVPbkContactStoreDomain.
       
   105          */
       
   106         const TDesC& UriDomain() const;
       
   107 
       
   108         /**
       
   109          * From CVPbkContactStoreDomain.
       
   110          */
       
   111         void LoadContactStoreL(const TVPbkContactStoreUriPtr& aUri);
       
   112 
       
   113         /**
       
   114          * From MVPbkContactStoreList
       
   115          */
       
   116         TInt Count() const;
       
   117 
       
   118         /**
       
   119          * From MVPbkContactStoreList
       
   120          */
       
   121         MVPbkContactStore& At( TInt aIndex ) const;
       
   122 
       
   123         /**
       
   124          * From MVPbkContactStoreList
       
   125          */
       
   126         MVPbkContactStore* Find(const TVPbkContactStoreUriPtr& aUri) const;
       
   127 
       
   128         /**
       
   129          * From MVPbkContactStoreList
       
   130          */
       
   131         void OpenAllL( MVPbkContactStoreListObserver& aObserver );
       
   132 
       
   133         /**
       
   134          * From MVPbkContactStoreList
       
   135          */
       
   136         void CloseAll( MVPbkContactStoreListObserver& aObserver );
       
   137 
       
   138         /**
       
   139          * From MVPbkContactOperationFactory
       
   140          */
       
   141         MVPbkContactOperation* CreateContactRetrieverL( 
       
   142             const MVPbkContactLink& aLink, 
       
   143             MVPbkSingleContactOperationObserver& aObserver );
       
   144 
       
   145         /**
       
   146          * From MVPbkContactOperationFactory
       
   147          */
       
   148         MVPbkContactOperation* CreateDeleteContactsOperationL(
       
   149             const MVPbkContactLinkArray& aContactLinks, 
       
   150             MVPbkBatchOperationObserver& aObserver );
       
   151 
       
   152         /**
       
   153          * From MVPbkContactOperationFactory
       
   154          */
       
   155         MVPbkContactOperation* CreateCommitContactsOperationL(
       
   156             const TArray<MVPbkStoreContact*>& aContacts,
       
   157             MVPbkBatchOperationObserver& aObserver );
       
   158 
       
   159         /**
       
   160          * From MVPbkContactOperationFactory
       
   161          */
       
   162         MVPbkContactOperation* CreateMatchPhoneNumberOperationL(
       
   163             const TDesC& aPhoneNumber, 
       
   164             TInt aMaxMatchDigits,
       
   165             MVPbkContactFindObserver& aObserver );
       
   166 
       
   167         /**
       
   168         * From MVPbkContactOperationFactory
       
   169         */
       
   170         MVPbkContactOperation* CreateFindOperationL(
       
   171             const TDesC& aSearchString,
       
   172             const MVPbkFieldTypeList& aFieldTypes,
       
   173             MVPbkContactFindObserver& aObserver);
       
   174         
       
   175         /**
       
   176          * From MVPbkContactOperationFactory
       
   177          */
       
   178         MVPbkContactOperation* CreateFindOperationL(
       
   179                 const MDesC16Array& aSearchStrings, 
       
   180                 const MVPbkFieldTypeList& aFieldTypes, 
       
   181                 MVPbkContactFindFromStoresObserver& aObserver, 
       
   182                 const TCallBack& aWordParserCallBack );
       
   183                 
       
   184         /**
       
   185          * From MVPbkContactOperationFactory
       
   186          */
       
   187         MVPbkContactOperation* CreateCompressStoresOperationL(
       
   188         	MVPbkBatchOperationObserver& aObserver);
       
   189         /**
       
   190          * From MVPbkContactOperationFactory2
       
   191          */
       
   192         MVPbkContactOperation* CreateFindOperationL(
       
   193                 const MDesC16Array& aSearchStrings, 
       
   194                 const MVPbkFieldTypeList& aFieldTypes, 
       
   195                 MVPbkContactFindFromStoresObserver& aObserver, 
       
   196                 const TCallBack& aWordParserCallBack,
       
   197                 const CDesC16ArrayFlat& aStoreEntriesArray );
       
   198                 
       
   199          TAny* ContactOperationFactoryExtension( TUid aExtensionUid );
       
   200  
       
   201     private:
       
   202 
       
   203         /**
       
   204         * C++ constructor.
       
   205         */
       
   206         CContactStoreDomain( const MVPbkFieldTypeList& aMasterFieldTypeList, 
       
   207                              const TSecurityInfo& aSecurityInfo );
       
   208 
       
   209         /**
       
   210         * By default Symbian 2nd phase constructor is private.
       
   211         */
       
   212         void ConstructL( const CVPbkContactStoreUriArray& aURIList, 
       
   213                 const TDesC& aURIDomain );
       
   214 
       
   215     private:    // Data
       
   216         ///Own: File server session
       
   217         RFs iFs;
       
   218         ///Own: this domains URI domain name
       
   219         HBufC* iDomainDescriptor;
       
   220         ///Own: VPbk <-> SIM type mappings
       
   221         CFieldTypeMappings* iFieldTypeMappings;
       
   222         ///Own: list of stores in this domain
       
   223         CVPbkContactStoreList* iContactStoreList;
       
   224         ///Own: a factory for creating multioperations
       
   225         CVPbkContactOperationFactory* iOperationFactory;
       
   226         ///Ref: Master field type list
       
   227         const MVPbkFieldTypeList& iMasterFieldTypeList;
       
   228         ///Own: a text store for sharing extension names of X-field types
       
   229         VPbkEngUtils::CTextStore* iTextStore;
       
   230         ///Ref: Security information of client
       
   231         const TSecurityInfo& iSecurityInfo;
       
   232     };
       
   233 
       
   234 // INLINE FUNCTIONS
       
   235 inline CFieldTypeMappings& CContactStoreDomain::FieldTypeMappings()
       
   236     {
       
   237     return *iFieldTypeMappings;
       
   238     }
       
   239 
       
   240 inline const MVPbkFieldTypeList& 
       
   241     CContactStoreDomain::MasterFieldTypeList() const
       
   242     {
       
   243     return iMasterFieldTypeList;
       
   244     }
       
   245     
       
   246 inline const TSecurityInfo& CContactStoreDomain::SecurityInformation() const
       
   247     {
       
   248     return iSecurityInfo;
       
   249     }
       
   250  
       
   251 inline RFs& CContactStoreDomain::FsSession() const
       
   252     {
       
   253     return const_cast<RFs&>(iFs);
       
   254     }
       
   255 
       
   256 }
       
   257 // namespace VPbkSimStore
       
   258 #endif      // VPBKSIMSTORE_CCONTACTSTOREDOMAIN_H
       
   259             
       
   260 // End of File