menucontentsrv/srvinc/mcschildrenscanner.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 #ifndef MCSCHILDRENSCANNER_H_
       
    18 #define MCSCHILDRENSCANNER_H_
       
    19 
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "menuengoperation.h"
       
    23 #include "mcsmenuitem.h"
       
    24 
       
    25 class CMenuSrvEng;
       
    26 
       
    27 /**
       
    28  * Interface for updating Now Playing entry after Publish&Subscribe events.
       
    29  *
       
    30  * @since S60 v3.2
       
    31  */
       
    32 class MMcsChildrenScanner
       
    33     {
       
    34     
       
    35 public:
       
    36     virtual void HandleChildrenEvent(TInt aId, TUint oldCount, TUint newCount) = 0;
       
    37     };
       
    38 
       
    39 
       
    40 /**
       
    41  *  Children Scanner Active Object.
       
    42  *  @lib mcsmenu.lib
       
    43  *  @since S60 v5.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CMcsChildrenScanner ) : 
       
    46     public CActive,
       
    47     public MMenuEngOperation
       
    48     {
       
    49     
       
    50 public:
       
    51 
       
    52     /**
       
    53      * Creates an instance of CMcsChildrenScanner implementation.
       
    54      *
       
    55      * @since S60 v5.0
       
    56      */
       
    57     static CMcsChildrenScanner* NewL( 
       
    58     	MMcsChildrenScanner& aObserver, 
       
    59         CMenuSrvEng& aSrvEng);
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      */
       
    64     virtual ~CMcsChildrenScanner();
       
    65     
       
    66     void Scan(TInt aId);
       
    67     
       
    68 private:
       
    69    
       
    70    /**
       
    71     * Execute engine operation:
       
    72     */
       
    73     void RunMenuEngOperationL();
       
    74 
       
    75     /**
       
    76     * Error handling: ignore error.
       
    77     * @param aErr Error code.
       
    78     */
       
    79     void CompletedMenuEngOperation( TInt aErr );
       
    80     
       
    81     void ScanFolderL();
       
    82     
       
    83 
       
    84 private:
       
    85     /**
       
    86      * Constructor.
       
    87      *
       
    88      * @since S60 v5.0
       
    89      */
       
    90 	CMcsChildrenScanner ( 
       
    91 		MMcsChildrenScanner& aObserver, 
       
    92         CMenuSrvEng& aSrvEng);
       
    93 
       
    94     /**
       
    95      * Symbian 2nd phase constructor.
       
    96      */
       
    97     void ConstructL();
       
    98 
       
    99 private: // From CActive.
       
   100     
       
   101     /**
       
   102      * From CActive.
       
   103      */
       
   104     void DoCancel();
       
   105         
       
   106     /**
       
   107      * From CActive.
       
   108      */
       
   109     void RunL();      
       
   110 
       
   111     /**
       
   112     * Error handling: ignore error.
       
   113     * @param aErr Error code.
       
   114     */
       
   115     TInt RunError( TInt aError );
       
   116     
       
   117 private: 
       
   118     
       
   119     void AddId(TInt aId);
       
   120     
       
   121     void RemoveId(TInt aId);
       
   122         
       
   123 private:
       
   124 
       
   125 	
       
   126     /**
       
   127      * Interface for notifying changes.
       
   128      * Not own.
       
   129      */
       
   130 	MMcsChildrenScanner& iObserver;     
       
   131     
       
   132 	/**
       
   133 	 * Menu engine.
       
   134 	 * Not own.
       
   135 	 */
       
   136     CMenuSrvEng& iSrvEng;
       
   137     
       
   138     TBool iOpStatus;
       
   139     
       
   140     RArray<TInt> iIdBuff;
       
   141 
       
   142     };
       
   143 
       
   144 #endif /*MCSCHILDRENSCANNER_H_*/