mulwidgets/muldatamodel/inc/mulpullmode.h
changeset 0 e83bab7cf002
equal deleted inserted replaced
-1:000000000000 0:e83bab7cf002
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Header for  Pull Mode
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MULPULLMODE_H
       
    20 #define MULPULLMODE_H
       
    21 
       
    22 //Includes
       
    23 #include "mulpushmode.h"
       
    24 
       
    25 namespace Alf
       
    26     {
       
    27     
       
    28 //Forward Declaration
       
    29 
       
    30 class IMulModelProvider;
       
    31 class MulAsyncDataProvider;
       
    32 
       
    33 /**
       
    34  *  Implementation for Pull Mode
       
    35  */
       
    36 class MulPullMode : public MulPushMode
       
    37     {
       
    38     
       
    39 public:
       
    40 	
       
    41 	/**
       
    42 	 * C++ constructor.
       
    43 	 * 
       
    44 	 * @param aDataWindow DataWindow for model
       
    45 	 * @param aModelProvider Data Provider for model
       
    46 	 */
       
    47     MulPullMode( MulPageDataWindow& aDataWindow,
       
    48 				 const IMulModelProvider& aModelProvider);
       
    49 	
       
    50 	/**
       
    51 	 * Destructor.
       
    52 	 */
       
    53 	~MulPullMode();
       
    54     
       
    55 public: //from MulPushMode
       
    56    	
       
    57 	
       
    58 	void Update( int aIndex, int aCount, 
       
    59                          const MulDataPath& aPath);
       
    60             
       
    61 	void Refresh(int aCount, const MulDataPath& aPath);				             
       
    62 	     
       
    63 	void SetData( int aIndex, auto_ptr<MulVisualItem> aVisualItem, 
       
    64                          const MulDataPath& aPath);
       
    65 
       
    66 	void SetTemplate( mulwidget::TLogicalTemplate aTemplateId );               
       
    67 	                    
       
    68 	void WindowSiftedDown();
       
    69 
       
    70 	void WindowSiftedUp();	
       
    71 	
       
    72 	void ModelCountChanged(int aOldCount, int aNewCount);
       
    73 	
       
    74 	void DataWindowUpdated();
       
    75 	
       
    76 	const MulVisualItem& Item( int aAbsoluteIndex );
       
    77 	                    	
       
    78 private:
       
    79 
       
    80 	/**
       
    81 	 * Create list of indices and call ProvideData method
       
    82 	 *
       
    83 	 * @param aStartIndex, Index form where the data should be fetched
       
    84 	 * @param aRange, Number of items for which data should be fetched
       
    85 	 */
       
    86 	void ProvideData(int aStartIndex, int aRange);
       
    87 	
       
    88 	/**
       
    89 	 * Update Loop buffer because of data window updation
       
    90 	 * 
       
    91 	 */
       
    92 	void UpdateLoopBuffer();
       
    93 	  				
       
    94 private: //data
       
    95 
       
    96 	//IMulModelProvider* mModelProvider; // Not own
       
    97 	auto_ptr<MulAsyncDataProvider> mModelProvider; // own
       
    98     };
       
    99     
       
   100     } // namespace Alf
       
   101 
       
   102 #endif // MULPULLMODE_H
       
   103     
       
   104 //End of file
       
   105