homesync/contentmanager/cmserver/cmfillmanager/inc/cmfmmpxduplicatedetector.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 for music
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CMFMMPXDUPLICATEDETECTOR_H
       
    21 #define __CMFMMPXDUPLICATEDETECTOR_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <mpxcollectionobserver.h>
       
    25 
       
    26 
       
    27 // Forward declarations
       
    28 class MMPXCollectionUtility;
       
    29 
       
    30 // Class declarations
       
    31     
       
    32 /**
       
    33  * CCmFmMpxDuplicateDetector class
       
    34  * Part of Fill manager. CCmFmMpxDuplicateDetector manages
       
    35  * duplicate detection 
       
    36  *
       
    37  * @lib cmfillmanager.lib
       
    38  *
       
    39  * @since S60 5.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CCmFmMpxDuplicateDetector ) : public CBase,
       
    42                          public MMPXCollectionObserver,
       
    43                          public MMPXCollectionFindObserver
       
    44     {
       
    45 
       
    46 public:    
       
    47 
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      *
       
    51      * @since S60 5.1
       
    52      * @param aObserver, observer class
       
    53      * @return  pointer to CCmFmMpxDuplicateDetector class
       
    54      */
       
    55     static CCmFmMpxDuplicateDetector* NewL( 
       
    56         MCmFmItemHandlerObserver& aObserver );
       
    57     
       
    58     /**
       
    59      * Two-phased constructor.
       
    60      *
       
    61      * @since S60 5.1
       
    62      * @param aObserver, observer class  
       
    63      * @return  pointer to CCmFmMpxDuplicateDetector class
       
    64      */
       
    65     static CCmFmMpxDuplicateDetector* NewLC( 
       
    66         MCmFmItemHandlerObserver& aObserver );
       
    67 
       
    68     /**
       
    69      * Destructor.
       
    70      */
       
    71     virtual ~CCmFmMpxDuplicateDetector();
       
    72     
       
    73 public:
       
    74 
       
    75     /**
       
    76      * Check if file is duplicate.
       
    77      *
       
    78      * @since S60 5.1
       
    79      * @param aItem, item to be checked
       
    80      * @return None
       
    81      */    
       
    82     void CheckMusicL( const CCmFillListItem& aItem );
       
    83    
       
    84    /**
       
    85      * Opens connection to collection plugin
       
    86      *
       
    87      * @since S60 5.1
       
    88      * @param None
       
    89      * @return None
       
    90      */
       
    91     void OpenCollectionPluginL();
       
    92     
       
    93    /**
       
    94      * Closes connection to collection plugin
       
    95      *
       
    96      * @since S60 5.1
       
    97      * @param None
       
    98      * @return None
       
    99      */ 
       
   100     void CloseCollectionPlugin();    
       
   101 	
       
   102 protected:
       
   103 
       
   104 // From base class MMPXCollectionObserver
       
   105 
       
   106     /**
       
   107      * From MMPXCollectionObserver
       
   108      * See base class definition
       
   109      */
       
   110 	 void HandleCollectionMediaL(const CMPXMedia& aMedia, TInt aError);
       
   111 
       
   112     /**
       
   113      * From MMPXCollectionObserver
       
   114      * See base class definition
       
   115      */
       
   116 	void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr );
       
   117 	
       
   118     /**
       
   119      * From MMPXCollectionObserver
       
   120      * See base class definition
       
   121      */
       
   122 	void HandleOpenL( const CMPXMedia& aEntries,
       
   123 	    TInt aIndex,TBool aComplete,TInt aError );
       
   124 	
       
   125     /**
       
   126      * From MMPXCollectionObserver
       
   127      * See base class definition
       
   128      */
       
   129     void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError);
       
   130 	
       
   131 // From base class MMPXCollectionFindObserver
       
   132 
       
   133 	/**
       
   134      * From MMPXCollectionFindObserver
       
   135      * See base class definition
       
   136      */
       
   137 	 void HandleFindAllL(const CMPXMedia& aResults, 
       
   138 	    TBool aComplete, TInt aError);	
       
   139 	
       
   140 private:
       
   141 
       
   142     /**
       
   143      * Performs the first phase of two phase construction.
       
   144      */
       
   145     CCmFmMpxDuplicateDetector( MCmFmItemHandlerObserver& aObserver );
       
   146 
       
   147     /**
       
   148      * Performs the second phase construction.
       
   149      */
       
   150     void ConstructL( );
       
   151     
       
   152 
       
   153 private: // data
       
   154 
       
   155     /**
       
   156      * Observer class
       
   157      */
       
   158     MCmFmItemHandlerObserver& iObserver;
       
   159     
       
   160     /**
       
   161      * Collection utility of MPX framework
       
   162      */
       
   163     MMPXCollectionUtility* iCollectionUtility;          // owned
       
   164     
       
   165     /**
       
   166      * Duplicate or not
       
   167      */
       
   168     TBool iDuplicate;
       
   169             
       
   170     };
       
   171 
       
   172 #endif //  __CMFMMPXDUPLICATEDETECTOR_H