idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp
changeset 1 5315654608de
parent 0 f72a12da539e
child 2 08c6ee43b396
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
    21 #include <AknSkinsInternalCRKeys.h>
    21 #include <AknSkinsInternalCRKeys.h>
    22 #include <StringLoader.h>
    22 #include <StringLoader.h>
    23 #include <xnuiengine.rsg>
    23 #include <xnuiengine.rsg>
    24 #include <aknnotewrappers.h>
    24 #include <aknnotewrappers.h>
    25 
    25 
    26 #if 0 // MSK icon change
       
    27 #include <AknsConstants.h>
    26 #include <AknsConstants.h>
    28 #include <avkon.mbg>
       
    29 #endif // MSK icon change
       
    30 
    27 
    31 // User includes
    28 // User includes
    32 #include "xnapplication.h"
    29 #include "xnapplication.h"
    33 #include "xnuiengine.h"
    30 #include "xnuiengine.h"
    34 #include "xnproperty.h"
    31 #include "xnproperty.h"
    54 #include "xnnodepluginif.h"
    51 #include "xnnodepluginif.h"
    55 #include "xnoomsyshandler.h"
    52 #include "xnoomsyshandler.h"
    56 
    53 
    57 // Constants
    54 // Constants
    58 _LIT8( KEmptyWidgetUid, "0x2001f47f" );
    55 _LIT8( KEmptyWidgetUid, "0x2001f47f" );
    59 _LIT8( KViewSwitcherText, "switcher_text" );
       
    60 _LIT8( KStateError, "Error" );
    56 _LIT8( KStateError, "Error" );
    61 _LIT8( KMax, "max" );
    57 
    62 
    58 
    63 _LIT8( KTemplateViewUID, "0x20026f50" );
    59 _LIT8( KTemplateViewUID, "0x20026f50" );
    64 
    60 
    65 enum
    61 enum
    66     {
    62     {
    67     EFirstPassDrawComplete,
    63     EFirstPassDrawComplete,
    68     EDataPluginsComplete,
    64     EDataPluginsComplete,
    69     EViewIsValid,       
    65     EViewIsValid,       
    70     };
    66     };
    71 
    67 
    72 const TInt KMinPages = 1;
    68 
    73 
    69 /*
    74 
    70 const TAknsItemID KSkinIds[] = {
    75 #if 0 // MSK icon change
       
    76 
       
    77 const TInt KIconIds[] = {
       
    78         EMbmAvkonQgnQgn_home_page_11,
       
    79         EMbmAvkonQgnQgn_home_page_21,
       
    80         EMbmAvkonQgnQgn_home_page_22,
       
    81         EMbmAvkonQgnQgn_home_page_31,
       
    82         EMbmAvkonQgnQgn_home_page_32,
       
    83         EMbmAvkonQgnQgn_home_page_33,
       
    84         EMbmAvkonQgnQgn_home_page_41,
       
    85         EMbmAvkonQgnQgn_home_page_42,
       
    86         EMbmAvkonQgnQgn_home_page_43,
       
    87         EMbmAvkonQgnQgn_home_page_44,
       
    88         EMbmAvkonQgnQgn_home_page_51,
       
    89         EMbmAvkonQgnQgn_home_page_52,
       
    90         EMbmAvkonQgnQgn_home_page_53,
       
    91         EMbmAvkonQgnQgn_home_page_54,
       
    92         EMbmAvkonQgnQgn_home_page_55,
       
    93         EMbmAvkonQgnQgn_home_page_61,
       
    94         EMbmAvkonQgnQgn_home_page_62,
       
    95         EMbmAvkonQgnQgn_home_page_63,
       
    96         EMbmAvkonQgnQgn_home_page_64,
       
    97         EMbmAvkonQgnQgn_home_page_65,
       
    98         EMbmAvkonQgnQgn_home_page_66
       
    99         };
       
   100 
       
   101 const TInt KMaskIds[] = {
       
   102         EMbmAvkonQgnQgn_home_page_11_mask,
       
   103         EMbmAvkonQgnQgn_home_page_21_mask,
       
   104         EMbmAvkonQgnQgn_home_page_22_mask,
       
   105         EMbmAvkonQgnQgn_home_page_31_mask,
       
   106         EMbmAvkonQgnQgn_home_page_32_mask,
       
   107         EMbmAvkonQgnQgn_home_page_33_mask,
       
   108         EMbmAvkonQgnQgn_home_page_41_mask,
       
   109         EMbmAvkonQgnQgn_home_page_42_mask,
       
   110         EMbmAvkonQgnQgn_home_page_43_mask,
       
   111         EMbmAvkonQgnQgn_home_page_44_mask,
       
   112         EMbmAvkonQgnQgn_home_page_51_mask,
       
   113         EMbmAvkonQgnQgn_home_page_52_mask,
       
   114         EMbmAvkonQgnQgn_home_page_53_mask,
       
   115         EMbmAvkonQgnQgn_home_page_54_mask,
       
   116         EMbmAvkonQgnQgn_home_page_55_mask,
       
   117         EMbmAvkonQgnQgn_home_page_61_mask,
       
   118         EMbmAvkonQgnQgn_home_page_62_mask,
       
   119         EMbmAvkonQgnQgn_home_page_63_mask,
       
   120         EMbmAvkonQgnQgn_home_page_64_mask,
       
   121         EMbmAvkonQgnQgn_home_page_65_mask,
       
   122         EMbmAvkonQgnQgn_home_page_66_mask
       
   123         };
       
   124 
       
   125 const TAknsItemID KSkinIds[] = {            
       
   126         KAknsIIDQgnHomePage11,
    71         KAknsIIDQgnHomePage11,
   127         KAknsIIDQgnHomePage21,
    72         KAknsIIDQgnHomePage21,
   128         KAknsIIDQgnHomePage22,
    73         KAknsIIDQgnHomePage22,
   129         KAknsIIDQgnHomePage31,
    74         KAknsIIDQgnHomePage31,
   130         KAknsIIDQgnHomePage32,
    75         KAknsIIDQgnHomePage32,
   142         KAknsIIDQgnHomePage62,
    87         KAknsIIDQgnHomePage62,
   143         KAknsIIDQgnHomePage63,
    88         KAknsIIDQgnHomePage63,
   144         KAknsIIDQgnHomePage64,
    89         KAknsIIDQgnHomePage64,
   145         KAknsIIDQgnHomePage65,
    90         KAknsIIDQgnHomePage65,
   146         KAknsIIDQgnHomePage66
    91         KAknsIIDQgnHomePage66
   147         };
    92         }; 
   148 
    93 */        
   149 #endif // MSK icon change
       
   150 
       
   151 
    94 
   152 // ============================ LOCAL FUNCTIONS ===============================
    95 // ============================ LOCAL FUNCTIONS ===============================
   153 
    96 
   154 
    97 
   155 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
   223         }
   166         }
   224 
   167 
   225     aAdapter.SetOnlineStateL( list );
   168     aAdapter.SetOnlineStateL( list );
   226 
   169 
   227     CleanupStack::PopAndDestroy( 2, &nodes ); // &list                                                 
   170     CleanupStack::PopAndDestroy( 2, &nodes ); // &list                                                 
       
   171     }
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // resolveIconId
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 static TAknsItemID ResolveIconId( TInt aIndex )
       
   178     {
       
   179     TAknsItemID ret( KAknsIIDNone );
       
   180     switch( aIndex )
       
   181         {
       
   182         case 0:
       
   183             {
       
   184             ret = KAknsIIDQgnHomePage11;
       
   185             }
       
   186             break;
       
   187         case 1:
       
   188             {
       
   189             ret = KAknsIIDQgnHomePage21;
       
   190             }
       
   191             break;
       
   192         case 2:
       
   193             {
       
   194             ret = KAknsIIDQgnHomePage22;
       
   195             }
       
   196             break;
       
   197         case 3:
       
   198             {
       
   199             ret = KAknsIIDQgnHomePage31;
       
   200             }
       
   201             break;
       
   202         case 4:
       
   203             {
       
   204             ret = KAknsIIDQgnHomePage32;
       
   205             }     
       
   206             break;
       
   207         case 5:
       
   208             {
       
   209             ret = KAknsIIDQgnHomePage33;
       
   210             }    
       
   211             break;
       
   212         case 6:
       
   213             {
       
   214             ret = KAknsIIDQgnHomePage41;
       
   215             }
       
   216             break;
       
   217         case 7:
       
   218             {
       
   219             ret = KAknsIIDQgnHomePage42;
       
   220             }   
       
   221             break;
       
   222         case 8:
       
   223             {
       
   224             ret = KAknsIIDQgnHomePage43;
       
   225             }   
       
   226             break;
       
   227         case 9:
       
   228             {
       
   229             ret = KAknsIIDQgnHomePage44;
       
   230             }     
       
   231             break;
       
   232         case 10:
       
   233             {
       
   234             ret = KAknsIIDQgnHomePage51;
       
   235             }     
       
   236             break;
       
   237         case 11:
       
   238             {
       
   239             ret = KAknsIIDQgnHomePage52;
       
   240             }     
       
   241             break;
       
   242         case 12:
       
   243             {
       
   244             ret = KAknsIIDQgnHomePage53;
       
   245             } 
       
   246             break;
       
   247         case 13:
       
   248             {
       
   249             ret = KAknsIIDQgnHomePage54;
       
   250             }     
       
   251             break;
       
   252         case 14:
       
   253             {
       
   254             ret = KAknsIIDQgnHomePage55;
       
   255             }
       
   256             break;
       
   257         case 15:
       
   258             {
       
   259             ret = KAknsIIDQgnHomePage61;
       
   260             }    
       
   261             break;
       
   262         case 16:
       
   263             {
       
   264             ret = KAknsIIDQgnHomePage62;
       
   265             }   
       
   266             break;
       
   267         case 17:
       
   268             {
       
   269             ret = KAknsIIDQgnHomePage63;
       
   270             }    
       
   271             break;
       
   272         case 18:
       
   273             {
       
   274             ret = KAknsIIDQgnHomePage64;
       
   275             }
       
   276             break;
       
   277         case 19:
       
   278             {
       
   279             ret = KAknsIIDQgnHomePage65;
       
   280             }
       
   281             break;            
       
   282         case 20:
       
   283             {
       
   284             ret = KAknsIIDQgnHomePage66;
       
   285             }            
       
   286             break;            
       
   287         default:
       
   288             {
       
   289             }
       
   290             break;
       
   291         }
       
   292     
       
   293     return ret;
   228     }
   294     }
   229 
   295 
   230 // ============================ MEMBER FUNCTIONS ===============================
   296 // ============================ MEMBER FUNCTIONS ===============================
   231 
   297 
   232 // -----------------------------------------------------------------------------
   298 // -----------------------------------------------------------------------------
  1595 // -----------------------------------------------------------------------------
  1661 // -----------------------------------------------------------------------------
  1596 // CXnViewManager::UpdateViewSwitcherInformationL()
  1662 // CXnViewManager::UpdateViewSwitcherInformationL()
  1597 // -----------------------------------------------------------------------------
  1663 // -----------------------------------------------------------------------------
  1598 //
  1664 //
  1599 void CXnViewManager::UpdatePageManagementInformationL()
  1665 void CXnViewManager::UpdatePageManagementInformationL()
  1600     { 
  1666     {
  1601     // Update MSK info
  1667     // Update MSK info
  1602     // Obtain menu bar
  1668     // Obtain menu bar
  1603     CXnNode* menuBar( iUiEngine->MenuBarNode() );
  1669     CXnNode* menuBar( iUiEngine->MenuBarNode() );
  1604 
  1670 
  1605     if ( menuBar )
  1671     if ( menuBar )
  1608         XnMenuInterface::MXnMenuInterface* menuIf( NULL );
  1674         XnMenuInterface::MXnMenuInterface* menuIf( NULL );
  1609         XnComponentInterface::MakeInterfaceL( menuIf, menuBar->AppIfL() );
  1675         XnComponentInterface::MakeInterfaceL( menuIf, menuBar->AppIfL() );
  1610         
  1676         
  1611         if ( menuIf )
  1677         if ( menuIf )
  1612             {
  1678             {
  1613 #if 0 // MSK icon change
       
  1614             // Get count of views in array and index of actual view
  1679             // Get count of views in array and index of actual view
  1615             TInt count( ViewAmount() );
  1680             TInt count( ViewAmount() );
  1616             TInt current( ViewIndex() + 1 );
  1681             TInt current( ViewIndex() + 1 );
  1617 
  1682 
  1618             // Update MSK icon
  1683             // Update MSK icon
       
  1684             /*
  1619             TInt index = ResolveIconIndex( count, current );
  1685             TInt index = ResolveIconIndex( count, current );
  1620             menuIf->SetSoftKeyImageL( KSkinIds[index],
  1686             menuIf->SetSoftKeyImageL( KSkinIds[index],
  1621                                       AknIconUtils::AvkonIconFileName(), 
  1687                                       KNullDesC, 
  1622                                       KIconIds[index],
  1688                                       0,
  1623                                       KMaskIds[index],
  1689                                       0,
  1624                                       XnMenuInterface::MXnMenuInterface::ECenter, 
  1690                                       XnMenuInterface::MXnMenuInterface::ECenter, 
  1625                                       ETrue );
  1691                                       ETrue );
  1626 
  1692             */
  1627 #else // MSK icon change
  1693             TInt index = ResolveIconIndex( count, current );
  1628             // Get array of views
  1694             TAknsItemID iconId = ResolveIconId( index );
  1629             RPointerArray< CXnPluginData >& views( iRootData->PluginData() );
  1695             menuIf->SetSoftKeyImageL( iconId,
  1630             // Get count of views in array and index of actual view
  1696                                       KNullDesC, 
  1631             TInt count( views.Count() );
  1697                                       0,
  1632             TInt actual( views.Find( &ActiveViewData() ) + 1 );
  1698                                       0,
  1633             
  1699                                       XnMenuInterface::MXnMenuInterface::ECenter, 
  1634             // Construct a text info
  1700                                       ETrue );            
  1635             _LIT( KSeparator, "/" );
       
  1636             TBuf< 32 >info( KNullDesC );
       
  1637             
       
  1638             if ( AknLayoutUtils::LayoutMirrored() )
       
  1639                 {
       
  1640                 info.AppendNum( actual );
       
  1641                 info.Append( KSeparator );
       
  1642                 info.AppendNum( count );
       
  1643                 }
       
  1644             else
       
  1645                 {
       
  1646                 info.AppendNum( actual );
       
  1647                 info.Append( KSeparator );
       
  1648                 info.AppendNum( count );
       
  1649                 }
       
  1650       
       
  1651             AknTextUtils::LanguageSpecificNumberConversion( info );
       
  1652 
       
  1653             // Update info
       
  1654             menuIf->SetSoftKeyTextL( info, 
       
  1655                 XnMenuInterface::MXnMenuInterface::ECenter );
       
  1656 #endif // MSK icon change
       
  1657             }
  1701             }
  1658         }
  1702         }
  1659     }
  1703     }
  1660 
  1704 
  1661 // -----------------------------------------------------------------------------
  1705 // -----------------------------------------------------------------------------
  1690 TInt32 CXnViewManager::MaxPages()
  1734 TInt32 CXnViewManager::MaxPages()
  1691     {
  1735     {
  1692     return iRootData->MaxPages();
  1736     return iRootData->MaxPages();
  1693     }
  1737     }
  1694 
  1738 
  1695 
       
  1696 #if 0 // MSK icon change
       
  1697 
       
  1698 
       
  1699 // -----------------------------------------------------------------------------
  1739 // -----------------------------------------------------------------------------
  1700 // CXnViewManager::ResolveIconIndex
  1740 // CXnViewManager::ResolveIconIndex
  1701 // 
  1741 // 
  1702 // -----------------------------------------------------------------------------
  1742 // -----------------------------------------------------------------------------
  1703 TInt CXnViewManager::ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const
  1743 TInt CXnViewManager::ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const
  1712 
  1752 
  1713     TInt index( iconCount - aPageCount + aPageNum - 1 );
  1753     TInt index( iconCount - aPageCount + aPageNum - 1 );
  1714 
  1754 
  1715     return index;
  1755     return index;
  1716     }
  1756     }
  1717 
       
  1718 #endif // MSK icon change
       
  1719 // End of file
  1757 // End of file