basiclocationinfodisplay/blid/ui/src/CBlidMainControl.cpp
branchRCL_3
changeset 4 3c271c9e6618
parent 0 522cd55cc3d7
child 8 41042d2af523
equal deleted inserted replaced
0:522cd55cc3d7 4:3c271c9e6618
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  Provides blid startup view class methods.
    14  * Description:  Provides blid startup view class methods.
    15 *
    15  *
    16 */
    16  */
    17 
       
    18 
       
    19 
    17 
    20 // SYSTEM INCLUDES
    18 // SYSTEM INCLUDES
    21 #include <aknmessagequerydialog.h> //CAknMessageQueryDialog
    19 #include <aknmessagequerydialog.h> //CAknMessageQueryDialog
    22 #include <StringLoader.h>
    20 #include <StringLoader.h>
    23 #include <aknconsts.h>
    21 #include <aknconsts.h>
    58 #include "CBlidLocSettingLauncher.h"
    56 #include "CBlidLocSettingLauncher.h"
    59 #include "Debug.h"
    57 #include "Debug.h"
    60 
    58 
    61 TInt CBlidMainControl::iPSYTimeoutCount = 0;
    59 TInt CBlidMainControl::iPSYTimeoutCount = 0;
    62 
    60 
    63 TInt MessageQueryCallBack( TAny* aPtr );
    61 TInt MessageQueryCallBack(TAny* aPtr);
    64 
    62 
    65 const TInt KTimerValue = 200000;
    63 const TInt KTimerValue = 200000;
    66 
       
    67 
    64 
    68 // ================= MEMBER FUNCTIONS =======================
    65 // ================= MEMBER FUNCTIONS =======================
    69 // ---------------------------------------------------------
    66 // ---------------------------------------------------------
    70 // CBlidMainControl::NewL()
    67 // CBlidMainControl::NewL()
    71 // Two phased constructor
    68 // Two phased constructor
    72 // ---------------------------------------------------------
    69 // ---------------------------------------------------------
    73 //
    70 //
    74 CBlidMainControl* CBlidMainControl::NewL( CAlfEnv& aEnv,
    71 CBlidMainControl* CBlidMainControl::NewL(CAlfEnv& aEnv, const TRect& aRect,
    75 		                                  const TRect& aRect,
    72         CBlidBaseView& aView)
    76 		                                  CBlidBaseView& aView)
    73     {
    77     {
    74     CBlidMainControl* self = new (ELeave) CBlidMainControl(aEnv, aView);
    78     CBlidMainControl* self = new (ELeave) CBlidMainControl(aEnv,
       
    79     													   aView );
       
    80     CleanupStack::PushL(self);
    75     CleanupStack::PushL(self);
    81     self->ConstructL( aRect );
    76     self->ConstructL(aRect);
    82     CleanupStack::Pop(self);
    77     CleanupStack::Pop(self);
    83     return self;
    78     return self;
    84     }
    79     }
    85 
    80 
    86 
       
    87 // ---------------------------------------------------------
    81 // ---------------------------------------------------------
    88 //CBlidMainControl::CBlidMainControl()
    82 //CBlidMainControl::CBlidMainControl()
    89 // First phase constructor, can not leave
    83 // First phase constructor, can not leave
    90 // ---------------------------------------------------------
    84 // ---------------------------------------------------------
    91 //
    85 //
    92 CBlidMainControl::CBlidMainControl(CAlfEnv& aEnv,
    86 CBlidMainControl::CBlidMainControl(CAlfEnv& aEnv, CBlidBaseView& aView) :
    93 		    				   	   CBlidBaseView& aView ) 
    87     CAlfControl(), iEnv(aEnv), iView(aView)
    94     : CAlfControl( ),iEnv(aEnv),iView(aView)
       
    95     {
    88     {
    96     iOnlineMode = EFalse;
    89     iOnlineMode = EFalse;
    97     }
    90     }
    98 
    91 
    99 // ---------------------------------------------------------
    92 // ---------------------------------------------------------
   100 // CBlidMainControl::ConstructL()
    93 // CBlidMainControl::ConstructL()
   101 // Second phase constructor, may leave
    94 // Second phase constructor, may leave
   102 // ---------------------------------------------------------
    95 // ---------------------------------------------------------
   103 //
    96 //
   104 void CBlidMainControl::ConstructL( const TRect& /*aRect*/ )
    97 void CBlidMainControl::ConstructL(const TRect& /*aRect*/)
   105     {
    98     {
   106     CAlfControl::ConstructL( iEnv );
    99     CAlfControl::ConstructL(iEnv);
   107 
   100 
   108     iMainLayout = CAlfAnchorLayout::AddNewL( *this );
   101     iMainLayout = CAlfAnchorLayout::AddNewL(*this);
   109     iSearchTextVisual = CAlfTextVisual::AddNewL( *this, iMainLayout );
   102     iSearchTextVisual = CAlfTextVisual::AddNewL(*this, iMainLayout);
   110     iAnimationVisual = CAlfImageVisual::AddNewL(*this, iMainLayout );
   103     iAnimationVisual = CAlfImageVisual::AddNewL(*this, iMainLayout);
   111     
   104 
   112     iDisplayIcon = 1;
   105     iDisplayIcon = 1;
   113     iPeriodic = CPeriodic::NewL(0); // neutral priority 
   106     iPeriodic = CPeriodic::NewL(0); // neutral priority 
   114     iPeriodic->Start( TTimeIntervalMicroSeconds32( KTimerValue ),
   107     if (!iPeriodic->IsActive())
   115                       TTimeIntervalMicroSeconds32( KTimerValue ),
   108         {
   116                       TCallBack(Tick, this));
   109         iPeriodic->Start(TTimeIntervalMicroSeconds32(KTimerValue),
   117     
   110                 TTimeIntervalMicroSeconds32(KTimerValue), TCallBack(Tick,
       
   111                         this));
       
   112         }
       
   113 
   118     UpdateDisplayLayoutL();
   114     UpdateDisplayLayoutL();
   119     CreateSearchingTextL();
   115     CreateSearchingTextL();
   120     CreateAnimationL();
   116     CreateAnimationL();
   121     UpdateAnimation();
   117     UpdateAnimation();
   122 
   118 
   123 	iLauncher = NULL;
   119     iLauncher = NULL;
   124 	isSettingsLaunched = EFalse;
   120     isSettingsLaunched = EFalse;
   125 	
   121 
   126 	//start requesting
   122     //start requesting
   127     CBlidEng* engine = iView.BlidDocument()->Engine();
   123     CBlidEng* engine = iView.BlidDocument()->Engine();
   128     iLocation = engine->LocationModel();
   124     iLocation = engine->LocationModel();
   129     }
   125     }
   130 
   126 
   131 // ---------------------------------------------------------
   127 // ---------------------------------------------------------
   133 // Timer callback function, to update image in animation
   129 // Timer callback function, to update image in animation
   134 // ---------------------------------------------------------
   130 // ---------------------------------------------------------
   135 //
   131 //
   136 TInt CBlidMainControl::Tick(TAny* aObject)
   132 TInt CBlidMainControl::Tick(TAny* aObject)
   137     {
   133     {
   138     ((CBlidMainControl*)aObject)->UpdateAnimation(); // cast, and call non-static function
   134     ((CBlidMainControl*) aObject)->UpdateAnimation(); // cast, and call non-static function
   139     return KErrNone;
   135     return KErrNone;
   140     }
   136     }
   141 
   137 
   142 // ---------------------------------------------------------
   138 // ---------------------------------------------------------
   143 // CBlidMainControl::CreateSearchingTextL()
   139 // CBlidMainControl::CreateSearchingTextL()
   144 // Function to create search text visual
   140 // Function to create search text visual
   145 // ---------------------------------------------------------
   141 // ---------------------------------------------------------
   146 //
   142 //
   147 void CBlidMainControl::CreateSearchingTextL( )
   143 void CBlidMainControl::CreateSearchingTextL()
   148 	{
   144     {
   149 	/* Layout Hierarchy
   145     /* Layout Hierarchy
   150 	main_blid2_pane -> blid2_search_pane -> blid2_search_pane_t1
   146      main_blid2_pane -> blid2_search_pane -> blid2_search_pane_t1
   151 	*/
   147      */
   152   
   148 
   153     // Get the text font
   149     // Get the text font
   154         
   150 
   155     TInt typefaceStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(EAknLogicalFontPrimarySmallFont, EAlfTextStyleNormal); 
   151     TInt typefaceStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(
   156     CAlfTextStyle* style1 = iEnv.TextStyleManager().TextStyle( typefaceStyleId );
   152             EAknLogicalFontPrimarySmallFont, EAlfTextStyleNormal);
   157     style1->SetBold( ETrue );
   153     CAlfTextStyle* style1 =
       
   154             iEnv.TextStyleManager().TextStyle(typefaceStyleId);
       
   155     style1->SetBold(ETrue);
   158     // Set the text font size in pixel
   156     // Set the text font size in pixel
   159     style1->SetTextPaneHeightInPixels( 26, ETrue );
   157     style1->SetTextPaneHeightInPixels(26, ETrue);
   160     
   158 
   161    	TRgb rgb;
   159     TRgb rgb;
   162    	// Fetch the skin color 
   160     // Fetch the skin color 
   163 	AknsUtils::GetCachedColor ( AknsUtils::SkinInstance(),
   161     AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), rgb,
   164 								rgb,
   162             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG1);
   165 								KAknsIIDQsnTextColors,
   163 
   166 								EAknsCIQsnTextColorsCG1 
   164     iSearchTextVisual->SetColor(rgb);
   167 								);
   165     HBufC* noteText = StringLoader::LoadLC(R_BLID_NOTE_SEARCHING_ANIMATION,
   168 	
   166             CEikonEnv::Static());
   169 	iSearchTextVisual->SetColor( rgb );	
   167     iSearchTextVisual->SetTextL(*noteText);
   170 	HBufC* noteText = StringLoader::LoadLC( R_BLID_NOTE_SEARCHING_ANIMATION, CEikonEnv::Static() );	
   168     iSearchTextVisual->SetTextStyle(style1->Id());
   171 	iSearchTextVisual->SetTextL( *noteText );
   169     iSearchTextVisual->SetAlign(EAlfAlignHCenter, EAlfAlignVCenter);
   172 	iSearchTextVisual->SetTextStyle( style1->Id() );
   170     CleanupStack::PopAndDestroy(noteText); //noteText
   173 	iSearchTextVisual->SetAlign( EAlfAlignHCenter, EAlfAlignVCenter );
   171 
   174 	CleanupStack::PopAndDestroy(noteText); //noteText
   172     }
   175       
       
   176 	}
       
   177 
   173 
   178 // ---------------------------------------------------------
   174 // ---------------------------------------------------------
   179 // CBlidMainControl::CreateAnimationL()
   175 // CBlidMainControl::CreateAnimationL()
   180 // Creates image visuals for animation
   176 // Creates image visuals for animation
   181 // ---------------------------------------------------------
   177 // ---------------------------------------------------------
   182 //
   178 //
   183 void CBlidMainControl::CreateAnimationL( )
   179 void CBlidMainControl::CreateAnimationL()
   184 	{
   180     {
   185 	/* Layout Hierarchy
   181     /* Layout Hierarchy
   186 	main_blid2_pane -> blid2_search_pane -> blid2_search_pane_g1
   182      main_blid2_pane -> blid2_search_pane -> blid2_search_pane_g1
   187 	*/
   183      */
   188 
   184 
   189 	// code to load svg icon
   185     // code to load svg icon
   190 	MAlfBitmapProvider* provider = NULL;
   186     MAlfBitmapProvider* provider = NULL;
   191 	
   187 
   192 	// first creste the image loader utils and then call SetSize.	
   188     // first creste the image loader utils and then call SetSize.	
   193     iView.ImageLoaderUtils()->SetSize( iAnimationRect.Size() );
   189     iView.ImageLoaderUtils()->SetSize(iAnimationRect.Size());
   194     
   190 
   195     // then create the bitmap provider  
   191     // then create the bitmap provider  
   196     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   192     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   197     												 iView.ImagePathName(),        // mif file name with path.
   193             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   198     												 EMbmBlidQgn_graf_blid_startup_01, // bitmap id defiened in mbg file
   194             iView.ImagePathName(), // mif file name with path.
   199     												 EMbmBlidQgn_graf_blid_startup_01_mask ); // bitmap mask id defiened in mbg file
   195             EMbmBlidQgn_graf_blid_startup_01, // bitmap id defiened in mbg file
   200 	// now using that bitmap provider create the texture.
   196             EMbmBlidQgn_graf_blid_startup_01_mask); // bitmap mask id defiened in mbg file
   201 	CAlfTexture & texture1 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   197     // now using that bitmap provider create the texture.
   202 	                                                                provider,
   198     CAlfTexture & texture1 = iEnv.TextureManager().CreateTextureL(
   203 	                                                                EAlfTextureFlagDefault ); 
   199             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   204     iTextures.Append(&texture1);
   200     iTextures.Append(&texture1);
   205     												 
   201 
   206     // then create the bitmap provider  
   202     // then create the bitmap provider  
   207     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   203     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   208     												 iView.ImagePathName(),        // mif file name with path.
   204             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   209     												 EMbmBlidQgn_graf_blid_startup_02, // bitmap id defiened in mbg file
   205             iView.ImagePathName(), // mif file name with path.
   210     												 EMbmBlidQgn_graf_blid_startup_02_mask ); // bitmap mask id defiened in mbg file
   206             EMbmBlidQgn_graf_blid_startup_02, // bitmap id defiened in mbg file
   211 	// now using that bitmap provider create the texture.
   207             EMbmBlidQgn_graf_blid_startup_02_mask); // bitmap mask id defiened in mbg file
   212 	CAlfTexture & texture2 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   208     // now using that bitmap provider create the texture.
   213 	                                                                provider,
   209     CAlfTexture & texture2 = iEnv.TextureManager().CreateTextureL(
   214 	                                                                EAlfTextureFlagDefault ); 
   210             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   215     iTextures.Append(&texture2);
   211     iTextures.Append(&texture2);
   216     
   212 
   217     // then create the bitmap provider  
   213     // then create the bitmap provider  
   218     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   214     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   219     												 iView.ImagePathName(),        // mif file name with path.
   215             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   220     												 EMbmBlidQgn_graf_blid_startup_03, // bitmap id defiened in mbg file
   216             iView.ImagePathName(), // mif file name with path.
   221     												 EMbmBlidQgn_graf_blid_startup_03_mask ); // bitmap mask id defiened in mbg file
   217             EMbmBlidQgn_graf_blid_startup_03, // bitmap id defiened in mbg file
   222 	// now using that bitmap provider create the texture.
   218             EMbmBlidQgn_graf_blid_startup_03_mask); // bitmap mask id defiened in mbg file
   223 	CAlfTexture & texture3 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   219     // now using that bitmap provider create the texture.
   224 	                                                                provider,
   220     CAlfTexture & texture3 = iEnv.TextureManager().CreateTextureL(
   225 	                                                                EAlfTextureFlagDefault ); 
   221             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   226     iTextures.Append(&texture3);
   222     iTextures.Append(&texture3);
   227     
   223 
   228     // then create the bitmap provider  
   224     // then create the bitmap provider  
   229     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   225     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   230     												 iView.ImagePathName(),        // mif file name with path.
   226             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   231     												 EMbmBlidQgn_graf_blid_startup_04, // bitmap id defiened in mbg file
   227             iView.ImagePathName(), // mif file name with path.
   232     												 EMbmBlidQgn_graf_blid_startup_04_mask ); // bitmap mask id defiened in mbg file
   228             EMbmBlidQgn_graf_blid_startup_04, // bitmap id defiened in mbg file
   233 	// now using that bitmap provider create the texture.
   229             EMbmBlidQgn_graf_blid_startup_04_mask); // bitmap mask id defiened in mbg file
   234 	CAlfTexture & texture4 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   230     // now using that bitmap provider create the texture.
   235 	                                                                provider,
   231     CAlfTexture & texture4 = iEnv.TextureManager().CreateTextureL(
   236 	                                                                EAlfTextureFlagDefault ); 
   232             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   237     iTextures.Append(&texture4);
   233     iTextures.Append(&texture4);
   238     
   234 
   239     // then create the bitmap provider  
   235     // then create the bitmap provider  
   240     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   236     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   241     												 iView.ImagePathName(),        // mif file name with path.
   237             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   242     												 EMbmBlidQgn_graf_blid_startup_05, // bitmap id defiened in mbg file
   238             iView.ImagePathName(), // mif file name with path.
   243     												 EMbmBlidQgn_graf_blid_startup_05_mask ); // bitmap mask id defiened in mbg file
   239             EMbmBlidQgn_graf_blid_startup_05, // bitmap id defiened in mbg file
   244 	// now using that bitmap provider create the texture.
   240             EMbmBlidQgn_graf_blid_startup_05_mask); // bitmap mask id defiened in mbg file
   245 	CAlfTexture & texture5 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   241     // now using that bitmap provider create the texture.
   246 	                                                                provider,
   242     CAlfTexture & texture5 = iEnv.TextureManager().CreateTextureL(
   247 	                                                                EAlfTextureFlagDefault ); 
   243             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   248     iTextures.Append(&texture5);
   244     iTextures.Append(&texture5);
   249     
   245 
   250     // then create the bitmap provider  
   246     // then create the bitmap provider  
   251     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   247     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   252     												 iView.ImagePathName(),        // mif file name with path.
   248             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   253     												 EMbmBlidQgn_graf_blid_startup_06, // bitmap id defiened in mbg file
   249             iView.ImagePathName(), // mif file name with path.
   254     												 EMbmBlidQgn_graf_blid_startup_06_mask ); // bitmap mask id defiened in mbg file
   250             EMbmBlidQgn_graf_blid_startup_06, // bitmap id defiened in mbg file
   255 	// now using that bitmap provider create the texture.
   251             EMbmBlidQgn_graf_blid_startup_06_mask); // bitmap mask id defiened in mbg file
   256 	CAlfTexture & texture6 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   252     // now using that bitmap provider create the texture.
   257 	                                                                provider,
   253     CAlfTexture & texture6 = iEnv.TextureManager().CreateTextureL(
   258 	                                                                EAlfTextureFlagDefault ); 
   254             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   259     iTextures.Append(&texture6);
   255     iTextures.Append(&texture6);
   260     
   256 
   261     // then create the bitmap provider  
   257     // then create the bitmap provider  
   262     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   258     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   263     												 iView.ImagePathName(),        // mif file name with path.
   259             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   264     												 EMbmBlidQgn_graf_blid_startup_07, // bitmap id defiened in mbg file
   260             iView.ImagePathName(), // mif file name with path.
   265     												 EMbmBlidQgn_graf_blid_startup_07_mask ); // bitmap mask id defiened in mbg file
   261             EMbmBlidQgn_graf_blid_startup_07, // bitmap id defiened in mbg file
   266 	// now using that bitmap provider create the texture.
   262             EMbmBlidQgn_graf_blid_startup_07_mask); // bitmap mask id defiened in mbg file
   267 	CAlfTexture & texture7 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   263     // now using that bitmap provider create the texture.
   268 	                                                                provider,
   264     CAlfTexture & texture7 = iEnv.TextureManager().CreateTextureL(
   269 	                                                                EAlfTextureFlagDefault ); 
   265             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   270     iTextures.Append(&texture7);
   266     iTextures.Append(&texture7);
   271     
   267 
   272     // then create the bitmap provider  
   268     // then create the bitmap provider  
   273     provider = iView.ImageLoaderUtils()->CreateImageLoaderL( KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   269     provider = iView.ImageLoaderUtils()->CreateImageLoaderL(
   274     												 iView.ImagePathName(),        // mif file name with path.
   270             KAknsIIDQgnGrafBlidStartup, // svg icon skin constant id defiened in Aknsconstant.h file
   275     												 EMbmBlidQgn_graf_blid_startup_08, // bitmap id defiened in mbg file
   271             iView.ImagePathName(), // mif file name with path.
   276     												 EMbmBlidQgn_graf_blid_startup_08_mask ); // bitmap mask id defiened in mbg file
   272             EMbmBlidQgn_graf_blid_startup_08, // bitmap id defiened in mbg file
   277 	// now using that bitmap provider create the texture.
   273             EMbmBlidQgn_graf_blid_startup_08_mask); // bitmap mask id defiened in mbg file
   278 	CAlfTexture & texture8 = iEnv.TextureManager().CreateTextureL( KAlfAutoGeneratedTextureId,
   274     // now using that bitmap provider create the texture.
   279 	                                                                provider,
   275     CAlfTexture & texture8 = iEnv.TextureManager().CreateTextureL(
   280 	                                                                EAlfTextureFlagDefault ); 
   276             KAlfAutoGeneratedTextureId, provider, EAlfTextureFlagDefault);
   281     iTextures.Append(&texture8);
   277     iTextures.Append(&texture8);
   282 
   278 
   283 	}
   279     }
   284 
   280 
   285 // ---------------------------------------------------------
   281 // ---------------------------------------------------------
   286 // CBlidMainControl::UpdateAnimation
   282 // CBlidMainControl::UpdateAnimation
   287 // updates the animation image
   283 // updates the animation image
   288 // ---------------------------------------------------------
   284 // ---------------------------------------------------------
   289 //
   285 //
   290 void CBlidMainControl::UpdateAnimation()
   286 void CBlidMainControl::UpdateAnimation()
   291 {
   287     {
   292     if(KNumOfStartUpIcon > iDisplayIcon)
   288     if (KNumOfStartUpIcon > iDisplayIcon)
   293         {
   289         {
   294         iDisplayIcon++;
   290         iDisplayIcon++;
   295         }
   291         }
   296     else
   292     else
   297         {
   293         {
   298         iDisplayIcon = 1;
   294         iDisplayIcon = 1;
   299         }
   295         }
   300     iAnimationVisual->SetImage( TAlfImage( *iTextures[iDisplayIcon-1] ) );//N   
   296     iAnimationVisual->SetImage(TAlfImage(*iTextures[iDisplayIcon - 1]));//N   
   301 }
   297     }
   302 
   298 
   303 // ----------------------------------------------------
   299 // ----------------------------------------------------
   304 // CBlidMainControl::~CBlidMainControl
   300 // CBlidMainControl::~CBlidMainControl
   305 // Destructor
   301 // Destructor
   306 // Frees reserved resources
   302 // Frees reserved resources
   309 CBlidMainControl::~CBlidMainControl()
   305 CBlidMainControl::~CBlidMainControl()
   310     {
   306     {
   311     iTextures.Reset();
   307     iTextures.Reset();
   312     iTextures.Close();
   308     iTextures.Close();
   313     delete iLauncher;
   309     delete iLauncher;
   314 	delete iHeadPaneText;
   310     delete iHeadPaneText;
   315 	delete iMsgQueryText;
   311     delete iMsgQueryText;
   316 	delete iLinkText;
   312     delete iLinkText;
   317 	delete iMsgQText;
   313     delete iMsgQText;
   318 	delete iPeriodic;
   314     delete iPeriodic;
   319     }    
   315     }
   320     
   316 
   321 	
       
   322 // ---------------------------------------------------------
   317 // ---------------------------------------------------------
   323 // CBlidMainControl::UpdateL
   318 // CBlidMainControl::UpdateL
   324 // Updates the view after getting update from location model
   319 // Updates the view after getting update from location model
   325 // ---------------------------------------------------------
   320 // ---------------------------------------------------------
   326 //
   321 //
   327 void CBlidMainControl::UpdateL()
   322 void CBlidMainControl::UpdateL()
   328     {
   323     {
   329     TInt result = 0;
   324     TInt result = 0;
   330     DEBUG1(" CBlidMainControl::UpdateL iErrorCode ::%d", iErrorCode );
   325     DEBUG1(" CBlidMainControl::UpdateL iErrorCode ::%d", iErrorCode );
   331     
   326 
   332     if( !iView.IsSatViewActive() && iOnlineMode )
   327     if (!iView.IsSatViewActive() && iOnlineMode)
   333 	    {
   328         {
   334 		iView.ActivateSatelliteViewL();	    	
   329 
   335 	    }
   330         if (iView.IsForeGroundApp())
   336 	else if( iErrorCode != KErrNone )
   331             {
   337 		{
   332             iView.ActivateSatelliteViewL();
   338 	    // Check GPS device availability
   333             }
   339 	    TInt retVal = iLocation->CheckGPSAvailability(); 
   334         }
   340 	    DEBUG1(" CBlidMainControl::CheckGPSAvailability code ::%d", retVal );
   335     TInt retVal = iLocation->CheckGPSAvailability();
   341 	    switch(iErrorCode)
   336     // Check GPS device availability
   342 	        {
   337     DEBUG1(" CBlidMainControl::CheckGPSAvailability code ::%d", retVal );
   343             case KErrTimedOut:        
   338     switch (iErrorCode)
   344                 {	
   339         {
   345                 if( retVal == 1 )
   340         case KErrTimedOut:
       
   341             {
       
   342             if (retVal == 1)
       
   343                 {
       
   344                 /* 
       
   345                  GPS device connected but position information
       
   346                  available but not of good quality
       
   347                  */
       
   348                 if (iView.IsForeGroundApp())
   346                     {
   349                     {
   347                     /* 
   350                     iView.ActivateSatelliteViewL();
   348                      GPS device connected but position information
       
   349                      available but not of good quality
       
   350                     */
       
   351                     iView.ActivateSatelliteViewL();                
       
   352                     }
   351                     }
   353                 break;                    
   352                 break;
   354                 }
   353                 }
   355 	        case KErrArgument: 
   354             case KErrNotFound:
   356 	        // The positioning module is unable to support the requested type
   355             // No module (PSY) selected or invalid PSY
   357 	        case KErrNotFound:
   356                 {
   358 	        // No module (PSY) selected or invalid PSY
   357                 iOnlineMode = EFalse;
   359 	            {
   358                 // Notify not module selected
   360 	            iOnlineMode = EFalse;
   359                 //            if (iPSYTimeoutCount == 0)
   361 	            // Notify not module selected
   360                 //                {
   362 	            if(iPSYTimeoutCount == 0)
   361                 if (iView.IsForeGroundApp())
   363 	            	{
   362                     {
   364 	            	if( iView.IsForeGroundApp() )
   363                     iLocation->StopRequesting();
   365 	                    {
   364                     TCallBack callback(MessageQueryCallBack, this);
   366 	                    iLocation->StopRequesting();
   365                     result
   367 	                    TCallBack callback( MessageQueryCallBack, this );
   366                             = DispMsgQueryWithLinkL(R_BLID_NOPSY_ENABLED,
   368 	            		result = DispMsgQueryWithLinkL(R_BLID_NOPSY_ENABLED,
   367                                     R_BLID_ERROR_NO_PSY,
   369 											 		  R_BLID_ERROR_NO_PSY,
   368                                     R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   370 											 		  R_BLID_SELECT_POSITIONING_METHOD,
   369                                     callback);
   371 											 		  ETrue,
   370                     if (result == EBlidSoftkeyRetry)
   372 											 		  callback );
   371                         {
   373 						if( result == EBlidSoftkeyRetry )    											 		  
   372                         iLocation->StartRequesting();
   374 		            		{
   373                         }
   375 							iLocation->StartRequesting();
   374                     else if (result == EAknSoftkeyOk)
   376 		            		}
   375                         {
   377 						else if( result != KErrNotFound )
   376                         iView.ExitMainApplicationL(EEikCmdExit);
   378 							{
   377                         }
   379 		            		iView.ExitMainApplicationL( EEikCmdExit );								
   378                     }
   380 							}		            		
   379                 break;
   381 	                    }
   380                 }
   382 	            	}
   381             case KPositionPartialUpdate:
   383 
   382                 {
   384 	            iPSYTimeoutCount++;
   383                 if (iView.IsForeGroundApp())
   385 	            TInt currentInterval;
   384                     {
   386 	            iLocation->GetCurrentUpdateInterval(currentInterval);
   385                     iView.ActivateSatelliteViewL();
   387 	            if(iPSYTimeoutCount*currentInterval >= KNotesTimeOut)
   386                     }
   388 	                {
   387                 break;
   389 	                iPSYTimeoutCount = 0;                
   388                 }
   390 	                }
   389             case KErrArgument:
   391 	            return;            
   390             // The positioning module is unable to support the requested type
   392 	            }
   391             default:
   393 	        case KPositionPartialUpdate:
   392                 {
   394 		        {
   393                 iOnlineMode = EFalse;
   395 		        iView.ActivateSatelliteViewL();
   394 
   396 		        break;	
   395                 if (retVal == 0)
   397 		        }
   396                     {
   398 	        default:
   397                     if (iLocation->IsSatCapablePsyAvailable())
   399 	            {
   398                         {
   400 	            iOnlineMode = EFalse;
   399                         iLocation->StopRequesting();
   401 	            break;
   400                         iOnlineMode = EFalse;
   402 	            }
   401                         TCallBack callback(MessageQueryCallBack, this);
   403 	        }
   402                         result = DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   404 	        
   403                                 R_BLID_NOGPS_FOUND_TEXT,
   405 	    if(iErrorCode != KErrNotFound)
   404                                 R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   406 	    	{
   405                                 callback);
   407 	    	if ( retVal == 0 )
   406                         if (result == EBlidSoftkeyRetry)
   408 		        {
   407                             {
   409 		        if( iLocation->IsSatCapablePsyAvailable() )
   408                             iLocation->StartRequesting();
   410 			        {
   409                             }
   411 			        iLocation->StopRequesting();
   410                         else if (result == EAknSoftkeyOk)
   412             		iOnlineMode = EFalse;
   411                             {
   413             		TCallBack callback( MessageQueryCallBack, this );
   412                             iView.ExitMainApplicationL(EEikCmdExit);
   414             		result = DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   413                             }
   415 										 		  R_BLID_NOGPS_FOUND_TEXT,
   414                         }
   416 										 		  R_BLID_SELECT_POSITIONING_METHOD,
   415                     // no GPS device note
   417 										 		  ETrue,
   416                     // GPS un-available
   418 										 		  callback );
   417                     else if (iView.IsForeGroundApp())
   419 					if( result == EBlidSoftkeyRetry )    											 		  
   418                         {
   420 	            		{
   419                         iLocation->StopRequesting();
   421 	            		iLocation->StartRequesting();
   420                         TCallBack callback(MessageQueryCallBack, this);
   422 	            		}
   421                         DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   423 					else if( result != KErrNotFound )
   422                                 R_BLID_NOGPS_AVAILABLE_TEXT,
   424 						{
   423                                 R_BLID_SELECT_POSITIONING_METHOD, EFalse,
   425 	            		iView.ExitMainApplicationL( EEikCmdExit );								
   424                                 callback);
   426 						}		            		
   425                         iView.ExitMainApplicationL(EEikCmdExit);
   427 			        }
   426                         }
   428 		        // no GPS device note
   427                     else
   429 		        else if(iErrorCode != KErrNotFound)
   428                         {
   430 		        	{
   429                         BlidNotes::iGPSUnavailableDisplayed = ETrue;
   431 			        // GPS un-available
   430                         }
   432 			        if( iView.IsForeGroundApp() )
   431                     CBlidBaseContainer::SetGPSAvailability(EFalse);
   433 			            {
   432                     }
   434 						iLocation->StopRequesting();
   433                 break;
   435 						TCallBack callback( MessageQueryCallBack, this );
   434 
   436 	            		DispMsgQueryWithLinkL( R_BLID_NOGPS_FOUND,
   435                 }
   437 											 R_BLID_NOGPS_AVAILABLE_TEXT,
   436             }
   438 											 R_BLID_SELECT_POSITIONING_METHOD,
   437         }
   439 											 EFalse,
   438     }
   440 											 callback );
   439 
   441 	            		iView.ExitMainApplicationL( EEikCmdExit );	
       
   442 			            }        
       
   443 		        	}
       
   444 		        else
       
   445 		        	{
       
   446 		        	BlidNotes::iGPSUnavailableDisplayed = ETrue;
       
   447 		        	}
       
   448 		        CBlidBaseContainer::SetGPSAvailability(EFalse);
       
   449 		        }
       
   450 	    	}   
       
   451 		}
       
   452     }
       
   453     
       
   454 // ----------------------------------------------------
   440 // ----------------------------------------------------
   455 // CBlidMainControl::MakeTitleL
   441 // CBlidMainControl::MakeTitleL
   456 // Sets the title to string represented by resource
   442 // Sets the title to string represented by resource
   457 // ----------------------------------------------------
   443 // ----------------------------------------------------
   458 //
   444 //
   459 void CBlidMainControl::MakeTitleL( TInt aResourceText )
   445 void CBlidMainControl::MakeTitleL(TInt aResourceText)
   460     {
   446     {
   461     HBufC* buffer = StringLoader::LoadLC( aResourceText );       
   447     HBufC* buffer = StringLoader::LoadLC(aResourceText);
   462     CAknTitlePane* title = static_cast<CAknTitlePane*>( StatusPane()->
   448     CAknTitlePane* title =
   463                             ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
   449             static_cast<CAknTitlePane*> (StatusPane()-> ControlL(TUid::Uid(
       
   450                     EEikStatusPaneUidTitle)));
   464     CleanupStack::Pop(); //buffer
   451     CleanupStack::Pop(); //buffer
   465     title->SetText( buffer ); // Takes ownership of buf
   452     title->SetText(buffer); // Takes ownership of buf
   466     } 
   453     }
   467     
   454 
   468 // ----------------------------------------------------
   455 // ----------------------------------------------------
   469 // CBlidMainControl::StatusPane
   456 // CBlidMainControl::StatusPane
   470 // Returns the status pane
   457 // Returns the status pane
   471 // ----------------------------------------------------
   458 // ----------------------------------------------------
   472 //
   459 //
   473 CEikStatusPane* CBlidMainControl::StatusPane() const 
   460 CEikStatusPane* CBlidMainControl::StatusPane() const
   474     {
   461     {
   475     return CEikonEnv::Static()->AppUiFactory()->StatusPane();
   462     return CEikonEnv::Static()->AppUiFactory()->StatusPane();
   476     }
   463     }
   477     
   464 
   478 // ----------------------------------------------------
   465 // ----------------------------------------------------
   479 // CBlidMainControl::SetErrorCode
   466 // CBlidMainControl::SetErrorCode
   480 // Sets the error code
   467 // Sets the error code
   481 // ----------------------------------------------------
   468 // ----------------------------------------------------
   482 //
   469 //
   483 void CBlidMainControl::SetErrorCode( const TInt aErrorCode )
   470 void CBlidMainControl::SetErrorCode(const TInt aErrorCode)
   484 	{
   471     {
   485 	iErrorCode = aErrorCode;	
   472     iErrorCode = aErrorCode;
   486 	}
   473     }
   487 	
   474 
   488 // ----------------------------------------------------
   475 // ----------------------------------------------------
   489 // CBlidMainControl::SetOnlineMode
   476 // CBlidMainControl::SetOnlineMode
   490 // Sets the online mode
   477 // Sets the online mode
   491 // ----------------------------------------------------
   478 // ----------------------------------------------------
   492 //
   479 //
   493 void CBlidMainControl::SetOnlineMode( const TBool aOnlineMode )
   480 void CBlidMainControl::SetOnlineMode(const TBool aOnlineMode)
   494 	{
   481     {
   495 	iOnlineMode = aOnlineMode;	
   482     iOnlineMode = aOnlineMode;
   496 	}
   483     }
   497 	
   484 
   498 // ----------------------------------------------------
   485 // ----------------------------------------------------
   499 // CBlidMainControl::DispMsgQueryWithLinkL()
   486 // CBlidMainControl::DispMsgQueryWithLinkL()
   500 // Displays the message query with a link
   487 // Displays the message query with a link
   501 // ----------------------------------------------------
   488 // ----------------------------------------------------
   502 //
   489 //
   503 TInt CBlidMainControl::DispMsgQueryWithLinkL( TInt aHeadingText,
   490 TInt CBlidMainControl::DispMsgQueryWithLinkL(TInt aHeadingText,
   504 											 TInt aMsgQueryText,
   491         TInt aMsgQueryText, TInt aLinkText, TBool aLinkShow,
   505 											 TInt aLinkText,
   492         TCallBack aCallBack)
   506 											 TBool aLinkShow,
   493     {
   507 											 TCallBack aCallBack )
   494     CEikonEnv* env = CEikonEnv::Static();
   508 	{
   495     if (!iHeadPaneText)
   509 	CEikonEnv* env = CEikonEnv::Static();
   496         {
   510 	if( !iHeadPaneText )
   497         iHeadPaneText = env->AllocReadResourceL(aHeadingText);
   511 		{
   498         }
   512 		iHeadPaneText = env->AllocReadResourceL( aHeadingText );
   499 
   513 		}
   500     if (!iMsgQueryText)
   514 
   501         {
   515 	if( !iMsgQueryText )
   502         iMsgQueryText = env->AllocReadResourceL(aMsgQueryText);
   516 		{
   503         }
   517 		iMsgQueryText = env->AllocReadResourceL( aMsgQueryText );
   504 
   518 		}
   505     if (!iLinkText)
   519 
   506         {
   520 	if( !iLinkText )
   507         iLinkText = env->AllocReadResourceL(aLinkText);
   521 		{
   508         }
   522 		iLinkText = env->AllocReadResourceL( aLinkText );
   509 
   523 		}
   510     if (!iMsgQText)
   524 
   511         {
   525 	if( !iMsgQText )
   512         iMsgQText = HBufC::NewL(iMsgQueryText->Length() + KNewLine().Length()
   526 		{
   513                 + KOpeningLinkTag().Length() + iLinkText->Length()
   527 		iMsgQText = HBufC::NewL ( iMsgQueryText->Length() + 
   514                 + KClosingLinkTag().Length());
   528 					 					 KNewLine().Length() + KOpeningLinkTag().Length() + 
   515         }
   529 					 					 iLinkText->Length() + KClosingLinkTag().Length() ) ;
   516 
   530 		}
   517     iMsgQText->Des().Copy(*iMsgQueryText);
   531 	
       
   532 	iMsgQText->Des().Copy(*iMsgQueryText);
       
   533     iMsgQText->Des().Append(KNewLine);
   518     iMsgQText->Des().Append(KNewLine);
   534 	if( aLinkShow )
   519     if (aLinkShow)
   535 		{
   520         {
   536 		iMsgQText->Des().Append( KOpeningLinkTag );
   521         iMsgQText->Des().Append(KOpeningLinkTag);
   537 		iMsgQText->Des().Append(*iLinkText);
   522         iMsgQText->Des().Append(*iLinkText);
   538 		iMsgQText->Des().Append( KClosingLinkTag );
   523         iMsgQText->Des().Append(KClosingLinkTag);
   539 		}
   524         }
   540 	else
   525     else
   541 		{
   526         {
   542 		iMsgQText->Des().Append(_L( " "));
   527         iMsgQText->Des().Append(_L( " "));
   543 		}
   528         }
   544 	//////////////////////////////////////////////////////
   529     //////////////////////////////////////////////////////
   545     CAknMessageQueryDialog* msgDlg = CAknMessageQueryDialog::NewL( *iMsgQText );	
   530     CAknMessageQueryDialog* msgDlg = CAknMessageQueryDialog::NewL(*iMsgQText);
   546 	
   531 
   547 	// if we remove this if part it will give CONE8 panic
   532     // if we remove this if part it will give CONE8 panic
   548 	if( iDialog )	
   533     if (iDialog)
   549 		{
   534         {
   550 		delete iDialog;
   535         delete iDialog;
   551 		iDialog = NULL;			
   536         iDialog = NULL;
   552 		}
   537         }
   553 		
   538 
   554 	iDialog = msgDlg;
   539     iDialog = msgDlg;
   555     
   540 
   556     msgDlg->PrepareLC( R_BLID_MESSAGE_QUERY_DIALOG );  // Pushed dialog is popped inside RunLD
   541     msgDlg->PrepareLC(R_BLID_MESSAGE_QUERY_DIALOG); // Pushed dialog is popped inside RunLD
   557 
   542 
   558     msgDlg->Heading()->SetTextL( *iHeadPaneText );
   543     msgDlg->Heading()->SetTextL(*iHeadPaneText);
   559 
   544 
   560 	msgDlg->SetLink(aCallBack);
   545     msgDlg->SetLink(aCallBack);
   561 
   546 
   562 
   547     msgDlg->ButtonGroupContainer().SetCommandSetL(
   563    	msgDlg->ButtonGroupContainer().SetCommandSetL( 
   548             R_BLID_INFOPOPUP_SOFTKEYS_RETRY__EXIT);
   564     	                                  R_BLID_INFOPOPUP_SOFTKEYS_RETRY__EXIT );
   549     isDialogLaunched = ETrue;
   565 	isDialogLaunched = ETrue;
   550     TInt retval = msgDlg->RunLD();
   566 	TInt retval = msgDlg->RunLD();
   551     if (isDialogLaunched)
   567 	if( isDialogLaunched )
   552         {
   568 		{
   553         msgDlg = NULL;
   569 	    msgDlg = NULL;
   554         iDialog = NULL;
   570 	    iDialog = NULL;
   555         isDialogLaunched = EFalse;
   571 	    isDialogLaunched = EFalse;
   556         return retval;
   572 	    return retval;
   557         }
   573 		}
   558     return -1;
   574 	return -1;
   559     }
   575 	}
       
   576 
   560 
   577 // ----------------------------------------------------
   561 // ----------------------------------------------------
   578 // CBlidMainControl::CreateNaviPaneL
   562 // CBlidMainControl::CreateNaviPaneL
   579 // Creates navigation pane
   563 // Creates navigation pane
   580 // ----------------------------------------------------
   564 // ----------------------------------------------------
   581 //
   565 //
   582 void CBlidMainControl::CreateNaviPaneL( )
   566 void CBlidMainControl::CreateNaviPaneL()
   583     {
   567     {
   584     CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane();
   568     CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane();
   585     // Fetch pointer to the default navi pane control
   569     // Fetch pointer to the default navi pane control
   586     CAknNavigationControlContainer* naviPane = 
   570     CAknNavigationControlContainer* naviPane =
   587         static_cast<CAknNavigationControlContainer*>(sp->ControlL( 
   571             static_cast<CAknNavigationControlContainer*> (sp->ControlL(
   588         TUid::Uid(EEikStatusPaneUidNavi)));
   572                     TUid::Uid(EEikStatusPaneUidNavi)));
   589     
   573 
   590     naviPane->PushDefaultL(EFalse);
   574     naviPane->PushDefaultL(EFalse);
   591     }
   575     }
   592 
   576 
   593 // ----------------------------------------------------
   577 // ----------------------------------------------------
   594 // CBlidMainControl::LaunchPositioningSettingsViewL
   578 // CBlidMainControl::LaunchPositioningSettingsViewL
   595 // Launches positioning settings view
   579 // Launches positioning settings view
   596 // ----------------------------------------------------
   580 // ----------------------------------------------------
   597 //
   581 //
   598 void CBlidMainControl::LaunchPositioningSettingsViewL( )
   582 void CBlidMainControl::LaunchPositioningSettingsViewL()
   599 	{
   583     {
   600 	if(!iLauncher )
   584     if (!iLauncher)
   601 		{
   585         {
   602 		iLauncher = CBlidLocSettingsLauncher::NewL();        		
   586         iLauncher = CBlidLocSettingsLauncher::NewL();
   603 		}
   587         }
   604 	iLauncher->SetControl( this );
   588     iLauncher->SetControl(this);
   605 	isSettingsLaunched = ETrue;
   589     isSettingsLaunched = ETrue;
   606 	iLauncher->LaunchL();
   590     iLauncher->LaunchL();
   607 	}
   591     }
   608 
   592 
   609 // ----------------------------------------------------
   593 // ----------------------------------------------------
   610 // CBlidMainControl::DeleteDialogResource
   594 // CBlidMainControl::DeleteDialogResource
   611 // Seletes the dialog resources
   595 // Seletes the dialog resources
   612 // ----------------------------------------------------
   596 // ----------------------------------------------------
   613 //
   597 //
   614 void CBlidMainControl::DeleteDialogResource( )
   598 void CBlidMainControl::DeleteDialogResource()
   615 	{
   599     {
   616 	if( isSettingsLaunched )
   600     if (isSettingsLaunched)
   617 		{
   601         {
   618 		delete iHeadPaneText;
   602         delete iHeadPaneText;
   619 		iHeadPaneText = NULL;
   603         iHeadPaneText = NULL;
   620 		
   604 
   621 		delete iMsgQueryText;
   605         delete iMsgQueryText;
   622 		iMsgQueryText = NULL;
   606         iMsgQueryText = NULL;
   623 		
   607 
   624 		delete iLinkText;
   608         delete iLinkText;
   625 		iLinkText = NULL;
   609         iLinkText = NULL;
   626 		
   610 
   627 		delete iMsgQText;
   611         delete iMsgQText;
   628 		iMsgQText = NULL;
   612         iMsgQText = NULL;
   629 		}
   613         }
   630 	}
   614     }
   631 
   615 
   632 // ----------------------------------------------------
   616 // ----------------------------------------------------
   633 // CBlidMainControl::UpdateDisplayLayoutL
   617 // CBlidMainControl::UpdateDisplayLayoutL
   634 // Updates the display layout in response to a change in app resource
   618 // Updates the display layout in response to a change in app resource
   635 // ----------------------------------------------------
   619 // ----------------------------------------------------
   636 //
   620 //
   637 void CBlidMainControl::UpdateDisplayLayoutL( )
   621 void CBlidMainControl::UpdateDisplayLayoutL()
   638 	{
   622     {
   639 	/* Layout Hierarchy
   623     /* Layout Hierarchy
   640 	main_blid2_pane -> blid2_search_pane -> blid2_search_pane_t1
   624      main_blid2_pane -> blid2_search_pane -> blid2_search_pane_t1
   641 	
   625      
   642 	main_blid2_pane -> blid2_search_pane -> blid2_search_pane_g1
   626      main_blid2_pane -> blid2_search_pane -> blid2_search_pane_g1
   643 	*/
   627      */
   644 	
   628 
   645 	TAknLayoutRect mainBlid2Pane;
   629     TAknLayoutRect mainBlid2Pane;
   646 	TAknLayoutRect blid2SearchPane;
   630     TAknLayoutRect blid2SearchPane;
   647 	TAknLayoutRect blid2SearchPaneG1;
   631     TAknLayoutRect blid2SearchPaneG1;
   648 	TAknLayoutText blid2SearchPaneT1;
   632     TAknLayoutText blid2SearchPaneT1;
   649 	//TRect animationRect;	
   633     //TRect animationRect;	
   650 	TInt variety;
   634     TInt variety;
   651 
   635 
   652 	if( Layout_Meta_Data::IsLandscapeOrientation() )
   636     if (Layout_Meta_Data::IsLandscapeOrientation())
   653 	    {
   637         {
   654 	    variety = 1;
   638         variety = 1;
   655 	    }
   639         }
   656 	 else
   640     else
   657 	 	{
   641         {
   658 	 	variety = 0;
   642         variety = 0;
   659 	 	}
   643         }
   660     /////////////// recalculate text rect /////////////////////////
   644     /////////////// recalculate text rect /////////////////////////
   661     TRect rect;
   645     TRect rect;
   662     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
   646     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
   663     mainBlid2Pane.LayoutRect( rect,
   647     mainBlid2Pane.LayoutRect(rect,
   664     							AknLayoutScalable_Apps::main_blid2_pane().LayoutLine() );
   648             AknLayoutScalable_Apps::main_blid2_pane().LayoutLine());
   665 													   
   649 
   666     blid2SearchPane.LayoutRect( mainBlid2Pane.Rect(), 
   650     blid2SearchPane.LayoutRect(mainBlid2Pane.Rect(),
   667     							AknLayoutScalable_Apps::blid2_search_pane( variety ).LayoutLine() );							
   651             AknLayoutScalable_Apps::blid2_search_pane(variety).LayoutLine());
   668 	
   652 
   669 	blid2SearchPaneT1.LayoutText( blid2SearchPane.Rect(),
   653     blid2SearchPaneT1.LayoutText(
   670 								AknLayoutScalable_Apps::blid2_search_pane_t1( variety ).LayoutLine() );
   654             blid2SearchPane.Rect(),
   671 								
   655             AknLayoutScalable_Apps::blid2_search_pane_t1(variety).LayoutLine());
   672 	/////////////// recalculate animation rect /////////////////////////
   656 
   673 	blid2SearchPaneG1.LayoutRect( blid2SearchPane.Rect(), 
   657     /////////////// recalculate animation rect /////////////////////////
   674     							AknLayoutScalable_Apps::blid2_search_pane_g1( variety ).LayoutLine() );
   658     blid2SearchPaneG1.LayoutRect(
   675 	iAnimationRect = blid2SearchPaneG1.Rect();								     																	
   659             blid2SearchPane.Rect(),
   676      
   660             AknLayoutScalable_Apps::blid2_search_pane_g1(variety).LayoutLine());
   677 		
   661     iAnimationRect = blid2SearchPaneG1.Rect();
   678 	TAlfRealPoint topTextPoint( blid2SearchPaneT1.TextRect().iTl );
   662 
   679 	TAlfRealPoint bottomTextPoint( blid2SearchPaneT1.TextRect().iBr );
   663     TAlfRealPoint topTextPoint(blid2SearchPaneT1.TextRect().iTl);
   680 	
   664     TAlfRealPoint bottomTextPoint(blid2SearchPaneT1.TextRect().iBr);
   681 	//Anchor for searching Text	
   665 
   682     iMainLayout->SetAnchor( EAlfAnchorTopLeft, 0, 
   666     //Anchor for searching Text	
   683         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   667     iMainLayout->SetAnchor(EAlfAnchorTopLeft, 0, EAlfAnchorOriginLeft,
   684         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   668             EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute,
   685         TAlfTimedPoint( topTextPoint.iX, topTextPoint.iY ) );
   669             EAlfAnchorMetricAbsolute, TAlfTimedPoint(topTextPoint.iX,
   686     iMainLayout->SetAnchor( EAlfAnchorBottomRight, 0, 
   670                     topTextPoint.iY));
   687         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   671     iMainLayout->SetAnchor(EAlfAnchorBottomRight, 0, EAlfAnchorOriginLeft,
   688         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   672             EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute,
   689         TAlfTimedPoint( bottomTextPoint.iX, bottomTextPoint.iY ) );	
   673             EAlfAnchorMetricAbsolute, TAlfTimedPoint(bottomTextPoint.iX,
   690 
   674                     bottomTextPoint.iY));
   691 
   675 
   692 	TAlfRealPoint topAnimationPoint( iAnimationRect.iTl );
   676     TAlfRealPoint topAnimationPoint(iAnimationRect.iTl);
   693 	TAlfRealPoint bottomAnimationPoint( iAnimationRect.iBr );
   677     TAlfRealPoint bottomAnimationPoint(iAnimationRect.iBr);
   694 	
   678 
   695 	//Anchor for animation	
   679     //Anchor for animation	
   696     iMainLayout->SetAnchor( EAlfAnchorTopLeft, 1, 
   680     iMainLayout->SetAnchor(EAlfAnchorTopLeft, 1, EAlfAnchorOriginLeft,
   697         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   681             EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute,
   698         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   682             EAlfAnchorMetricAbsolute, TAlfTimedPoint(topAnimationPoint.iX,
   699         TAlfTimedPoint( topAnimationPoint.iX, topAnimationPoint.iY ) );
   683                     topAnimationPoint.iY));
   700     iMainLayout->SetAnchor( EAlfAnchorBottomRight, 1, 
   684     iMainLayout->SetAnchor(EAlfAnchorBottomRight, 1, EAlfAnchorOriginLeft,
   701         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   685             EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute,
   702         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   686             EAlfAnchorMetricAbsolute, TAlfTimedPoint(bottomAnimationPoint.iX,
   703         TAlfTimedPoint( bottomAnimationPoint.iX, bottomAnimationPoint.iY ) );	
   687                     bottomAnimationPoint.iY));
   704 				
   688 
   705 	}
   689     }
   706 	
   690 
   707 // -----------------------------------------------------------------------------
   691 // -----------------------------------------------------------------------------
   708 // CBlidMainControl::MessageQueryCallBack()
   692 // CBlidMainControl::MessageQueryCallBack()
   709 // Called when link is clicked on message query dialog
   693 // Called when link is clicked on message query dialog
   710 // -----------------------------------------------------------------------------
   694 // -----------------------------------------------------------------------------
   711 //
   695 //
   712 TInt MessageQueryCallBack( TAny* aPtr )
   696 TInt MessageQueryCallBack(TAny* aPtr)
   713 	{
   697     {
   714     CBlidMainControl* ptr = static_cast<CBlidMainControl*>(aPtr);	
   698     CBlidMainControl* ptr = static_cast<CBlidMainControl*> (aPtr);
   715 	if( ptr )
   699     if (ptr)
   716 		{
   700         {
   717 		TRAP_IGNORE( ptr->LaunchPositioningSettingsViewL() );
   701         TRAP_IGNORE( ptr->LaunchPositioningSettingsViewL() );
   718 		if( ptr->iDialog )
   702         if (ptr->iDialog)
   719 			{
   703             {
   720 			TRAP_IGNORE( ptr->iDialog->ProcessCommandL( 3001 ) );
   704             TRAP_IGNORE( ptr->iDialog->ProcessCommandL( 3001 ) );
   721 			}
   705             }
   722 		}
   706         }
   723 	return KErrNone;	
   707     return KErrNone;
   724 	}
   708     }
   725 //End Of File
   709 //End Of File
   726 
   710