idlehomescreen/nativeuicontroller/src/ainavipanerenderer.cpp
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    13 *
    13 *
    14 * Description:  Navipane renderer.
    14 * Description:  Navipane renderer.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 // System includes
    19 #include <aipropertyextension.h>
       
    20 #include <centralrepository.h>
    19 #include <centralrepository.h>
    21 #include <ProfileEngineSDKCRKeys.h>
    20 #include <ProfileEngineSDKCRKeys.h>
       
    21 
       
    22 // User includes
       
    23 #include <hscontentpublisher.h>
       
    24 #include <hspublisherinfo.h>
    22 
    25 
    23 #include "ainavipanerenderer.h"
    26 #include "ainavipanerenderer.h"
    24 #include "ainavipaneanimator.h"
    27 #include "ainavipaneanimator.h"
    25 #include "aistatuspanel.h"
    28 #include "aistatuspanel.h"
    26 #include "ainativeuimodel.h"
    29 #include "ainativeuimodel.h"
    29 #include <aicontentrequest.h>
    32 #include <aicontentrequest.h>
    30 #include "debug.h"
    33 #include "debug.h"
    31 
    34 
    32 using namespace AiNativeUiController;
    35 using namespace AiNativeUiController;
    33 
    36 
    34 
    37 // ----------------------------------------------------------------------------
       
    38 // CAiNaviPaneRenderer::ConstructL()
       
    39 //
       
    40 // ----------------------------------------------------------------------------
       
    41 //
    35 void CAiNaviPaneRenderer::ConstructL()
    42 void CAiNaviPaneRenderer::ConstructL()
    36     {
    43     {
    37     iAnimator = CAiNaviPaneAnimator::NewL( iStatusPanel, 
    44     iAnimator = CAiNaviPaneAnimator::NewL( iStatusPanel, 
    38                                            iRenderingPriorities, 
    45                                            iRenderingPriorities, 
    39                                            *this );
    46                                            *this );
    40     iProfileText = HBufC::NewL(0);
    47     iProfileText = HBufC::NewL(0);
    41     iSilentIndicator = HBufC::NewL(0);
    48     iSilentIndicator = HBufC::NewL(0);
    42     }
    49     }
    43 
    50 
    44 
    51 // ----------------------------------------------------------------------------
       
    52 // CAiNaviPaneRenderer::NewLC()
       
    53 //
       
    54 // ----------------------------------------------------------------------------
       
    55 //
    45 CAiNaviPaneRenderer* CAiNaviPaneRenderer::NewLC( 
    56 CAiNaviPaneRenderer* CAiNaviPaneRenderer::NewLC( 
    46         CAiStatusPanel& aStatusPanel )
    57         CAiStatusPanel& aStatusPanel )
    47     {
    58     {
    48     CAiNaviPaneRenderer* self = new( ELeave ) CAiNaviPaneRenderer( aStatusPanel );
    59     CAiNaviPaneRenderer* self = 
       
    60         new( ELeave ) CAiNaviPaneRenderer( aStatusPanel );
    49     CleanupStack::PushL( self );
    61     CleanupStack::PushL( self );
    50     self->ConstructL();
    62     self->ConstructL();
    51     return self;
    63     return self;
    52     }
    64     }
    53 
    65 
    54 
    66 // ----------------------------------------------------------------------------
       
    67 // CAiNaviPaneRenderer::~CAiNaviPaneRenderer()
       
    68 //
       
    69 // ----------------------------------------------------------------------------
       
    70 //
    55 CAiNaviPaneRenderer::~CAiNaviPaneRenderer()
    71 CAiNaviPaneRenderer::~CAiNaviPaneRenderer()
    56     { 
    72     { 
    57     delete iAnimator;
    73     delete iAnimator;
    58     delete iProfileText;
    74     delete iProfileText;
    59     delete iSilentIndicator; 
    75     delete iSilentIndicator; 
    60     delete iTimedProfileIndicator;
    76     delete iTimedProfileIndicator;
    61     }
    77     }
    62 
    78 
    63 
    79 // ----------------------------------------------------------------------------
       
    80 // CAiNaviPaneRenderer::CAiNaviPaneRenderer()
       
    81 //
       
    82 // ----------------------------------------------------------------------------
       
    83 //
    64 CAiNaviPaneRenderer::CAiNaviPaneRenderer( CAiStatusPanel& aStatusPanel )
    84 CAiNaviPaneRenderer::CAiNaviPaneRenderer( CAiStatusPanel& aStatusPanel )
    65     : iStatusPanel( aStatusPanel ), 
    85     : iStatusPanel( aStatusPanel ), 
    66     iRenderingPriorities( AiNativeUiModel::RenderingPriorities( AiNativeUiModel::KNaviPaneId ) ),
    86     iRenderingPriorities( AiNativeUiModel::RenderingPriorities( AiNativeUiModel::KNaviPaneId ) ),
    67     iCurrentContent(KAiNullContentId),
    87     iCurrentContent(KAiNullContentId),
    68     iCurrentPriority(AiNativeUiModel::KNoPriority)
    88     iCurrentPriority(AiNativeUiModel::KNoPriority)
    69     {
    89     {
    70     }
    90     }
    71 
    91 
    72 
    92 // ----------------------------------------------------------------------------
    73 void CAiNaviPaneRenderer::DoPublishL( MAiPropertyExtension& aPlugin,
    93 // CAiNaviPaneRenderer::DoPublishL()
    74                                       TInt aContent, 
    94 //
    75                                       const TDesC16& aText,
    95 // ----------------------------------------------------------------------------
    76                                       TInt /*aIndex*/ )
    96 //
    77     {
    97 void CAiNaviPaneRenderer::DoPublishL( CHsContentPublisher& aPlugin,
    78     if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid )
    98     TInt aContent, const TDesC16& aText, TInt /*aIndex*/ )
       
    99     {
       
   100     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
   101     
       
   102     if( info.Uid() == KDeviceStatusPluginUid )
    79            {
   103            {
    80         switch( aContent )
   104         switch( aContent )
    81             {
   105             {
    82             // FALLTHROUGH
   106             // FALLTHROUGH
    83             case EAiDeviceStatusContentDate:
   107             case EAiDeviceStatusContentDate:
   224            {
   248            {
   225            User::Leave( KErrNotFound );    
   249            User::Leave( KErrNotFound );    
   226            }
   250            }
   227     }
   251     }
   228 
   252 
       
   253 // ----------------------------------------------------------------------------
       
   254 // CAiNaviPaneRenderer::ConstructProfileTextLC()
       
   255 //
       
   256 // ----------------------------------------------------------------------------
       
   257 //
   229 HBufC* CAiNaviPaneRenderer::ConstructProfileTextLC()
   258 HBufC* CAiNaviPaneRenderer::ConstructProfileTextLC()
   230     {
   259     {
   231     TInt bufLen = iProfileText->Length();
   260     TInt bufLen = iProfileText->Length();
   232     if ( iIsSilent )
   261     if ( iIsSilent )
   233         {
   262         {
   251         
   280         
   252     temp->Des().Append( *iProfileText );
   281     temp->Des().Append( *iProfileText );
   253     return temp;
   282     return temp;
   254     }
   283     }
   255 
   284 
   256 void CAiNaviPaneRenderer::DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent )
   285 // ----------------------------------------------------------------------------
   257     {
   286 // CAiNaviPaneRenderer::DoCleanL()
   258     if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid )
   287 //
       
   288 // ----------------------------------------------------------------------------
       
   289 //
       
   290 void CAiNaviPaneRenderer::DoCleanL( CHsContentPublisher& aPlugin, TInt aContent )
       
   291     {
       
   292     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
   293     
       
   294     if( info.Uid() == KDeviceStatusPluginUid )
   259         {    
   295         {    
   260 
   296 
   261         switch( aContent )
   297         switch( aContent )
   262             {
   298             {
   263             case EAiDeviceStatusContentNetworkIdentity:
   299             case EAiDeviceStatusContentNetworkIdentity:
   303                     // Publish empty text
   339                     // Publish empty text
   304                     iStatusPanel.SetNaviPaneTextL( KNullDesC );
   340                     iStatusPanel.SetNaviPaneTextL( KNullDesC );
   305                     iStatusPanel.RenderNaviPaneL();
   341                     iStatusPanel.RenderNaviPaneL();
   306 
   342 
   307                     MAiContentRequest* contentReq = static_cast<MAiContentRequest*>(
   343                     MAiContentRequest* contentReq = static_cast<MAiContentRequest*>(
   308                         aPlugin.GetPropertyL( EAiContentRequest ) );
   344                         aPlugin.GetProperty( CHsContentPublisher::EContentRequest ) );
   309                         
   345                         
   310                     if ( contentReq )
   346                     if ( contentReq )
   311                         {
   347                         {
   312                         TInt nextContentId;
   348                         TInt nextContentId;
   313                         while ( iRenderingPriorities.GetNextContentId( 
   349                         while ( iRenderingPriorities.GetNextContentId( 
   347         User::Leave( KErrNotFound );    
   383         User::Leave( KErrNotFound );    
   348         }    
   384         }    
   349     
   385     
   350     }
   386     }
   351 
   387 
   352 
   388 // ----------------------------------------------------------------------------
       
   389 // CAiNaviPaneRenderer::FocusObtainedL()
       
   390 //
       
   391 // ----------------------------------------------------------------------------
       
   392 //
   353 void CAiNaviPaneRenderer::FocusObtainedL()
   393 void CAiNaviPaneRenderer::FocusObtainedL()
   354     {
   394     {
   355     if( !iStatusPanel.IsKeyLockEnabled() )
   395     if( !iStatusPanel.IsKeyLockEnabled() )
   356         {
   396         {
   357         iAnimator->AnimateL();
   397         iAnimator->AnimateL();
   358         }
   398         }
   359     iFocusObtained = ETrue;    
   399     iFocusObtained = ETrue;    
   360     }
   400     }
   361 
   401 
   362 
   402 // ----------------------------------------------------------------------------
       
   403 // CAiNaviPaneRenderer::FocusLostL()
       
   404 //
       
   405 // ----------------------------------------------------------------------------
       
   406 //
   363 void CAiNaviPaneRenderer::FocusLostL()
   407 void CAiNaviPaneRenderer::FocusLostL()
   364     {
   408     {
   365     iAnimator->CancelAnimationL();
   409     iAnimator->CancelAnimationL();
   366     iFocusObtained = EFalse;
   410     iFocusObtained = EFalse;
   367     iCommitted = EFalse;
   411     iCommitted = EFalse;
   368     }
   412     }
   369 
   413 
   370 
   414 // ----------------------------------------------------------------------------
       
   415 // CAiNaviPaneRenderer::KeylockDisabledL()
       
   416 //
       
   417 // ----------------------------------------------------------------------------
       
   418 //
   371 void CAiNaviPaneRenderer::KeylockDisabledL()
   419 void CAiNaviPaneRenderer::KeylockDisabledL()
   372     {
   420     {
   373     iAnimator->AnimateL();
   421     iAnimator->AnimateL();
   374     }
   422     }
   375  
   423  
   376     
   424 // ----------------------------------------------------------------------------
       
   425 // CAiNaviPaneRenderer::KeylockEnabledL()
       
   426 //
       
   427 // ----------------------------------------------------------------------------
       
   428 //    
   377 void CAiNaviPaneRenderer::KeylockEnabledL()
   429 void CAiNaviPaneRenderer::KeylockEnabledL()
   378     {
   430     {
   379     iAnimator->CancelAnimationL();
   431     iAnimator->CancelAnimationL();
   380     }
   432     }
   381     
   433     
   382 
   434 // ----------------------------------------------------------------------------
       
   435 // CAiNaviPaneRenderer::TransactionCommittedL()
       
   436 //
       
   437 // ----------------------------------------------------------------------------
       
   438 //
   383 void CAiNaviPaneRenderer::TransactionCommittedL()
   439 void CAiNaviPaneRenderer::TransactionCommittedL()
   384     {
   440     {
   385     if( iIsChanged )
   441     if( iIsChanged )
   386         {
   442         {
   387         if( iFocusObtained && !iCommitted && !iStatusPanel.IsKeyLockEnabled() )
   443         if( iFocusObtained && !iCommitted && !iStatusPanel.IsKeyLockEnabled() )
   391             }
   447             }
   392         iIsChanged = EFalse;
   448         iIsChanged = EFalse;
   393         }
   449         }
   394     }
   450     }
   395     
   451     
   396     
   452 // ----------------------------------------------------------------------------
       
   453 // CAiNaviPaneRenderer::AnimationCompleteL()
       
   454 //
       
   455 // ----------------------------------------------------------------------------
       
   456 //
   397 void CAiNaviPaneRenderer::AnimationCompleteL()
   457 void CAiNaviPaneRenderer::AnimationCompleteL()
   398     {
   458     {
   399     // Navi pane animation is now completed -> show original text
   459     // Navi pane animation is now completed -> show original text
   400     HBufC* newText = NULL;
   460     HBufC* newText = NULL;
   401 
   461 
   412     iStatusPanel.RenderNaviPaneL();
   472     iStatusPanel.RenderNaviPaneL();
   413     
   473     
   414     CleanupStack::PopAndDestroy( newText );
   474     CleanupStack::PopAndDestroy( newText );
   415     }
   475     }
   416 
   476 
       
   477 // End of file