homesync/contentmanager/cmserver/cmfillmanager/inc/cmfmduplicatedetector.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2008 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:  Handles duplicate detection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CMFMDUPLICATEDETECTOR_H
       
    21 #define __CMFMDUPLICATEDETECTOR_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 // Forward declarations
       
    26 class CCmFillListItem;
       
    27 class CMdESession;
       
    28 class CCmFmMdEDuplicateDetector;
       
    29 class CCmFmMpxDuplicateDetector;
       
    30 class MCmFmItemHandlerObserver;
       
    31 
       
    32 // Class declaration
       
    33     
       
    34 /**
       
    35  *  CCmFmDuplicateDetector class
       
    36  *  Part of Fill manager. CCmFmDuplicateDetector manages
       
    37  *  duplicate detection
       
    38  * 
       
    39  *  @lib cmfillmanager.lib
       
    40  *
       
    41  *  @since S60 5.1
       
    42  */
       
    43 NONSHARABLE_CLASS( CCmFmDuplicateDetector ) : public CBase
       
    44     {
       
    45 
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      *
       
    51      * @since S60 5.1
       
    52      * @param aObserver, observer class
       
    53      * @param aSession, mde session
       
    54      * @return  pointer to CCmFmDuplicateDetector class
       
    55      */
       
    56     static CCmFmDuplicateDetector* NewL( MCmFmItemHandlerObserver& aObserver,
       
    57         CMdESession& aSession );
       
    58     
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      *
       
    62      * @since S60 5.1
       
    63      * @param aObserver, observer class  
       
    64      * @param aSession, mde session   
       
    65      * @return  pointer to CCmFmDuplicateDetector class
       
    66      */
       
    67     static CCmFmDuplicateDetector* NewLC( MCmFmItemHandlerObserver& aObserver,
       
    68         CMdESession& aSession );
       
    69 
       
    70     /**
       
    71      * Destructor.
       
    72      */
       
    73     virtual ~CCmFmDuplicateDetector();    
       
    74     
       
    75 public:
       
    76 
       
    77     /**
       
    78      * Check if file is duplicate.
       
    79      * @param aItem, item to be checked
       
    80      * @return None
       
    81      */
       
    82     void CheckItemL( const CCmFillListItem& aItem ); 
       
    83 
       
    84     /**
       
    85      * Add to items array for duplicated check
       
    86      * @param aItem, item to be append
       
    87      * @return None
       
    88      */
       
    89     void AppendToArrayL( const CCmFillListItem& aItem );
       
    90     
       
    91     /**
       
    92      * reset the duplicator check array
       
    93      * @param None
       
    94      * @return None
       
    95      */
       
    96     void ResetArray();
       
    97 
       
    98 private:
       
    99 
       
   100     /**
       
   101      * Performs the first phase of two phase construction.
       
   102      */
       
   103     CCmFmDuplicateDetector( );
       
   104 
       
   105     /**
       
   106      * Performs the second phase construction.
       
   107      *
       
   108      * @since S60 5.1
       
   109      * @param aObserver, item handler observer
       
   110      * @param aSession, mde session
       
   111      */
       
   112     void ConstructL( MCmFmItemHandlerObserver& aObserver,
       
   113         CMdESession& aSession );
       
   114     
       
   115 
       
   116 private:
       
   117 
       
   118     /**
       
   119      * MdE (Video & Image) duplicate detector
       
   120      */
       
   121     CCmFmMdEDuplicateDetector* iCmFmMdEDuplicateDetector; // owned
       
   122     
       
   123     /**
       
   124      * Mpx (Music) duplicate detector
       
   125      */
       
   126     CCmFmMpxDuplicateDetector* iCmFmMpxDuplicateDetector; // owned
       
   127                     
       
   128     };
       
   129 
       
   130 #endif //  __CMFMDUPLICATEDETECTOR_H