idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
child 11 ff572dfe6d86
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    13 *
    13 *
    14 * Description:  Dialog renderer.
    14 * Description:  Dialog renderer.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 // System includes
    19 #include <e32property.h>
    19 #include <e32property.h>
    20 #include <activeidle2domainpskeys.h>
       
    21 #include <aipropertyextension.h>
       
    22 #include <aknnotedialog.h>
    20 #include <aknnotedialog.h>
    23 #include <avkon.rsg>
    21 #include <avkon.rsg>
    24 #include <StringLoader.h>
    22 #include <StringLoader.h>
       
    23 
       
    24 // User includes
       
    25 #include <hscontentpublisher.h>
       
    26 #include <hspublisherinfo.h>
       
    27 #include <activeidle2domainpskeys.h>
    25 #include <AiNativeUi.rsg>
    28 #include <AiNativeUi.rsg>
    26 #include "aidialogrenderer.h"
    29 #include "aidialogrenderer.h"
    27 #include "ainativeuiplugins.h"
    30 #include "ainativeuiplugins.h"
    28 #ifdef __COVER_DISPLAY
    31 #ifdef __COVER_DISPLAY
    29 #include "aisecondarydisplayapi.h"
    32 #include "aisecondarydisplayapi.h"
    30 #endif
    33 #endif
    31 
    34 
    32 using namespace AiNativeUiController;
    35 using namespace AiNativeUiController;
    33 
    36 
    34 // ======== MEMBER FUNCTIONS ========
    37 // ======== MEMBER FUNCTIONS ========
    35 
    38 // ----------------------------------------------------------------------------
       
    39 // CAiDialogRenderer::NewLC()
       
    40 //
       
    41 // ----------------------------------------------------------------------------
       
    42 //
    36 CAiDialogRenderer* CAiDialogRenderer::NewLC()
    43 CAiDialogRenderer* CAiDialogRenderer::NewLC()
    37     {
    44     {
    38     CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer;
    45     CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer;
    39     CleanupStack::PushL( self );
    46     CleanupStack::PushL( self );
    40     return self;
    47     return self;
    41     }
    48     }
    42 
    49 
    43 
    50 // ----------------------------------------------------------------------------
       
    51 // CAiDialogRenderer::~CAiDialogRenderer()
       
    52 //
       
    53 // ----------------------------------------------------------------------------
       
    54 //
    44 CAiDialogRenderer::~CAiDialogRenderer()
    55 CAiDialogRenderer::~CAiDialogRenderer()
    45     {
    56     {
    46     delete iDialog;
    57     delete iDialog;
    47     delete iText;
    58     delete iText;
    48     }
    59     }
    49 
    60 
    50 
    61 // ----------------------------------------------------------------------------
       
    62 // CAiDialogRenderer::CAiDialogRenderer()
       
    63 //
       
    64 // ----------------------------------------------------------------------------
       
    65 //
    51 CAiDialogRenderer::CAiDialogRenderer()
    66 CAiDialogRenderer::CAiDialogRenderer()
    52     {
    67     {
    53     }
    68     }
    54     
    69     
    55 
    70 // ----------------------------------------------------------------------------
    56 void CAiDialogRenderer::DoPublishL( MAiPropertyExtension& aPlugin, 
    71 // CAiDialogRenderer::DoPublishL()
    57                                     TInt aContent, 
    72 //
    58                                     TInt aResource,
    73 // ----------------------------------------------------------------------------
    59                                     TInt /*aIndex*/  )
    74 //
       
    75 void CAiDialogRenderer::DoPublishL( CHsContentPublisher& aPlugin, 
       
    76     TInt aContent, TInt aResource, TInt /*aIndex*/  )
    60     {
    77     {
    61     if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid )
    78     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
    79     
       
    80     if( info.Uid() == KDeviceStatusPluginUid )
    62     	{
    81     	{
    63 	    switch( aContent )
    82 	    switch( aContent )
    64 	        {
    83 	        {
    65 	        case EAiDeviceStatusContentSIMRegStatus:
    84 	        case EAiDeviceStatusContentSIMRegStatus:
    66 	            {
    85 	            {
    97 	        default:
   116 	        default:
    98 	            {
   117 	            {
    99 	            User::Leave( KErrNotFound );
   118 	            User::Leave( KErrNotFound );
   100 	            break;
   119 	            break;
   101 	            }
   120 	            }
   102 	        };
   121 	        }
   103     	}
   122     	}
   104     else
   123     else
   105    		{
   124    		{
   106    		User::Leave( KErrNotFound );	
   125    		User::Leave( KErrNotFound );	
   107    		}
   126    		}
   108     }
   127     }
   109 
   128 
   110 void CAiDialogRenderer::DoCleanL( MAiPropertyExtension& /*aPlugin*/, 
   129 // ----------------------------------------------------------------------------
   111                                     TInt aContent )
   130 // CAiDialogRenderer::DoCleanL()
       
   131 //
       
   132 // ----------------------------------------------------------------------------
       
   133 //
       
   134 void CAiDialogRenderer::DoCleanL( CHsContentPublisher& /*aPlugin*/, 
       
   135     TInt aContent )
   112     {
   136     {
   113     switch( aContent )
   137     switch( aContent )
   114         {
   138         {
   115         case EAiDeviceStatusContentSIMRegStatus:
   139         case EAiDeviceStatusContentSIMRegStatus:
   116             {
   140             {
   122         default:
   146         default:
   123             {
   147             {
   124             User::Leave( KErrNotFound );
   148             User::Leave( KErrNotFound );
   125             break;
   149             break;
   126             }
   150             }
   127         };
   151         }
   128 
       
   129     }
   152     }
   130     
   153     
   131     
   154 // ----------------------------------------------------------------------------
       
   155 // CAiDialogRenderer::ShowDialogL()
       
   156 //
       
   157 // ----------------------------------------------------------------------------
       
   158 //  
   132 void CAiDialogRenderer::ShowDialogL()
   159 void CAiDialogRenderer::ShowDialogL()
   133     {
   160     {
   134     if ( iDialog )
   161     if ( iDialog )
   135         {
   162         {
   136         return;
   163         return;
   151     iDialog->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY );
   178     iDialog->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY );
   152     iDialog->SetTextL( *iText );
   179     iDialog->SetTextL( *iText );
   153     iDialog->RunLD();
   180     iDialog->RunLD();
   154     }
   181     }
   155     
   182     
   156     
   183 // ----------------------------------------------------------------------------
       
   184 // CAiDialogRenderer::FocusObtainedL()
       
   185 //
       
   186 // ----------------------------------------------------------------------------
       
   187 //    
   157 void CAiDialogRenderer::FocusObtainedL()
   188 void CAiDialogRenderer::FocusObtainedL()
   158     {
   189     {
   159     if( iShowDialog )
   190     if( iShowDialog )
   160         {
   191         {
   161         ShowDialogL();
   192         ShowDialogL();
   162         }
   193         }
   163     }
   194     }
       
   195 
       
   196 // End of file