mulwidgets/mulsliderwidget/src/mulslidermodel.cpp
branchRCL_3
changeset 25 4ea6f81c838a
parent 23 514d98f21c43
child 26 0e9bb658ef58
equal deleted inserted replaced
23:514d98f21c43 25:4ea6f81c838a
     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:  Implementation of slider model interface
       
    15  *
       
    16 */
       
    17 
       
    18 //Class headers
       
    19 #include "mulslidermodel.h"
       
    20 
       
    21 // Alf headers
       
    22 
       
    23 #include <alf/alfmodel.h>
       
    24 #include <alf/alfutil.h>
       
    25 #include <mul/mulvarianttype.h>
       
    26 
       
    27 // Osn Headers
       
    28 #include <osn/osnnew.h>  //for new(EMM)
       
    29 #include <osn/ustring.h>
       
    30 #include <mul/mulvisualitem.h>
       
    31 #include <mul/imulsliderwidget.h>
       
    32 #include <string.h>
       
    33 
       
    34 // For Common strings
       
    35 
       
    36 #include "mulslidervertical.h"
       
    37 #include "mulsliderwidget.h"
       
    38 
       
    39 const int KMaxrange = 100;
       
    40 const int KTick = 1;
       
    41 const int KSize = 50; 
       
    42 namespace Alf
       
    43 {
       
    44 
       
    45 struct SliderModelDataImpl
       
    46 	{
       
    47 	int mSldMaxRange;// Slider Maximum Value
       
    48 	int mSldMinRange;// Slider Maximum Value
       
    49 	int mSldTick;//  Size of single click movement
       
    50 	int mSldPrimaryTick;// Current Handle Position
       
    51 	int mSldSecondaryTick;// Secondary progress position
       
    52 	char* mSldLeftText;// Left text
       
    53 	char* mSldRightText;// Right text
       
    54 	char* mSldPercentText;// Percentage text for zoom slider
       
    55 	MulSliderWidget* mSliderWidget;
       
    56     IMulSliderBaseElementInternal * mSliderElement;// Element pointer 
       
    57     sliderTemplate mTemplateId; // template ID 
       
    58 	std::auto_ptr<MulVisualItem> mItem; 
       
    59 	SliderModelDataImpl()
       
    60     	{
       
    61     	mItem = ( new (EMM) MulVisualItem() );	
       
    62     	mSldMaxRange = KMaxrange;
       
    63     	mSldMinRange = 0;
       
    64     	mSldTick = KTick;
       
    65     	mSldPrimaryTick = 0;
       
    66     	mSldSecondaryTick = 0;
       
    67     	mSldLeftText = NULL;
       
    68     	mSldRightText =NULL;
       
    69     	mSldPercentText = NULL;
       
    70     	mSliderWidget = NULL;
       
    71     	mSliderElement = NULL;
       
    72     	mTemplateId = ESliderTemplateNone;
       
    73     	}
       
    74 	};
       
    75 
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Constructor 
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 MulSliderModel::MulSliderModel():
       
    82 mModel ( NULL )
       
    83 	{
       
    84 	mSldrModelData = new(EMM)SliderModelDataImpl();
       
    85 	}
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // Destructor 
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 MulSliderModel::~MulSliderModel()
       
    92 	{
       
    93 	if(mSldrModelData)	  
       
    94 	    {
       
    95 	    delete mSldrModelData;
       
    96 	    }
       
    97 	else
       
    98 	    {
       
    99 	    
       
   100 	    }
       
   101 	}		
       
   102 	
       
   103 // ---------------------------------------------------------------------------
       
   104 // SetData 
       
   105 // ---------------------------------------------------------------------------
       
   106 // 
       
   107 void MulSliderModel::SetData(const MulVisualItem& aSliderItem)
       
   108     {
       
   109     
       
   110     UString str;    
       
   111      
       
   112    
       
   113     if(aSliderItem.Attribute(mulvisualitem::KMulMaxRange))
       
   114         {
       
   115         SetMaxRange(
       
   116             aSliderItem.AttributeAsInt(mulvisualitem::KMulMaxRange));
       
   117         }
       
   118     if(aSliderItem.Attribute(mulvisualitem::KMulMinRange))
       
   119         {
       
   120         SetMinRange(
       
   121             aSliderItem.AttributeAsInt(mulvisualitem::KMulMinRange));
       
   122         }
       
   123     if(aSliderItem.Attribute(mulvisualitem::KMulTick))
       
   124            {
       
   125            SetTick(aSliderItem.
       
   126                AttributeAsInt(mulvisualitem::KMulTick));
       
   127            }    
       
   128     if(aSliderItem.Attribute(mulvisualitem::KMulPrimaryTick))
       
   129         {
       
   130         SetPrimaryValue(aSliderItem.
       
   131             AttributeAsInt(mulvisualitem::KMulPrimaryTick));
       
   132         }
       
   133     if(aSliderItem.Attribute(mulvisualitem::KMulSecondaryTick))
       
   134         {
       
   135         SetSecondaryValue(aSliderItem.
       
   136             AttributeAsInt(mulvisualitem::KMulSecondaryTick));
       
   137         }
       
   138             
       
   139     if(aSliderItem.Attribute(mulvisualitem::KMulPercent1))
       
   140             {
       
   141             
       
   142             int percentValue = aSliderItem.
       
   143                 AttributeAsInt(mulvisualitem::KMulPercent1);
       
   144             
       
   145             _LIT8(KPercent,"");
       
   146          	TBuf8<KSize> PercentText(KPercent);
       
   147          	PercentText.AppendNum (percentValue);
       
   148          	PercentText.Append(_L("%"));
       
   149          	mSldrModelData->mSldPercentText = (char*)PercentText.PtrZ();
       
   150          	
       
   151             }
       
   152   
       
   153      UpdateElement();
       
   154     }     
       
   155 
       
   156    
       
   157 // ---------------------------------------------------------------------------
       
   158 // Return MulVisual Item  
       
   159 // ---------------------------------------------------------------------------
       
   160 //
       
   161 const MulVisualItem& MulSliderModel::Data() const
       
   162 	{
       
   163 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulMaxRange,
       
   164 	                (int)mSldrModelData->mSldMaxRange);
       
   165 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulMinRange, 
       
   166 	                (int)mSldrModelData->mSldMinRange);
       
   167 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulTick, 
       
   168 	                (int)mSldrModelData->mSldTick);
       
   169 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulPrimaryTick, 
       
   170 	                (int)mSldrModelData->mSldPrimaryTick);
       
   171 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulSecondaryTick, 
       
   172 	                (int)mSldrModelData->mSldSecondaryTick);	
       
   173 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulCounter1,
       
   174 	                (int)mSldrModelData->mSldLeftText );
       
   175 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulCounter2, 
       
   176 	                (int)mSldrModelData->mSldRightText );
       
   177 	mSldrModelData->mItem->SetAttribute ( mulvisualitem::KMulPercent1, 
       
   178 	                (int)mSldrModelData->mSldPercentText );
       
   179 	return *(mSldrModelData->mItem);
       
   180    }
       
   181 
       
   182 // ---------------------------------------------------------------------------
       
   183 // SetValue 
       
   184 // ---------------------------------------------------------------------------
       
   185 //
       
   186 void MulSliderModel::SetPrimaryValue(int aValue)
       
   187     { 
       
   188 	int maxRange = mSldrModelData->mSldMaxRange;	
       
   189     int minRange = mSldrModelData->mSldMinRange;	
       
   190     // Validate aValue 
       
   191     if(aValue != mSldrModelData->mSldPrimaryTick)
       
   192         {
       
   193         if( (aValue >= minRange) && (aValue <= maxRange))
       
   194     		{
       
   195     		mSldrModelData->mSldPrimaryTick = aValue;
       
   196     		}
       
   197         else if(aValue <= minRange)
       
   198             {
       
   199     		mSldrModelData->mSldPrimaryTick = minRange;
       
   200     		}
       
   201     	else if(aValue >= maxRange)
       
   202     	    {
       
   203     	    mSldrModelData->mSldPrimaryTick = maxRange;
       
   204     	    }
       
   205     	// Update the visualization	
       
   206     	if(GetElement())
       
   207     	    {
       
   208             GetElement()->updateVisualization();	
       
   209     	    }        
       
   210 	    }
       
   211     }
       
   212     
       
   213 // ---------------------------------------------------------------------------
       
   214 // Gets the Slider Element 
       
   215 // ---------------------------------------------------------------------------
       
   216 //
       
   217 IMulSliderBaseElementInternal* MulSliderModel::GetElement() 
       
   218     {
       
   219     if(mSldrModelData->mSliderWidget)
       
   220         {
       
   221         return mSldrModelData->mSliderWidget->GetSliderElement();  
       
   222         }
       
   223     else
       
   224         {
       
   225         
       
   226         }
       
   227     return NULL;  
       
   228     }
       
   229     
       
   230     
       
   231  // ---------------------------------------------------------------------------
       
   232 // update element visualization 
       
   233 // ---------------------------------------------------------------------------
       
   234 //
       
   235 void MulSliderModel::UpdateElement() 
       
   236     {
       
   237     if(mSldrModelData->mSliderWidget)
       
   238         {
       
   239    		if(mSldrModelData->mSliderWidget->GetSliderElement())
       
   240 	   		{
       
   241 		    mSldrModelData->mSliderWidget->GetSliderElement()->updateVisualization();
       
   242 	   		}
       
   243 	    }
       
   244     }
       
   245        
       
   246 // ---------------------------------------------------------------------------
       
   247 // Value 
       
   248 // ---------------------------------------------------------------------------
       
   249 //
       
   250 int MulSliderModel::PrimaryValue() const
       
   251     {
       
   252     return mSldrModelData->mSldPrimaryTick;
       
   253     }
       
   254 
       
   255 // ---------------------------------------------------------------------------
       
   256 // SetValue 
       
   257 // ---------------------------------------------------------------------------
       
   258 //
       
   259 void MulSliderModel::SetSecondaryValue(int aValue)
       
   260     { 
       
   261   	int maxRange = mSldrModelData->mSldMaxRange;	
       
   262     int minRange = mSldrModelData->mSldMinRange;	
       
   263     if(mSldrModelData->mSldSecondaryTick != aValue)
       
   264         {
       
   265         // Validate aValue
       
   266         if( (aValue >= minRange) && (aValue <= maxRange))
       
   267     		{
       
   268     		mSldrModelData->mSldSecondaryTick = aValue;
       
   269     		}
       
   270     		
       
   271     	UpdateElement();
       
   272         }
       
   273     }
       
   274 
       
   275 // ---------------------------------------------------------------------------
       
   276 // Value 
       
   277 // ---------------------------------------------------------------------------
       
   278 //
       
   279 int MulSliderModel::SecondaryValue() const
       
   280     {
       
   281     return mSldrModelData->mSldSecondaryTick;
       
   282     }
       
   283     
       
   284 
       
   285 // ---------------------------------------------------------------------------
       
   286 // TotalTicks 
       
   287 // ---------------------------------------------------------------------------
       
   288 //
       
   289 int MulSliderModel::TotalTicks() const
       
   290     {
       
   291     //MUL_LOG_INFO("CMulSliderModel::TotalTicks");
       
   292     
       
   293     int maxRange = mSldrModelData->mSldMaxRange;	
       
   294     int minRange = mSldrModelData->mSldMinRange;	
       
   295     int tick     = mSldrModelData->mSldTick;
       
   296     if(tick == 0)
       
   297         {
       
   298         tick = 1;
       
   299         }
       
   300     return ((maxRange-minRange)/tick);
       
   301     }
       
   302 
       
   303 // ---------------------------------------------------------------------------
       
   304 // SetTemplate 
       
   305 // ---------------------------------------------------------------------------
       
   306 //
       
   307 void MulSliderModel::SetTemplate( sliderTemplate aTemplateId)
       
   308     {
       
   309     if(mSldrModelData->mTemplateId != aTemplateId)
       
   310         {
       
   311     	mSldrModelData->mTemplateId = aTemplateId; 
       
   312     	if(mSldrModelData->mSliderWidget)
       
   313             {
       
   314             // Change the tempate 
       
   315             mSldrModelData->mSliderWidget->changeTemplate(aTemplateId);
       
   316             }
       
   317         else 
       
   318             {
       
   319             //do nothing
       
   320             }	
       
   321         }
       
   322     }
       
   323 
       
   324 // ---------------------------------------------------------------------------
       
   325 // makeInterface
       
   326 // ---------------------------------------------------------------------------
       
   327 //
       
   328 IAlfInterfaceBase* MulSliderModel::makeInterface( const IfId& aType)
       
   329     {
       
   330     //MUL_LOG_INFO("CMulSliderModel::makeInterface");
       
   331     IAlfInterfaceBase* ret(0);
       
   332       UString param(aType.mImplementationId);
       
   333       if ( param == IMulSliderModel::type().mImplementationId )
       
   334           {
       
   335           ret = static_cast<IMulSliderModel*>(this);
       
   336           }
       
   337       else if(param == IAlfModel::type().mImplementationId)
       
   338           {
       
   339           ret = static_cast<IAlfModel*>(this);
       
   340           }
       
   341       return ret;      
       
   342           
       
   343     }
       
   344 
       
   345 // ---------------------------------------------------------------------------
       
   346 // SetMinRange 
       
   347 // ---------------------------------------------------------------------------
       
   348 //
       
   349 
       
   350 void MulSliderModel::SetMinRange(int aMinRange)
       
   351 	{
       
   352 	// Validate aMinRange
       
   353 	if(aMinRange != mSldrModelData->mSldMinRange)
       
   354 	    {
       
   355 	    mSldrModelData->mSldMinRange = aMinRange;
       
   356 	    
       
   357 	   if(aMinRange > mSldrModelData->mSldMaxRange)
       
   358 	       {
       
   359 	       mSldrModelData->mSldMaxRange = aMinRange;
       
   360 	       mSldrModelData->mSldTick = 0;
       
   361 	       }
       
   362 	   else
       
   363 	       {
       
   364 	       if(mSldrModelData->mSldTick > mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange || mSldrModelData->mSldTick == 0)
       
   365               {
       
   366               mSldrModelData->mSldTick = mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange; 
       
   367               }
       
   368 	       }
       
   369     	
       
   370 	       mSldrModelData->mSldPrimaryTick = aMinRange;
       
   371         UpdateElement();	  
       
   372         }
       
   373 
       
   374 	}
       
   375 
       
   376 // ---------------------------------------------------------------------------
       
   377 // SetMaxRange 
       
   378 // ---------------------------------------------------------------------------
       
   379 //
       
   380 
       
   381 void MulSliderModel::SetMaxRange(int aMaxRange)
       
   382 	{
       
   383 	if(aMaxRange != mSldrModelData->mSldMaxRange)
       
   384 	    {
       
   385 	    mSldrModelData->mSldMaxRange = aMaxRange;
       
   386 	   
       
   387 	    if(aMaxRange < mSldrModelData->mSldMinRange)
       
   388 	        {
       
   389 	        mSldrModelData->mSldMinRange = aMaxRange;
       
   390 	        mSldrModelData->mSldTick = 0;
       
   391 	        }
       
   392 	    else
       
   393 	        {
       
   394 	        if(mSldrModelData->mSldTick > mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange || mSldrModelData->mSldTick == 0 )
       
   395                 {
       
   396                 mSldrModelData->mSldTick = mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange; 
       
   397                 }
       
   398 	        }
       
   399     	
       
   400 	    mSldrModelData->mSldPrimaryTick = mSldrModelData->mSldMinRange;
       
   401         UpdateElement();	    
       
   402         }
       
   403     }
       
   404 
       
   405 // ---------------------------------------------------------------------------
       
   406 // MinRange 
       
   407 // ---------------------------------------------------------------------------
       
   408 //
       
   409 
       
   410 int MulSliderModel::MinRange() const
       
   411 	{
       
   412 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   413 	return mSldrModelData->mSldMinRange;	
       
   414 	}
       
   415 		
       
   416 // ---------------------------------------------------------------------------
       
   417 // MaxRange 
       
   418 // ---------------------------------------------------------------------------
       
   419 //
       
   420 
       
   421 int MulSliderModel::MaxRange() const
       
   422 	{
       
   423 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   424 	return mSldrModelData->mSldMaxRange;	
       
   425 	}
       
   426 // ---------------------------------------------------------------------------
       
   427 // SetTick 
       
   428 // ---------------------------------------------------------------------------
       
   429 //
       
   430 
       
   431 void MulSliderModel::SetTick(int aTick)
       
   432 	{
       
   433 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");
       
   434 	if(aTick != mSldrModelData->mSldTick && aTick > 0) 
       
   435 	    {
       
   436         if(aTick > mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange)
       
   437     	    {
       
   438     	    mSldrModelData->mSldTick = mSldrModelData->mSldMaxRange - mSldrModelData->mSldMinRange;	
       
   439     	    }
       
   440     	else
       
   441     	    {
       
   442     	    mSldrModelData->mSldTick = aTick;
       
   443     	    }
       
   444         mSldrModelData->mSldPrimaryTick = mSldrModelData->mSldMinRange;
       
   445     	if(GetElement())
       
   446     	    {
       
   447     	    GetElement()->updateVisualization();
       
   448     	    }	    
       
   449 	    }
       
   450 	}
       
   451 
       
   452 // ---------------------------------------------------------------------------
       
   453 // Tick 
       
   454 // ---------------------------------------------------------------------------
       
   455 //
       
   456 
       
   457 int MulSliderModel::Tick() const
       
   458 	{
       
   459 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   460 	return mSldrModelData->mSldTick;	
       
   461 	}
       
   462 
       
   463 
       
   464 // ---------------------------------------------------------------------------
       
   465 // SetRightText 
       
   466 // ---------------------------------------------------------------------------
       
   467 //
       
   468 
       
   469 void MulSliderModel::SetRightText(char* aRightText)
       
   470 	{
       
   471 	if(aRightText)
       
   472 	    {
       
   473 	    mSldrModelData->mSldRightText = aRightText;
       
   474 	    UpdateElement();
       
   475 	    }
       
   476 	    	
       
   477 	}
       
   478 
       
   479 // ---------------------------------------------------------------------------
       
   480 // SetLeftText 
       
   481 // ---------------------------------------------------------------------------
       
   482 //
       
   483 
       
   484 void MulSliderModel::SetLeftText(char* aLeftText)
       
   485 	{
       
   486     if(aLeftText)
       
   487 	    {
       
   488 	    mSldrModelData->mSldLeftText = aLeftText;
       
   489 	    UpdateElement();
       
   490 	    }
       
   491 	}
       
   492 
       
   493 // ---------------------------------------------------------------------------
       
   494 // SetPercentText 
       
   495 // ---------------------------------------------------------------------------
       
   496 //
       
   497 
       
   498 void MulSliderModel::SetPercentText(char* aPercText)
       
   499 	{
       
   500 	if(aPercText)
       
   501 	    {
       
   502 	    mSldrModelData->mSldPercentText = aPercText;
       
   503 	    if(GetElement())
       
   504 	    {
       
   505 	    GetElement()->updateTextVisualization();	
       
   506 	    }
       
   507 	    }
       
   508 	
       
   509 	}
       
   510 
       
   511 // ---------------------------------------------------------------------------
       
   512 // GetRightText 
       
   513 // ---------------------------------------------------------------------------
       
   514 //
       
   515 
       
   516 const char* MulSliderModel::GetRightText()
       
   517 	{
       
   518 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   519 	return mSldrModelData->mSldRightText;	
       
   520 	}
       
   521 
       
   522 // ---------------------------------------------------------------------------
       
   523 // GetLeftText 
       
   524 // ---------------------------------------------------------------------------
       
   525 //
       
   526 
       
   527 const char* MulSliderModel::GetLeftText()
       
   528 	{
       
   529 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   530 	return mSldrModelData->mSldLeftText;	
       
   531 	}
       
   532 
       
   533 // ---------------------------------------------------------------------------
       
   534 // GetPercentText 
       
   535 // ---------------------------------------------------------------------------
       
   536 //
       
   537 
       
   538 const char* MulSliderModel::GetPercentText()
       
   539 	{
       
   540 	//MUL_LOG_INFO("CMulSliderModel::makeInterface");		
       
   541 	return mSldrModelData->mSldPercentText;	
       
   542 	}
       
   543 
       
   544 
       
   545 // ---------------------------------------------------------------------------
       
   546 // addModelChangeObserver 
       
   547 // ---------------------------------------------------------------------------
       
   548 //
       
   549 void MulSliderModel::addModelChangeObserver( IAlfModelChangeObserver& /*aObserver*/ )
       
   550     {    
       
   551     //MUL_LOG_INFO("CMulSliderModel::addModelChangeObserver");
       
   552     }
       
   553 
       
   554 // ---------------------------------------------------------------------------
       
   555 // removeModelChangeObserver 
       
   556 // ---------------------------------------------------------------------------
       
   557 //
       
   558 void MulSliderModel::removeModelChangeObserver( IAlfModelChangeObserver& /*aObserver*/ )
       
   559     {
       
   560     //MUL_LOG_INFO("CMulSliderModel::removeModelChangeObserver");
       
   561     }
       
   562 
       
   563 // ---------------------------------------------------------------------------
       
   564 // setData 
       
   565 // ---------------------------------------------------------------------------
       
   566 //
       
   567 void MulSliderModel::setData( IAlfVariantType* /*aData*/ )
       
   568     {
       
   569     //MUL_LOG_INFO("CMulSliderModel::setData");
       
   570     }
       
   571 
       
   572 // ---------------------------------------------------------------------------
       
   573 // updateData 
       
   574 // ---------------------------------------------------------------------------
       
   575 //
       
   576 void MulSliderModel::updateData(int /*aNumContainerIndices*/,int* /*aContainerIndices*/,
       
   577                                 IAlfVariantType* /*aData*/ )
       
   578     {
       
   579     //MUL_LOG_INFO("CMulSliderModel::updateData");
       
   580     }
       
   581 
       
   582 // ---------------------------------------------------------------------------
       
   583 // addData 
       
   584 // ---------------------------------------------------------------------------
       
   585 //
       
   586 void MulSliderModel::addData(int /*aNumContainerIndices*/,int* /*aContainerIndices*/, 
       
   587                              IAlfVariantType* /*aData*/ )
       
   588     {
       
   589     //MUL_LOG_INFO("CMulSliderModel::addData");
       
   590     }
       
   591 
       
   592 // ---------------------------------------------------------------------------
       
   593 // removeData 
       
   594 // ---------------------------------------------------------------------------
       
   595 //
       
   596 void MulSliderModel::removeData(int /*aNumContainerIndices*/,int* /*aContainerIndices*/ )
       
   597     {
       
   598     //MUL_LOG_INFO("CMulSliderModel::removeData");
       
   599     }
       
   600 
       
   601 // ---------------------------------------------------------------------------
       
   602 // executeOperations 
       
   603 // ---------------------------------------------------------------------------
       
   604 //
       
   605 void MulSliderModel::executeOperations(AlfPtrVector<AlfModelOperation>&  /*aOperationsArray*/)
       
   606     {
       
   607     //MUL_LOG_INFO("CMulSliderModel::executeOperations");
       
   608     
       
   609 
       
   610     }
       
   611 
       
   612 // ---------------------------------------------------------------------------
       
   613 // executeOperation 
       
   614 // ---------------------------------------------------------------------------
       
   615 //
       
   616 void MulSliderModel::executeOperation(AlfModelOperation* /*aOperation*/)
       
   617     {
       
   618     //MUL_LOG_INFO("CMulSliderModel::executeOperation");
       
   619     }
       
   620 
       
   621 // ---------------------------------------------------------------------------
       
   622 // clearModel 
       
   623 // ---------------------------------------------------------------------------
       
   624 //
       
   625 void MulSliderModel::clearModel()
       
   626     {
       
   627     //MUL_LOG_INFO("CMulSliderModel::clearModel");
       
   628     }
       
   629 
       
   630 // ---------------------------------------------------------------------------
       
   631 // data 
       
   632 // ---------------------------------------------------------------------------
       
   633 //
       
   634 IAlfVariantType* MulSliderModel::data() const 
       
   635     {
       
   636     //MUL_LOG_INFO("CMulSliderModel::data");
       
   637     return NULL;
       
   638     }    
       
   639 	
       
   640 // ---------------------------------------------------------------------------
       
   641 // StoreWidget
       
   642 // ---------------------------------------------------------------------------
       
   643 //    
       
   644 void MulSliderModel::storeWidget(MulSliderWidget* aWidget)
       
   645     {
       
   646     mSldrModelData->mSliderWidget = aWidget;
       
   647     }
       
   648 // ---------------------------------------------------------------------------
       
   649 // GetTemplate 
       
   650 // ---------------------------------------------------------------------------
       
   651 //
       
   652 sliderTemplate MulSliderModel::GetTemplate()
       
   653     {
       
   654     return mSldrModelData->mTemplateId ;
       
   655     }
       
   656   
       
   657 // ---------------------------------------------------------------------------
       
   658 // IsLandscape
       
   659 // 
       
   660 // ---------------------------------------------------------------------------
       
   661 //  
       
   662  bool MulSliderModel::IsLandscape()   
       
   663     {
       
   664 	
       
   665 	bool landscape = false;
       
   666 	if(mSldrModelData->mSliderWidget)
       
   667     	{
       
   668     	TSize size = AlfUtil::ScreenSize();        	
       
   669     	if(size.iHeight < size.iWidth)
       
   670         	{
       
   671             landscape = true;
       
   672         	}
       
   673     	else if(size.iWidth < size.iHeight)
       
   674         	{
       
   675         	landscape = false;
       
   676         	}
       
   677     	}
       
   678     return landscape;
       
   679     }
       
   680  
       
   681 	} // Namespace Alf
       
   682 
       
   683 //End of file