idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp
changeset 1 5315654608de
parent 0 f72a12da539e
child 2 08c6ee43b396
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
    26 #include "../../../inc/ai3.hrh"
    26 #include "../../../inc/ai3.hrh"
    27 
    27 
    28 #include <xnuiengine.rsg>
    28 #include <xnuiengine.rsg>
    29 #include <hscontentcontrolui.h>
    29 #include <hscontentcontrolui.h>
    30 #include <hscontentcontrol.h>
    30 #include <hscontentcontrol.h>
       
    31 #include <activeidle2domaincrkeys.h>
    31 
    32 
    32 // User includes
    33 // User includes
    33 #include "xnuiengine.h"
    34 #include "xnuiengine.h"
    34 #include "xnproperty.h"
    35 #include "xnproperty.h"
    35 #include "xnnode.h"
    36 #include "xnnode.h"
    78 _LIT8( KDownload, "Editor/DownloadCaption" );
    79 _LIT8( KDownload, "Editor/DownloadCaption" );
    79 
    80 
    80 _LIT8( KSingle, "single" );
    81 _LIT8( KSingle, "single" );
    81 _LIT8( KMulti, "multi" );
    82 _LIT8( KMulti, "multi" );
    82 
    83 
    83 _LIT8( KWMUi, "WmContentControlUI" );
       
    84 
    84 
    85 const TInt32 KMultiInstanceUnlimitedValue = -1;
    85 const TInt32 KMultiInstanceUnlimitedValue = -1;
    86 const TInt32 KMultiInstanceHiddenValue = 0;
       
    87 
    86 
    88 const TUid KDummyUid = { 0x0000000 };
    87 const TUid KDummyUid = { 0x0000000 };
       
    88 
       
    89 const TUint32 KAICCPluginUIDKey = 0x00003010;
       
    90 const TInt32 KOpaQDataLen = 10;
       
    91 
    89 enum
    92 enum
    90     {
    93     {
    91     ECanBeAdded = 0x01,
    94     ECanBeAdded = 0x01,
    92     ECanBeRemoved
    95     ECanBeRemoved
    93     };
    96     };
   305 // 
   308 // 
   306 void CXnEditor::ConstructL( const TDesC8& aUid )
   309 void CXnEditor::ConstructL( const TDesC8& aUid )
   307     {
   310     {
   308     iCpsWrapper = CCpsWrapper::NewL( *this );
   311     iCpsWrapper = CCpsWrapper::NewL( *this );
   309     iHspsWrapper = CHspsWrapper::NewL( aUid, this );
   312     iHspsWrapper = CHspsWrapper::NewL( aUid, this );
       
   313     iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
   310     }
   314     }
   311 
   315 
   312 // ---------------------------------------------------------------------------
   316 // ---------------------------------------------------------------------------
   313 // CXnEditor::~CXnEditor
   317 // CXnEditor::~CXnEditor
   314 // ---------------------------------------------------------------------------
   318 // ---------------------------------------------------------------------------
   318     iViewManager.RemoveObserver( *this );
   322     iViewManager.RemoveObserver( *this );
   319     
   323     
   320     delete iCpsWrapper;
   324     delete iCpsWrapper;
   321     delete iHspsWrapper;
   325     delete iHspsWrapper;
   322     delete iPublisherMap;
   326     delete iPublisherMap;
       
   327     delete iRepository;
   323     }
   328     }
   324 
   329 
   325 // -----------------------------------------------------------------------------
   330 // -----------------------------------------------------------------------------
   326 // CXnEditor::IsCurrentViewFull
   331 // CXnEditor::IsCurrentViewFull
   327 // -----------------------------------------------------------------------------
   332 // -----------------------------------------------------------------------------
   615     
   620     
   616     CleanupStack::PopAndDestroy( &plugins );    
   621     CleanupStack::PopAndDestroy( &plugins );    
   617     }
   622     }
   618 
   623 
   619 // ---------------------------------------------------------------------------
   624 // ---------------------------------------------------------------------------
       
   625 // CXnEditor::IdFromCrep
       
   626 // ---------------------------------------------------------------------------
       
   627 //
       
   628 TInt CXnEditor::IdFromCrep (TDes8& aUid) const
       
   629     {
       
   630     return iRepository->Get( KAICCPluginUIDKey, aUid );
       
   631     }
       
   632 
   620 // CXnEditor::AddWidgetL
   633 // CXnEditor::AddWidgetL
   621 // ---------------------------------------------------------------------------
   634 // ---------------------------------------------------------------------------
   622 //
   635 //
   623 void CXnEditor::AddWidgetL()
   636 void CXnEditor::AddWidgetL()
   624     {
   637     {
   625     MHsContentControlUi* ui( 
   638     TBuf8<KOpaQDataLen> oPaqDataStr;
   626         iViewManager.AppUiAdapter().HsContentController( KWMUi ) ); 
   639            
   627                                                 
   640     MHsContentControlUi* ui( NULL );
       
   641     if ( IdFromCrep ( oPaqDataStr ) == KErrNone )
       
   642         {
       
   643         ui = iViewManager.AppUiAdapter().HsContentController( oPaqDataStr ); 
       
   644         }
   628     if( ui )
   645     if( ui )
   629         {
   646         {
   630         ui->SetContentController( this );
   647         ui->SetContentController( this );
   631         ui->Activate();
   648         ui->Activate();
   632         
   649         
  1515 // CXnEditor::WidgetListChanged
  1532 // CXnEditor::WidgetListChanged
  1516 // -----------------------------------------------------------------------------
  1533 // -----------------------------------------------------------------------------
  1517 //
  1534 //
  1518 void CXnEditor::WidgetListChanged()
  1535 void CXnEditor::WidgetListChanged()
  1519     {
  1536     {
  1520     MHsContentControlUi* ui( 
  1537     TBuf8<KOpaQDataLen> oPaqDataStr;
  1521         iViewManager.AppUiAdapter().HsContentController( KWMUi ) );
  1538               
  1522             
  1539    MHsContentControlUi* ui( NULL );
       
  1540    if ( IdFromCrep ( oPaqDataStr ) == KErrNone )
       
  1541        {
       
  1542        ui = iViewManager.AppUiAdapter().HsContentController( oPaqDataStr ); 
       
  1543        }
  1523     if( ui )
  1544     if( ui )
  1524         {
  1545         {
  1525         ui->NotifyWidgetListChanged();
  1546         ui->NotifyWidgetListChanged();
  1526         }
  1547         }
  1527     MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() );
  1548     MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() );
  1535 // CXnEditor::ViewListChanged
  1556 // CXnEditor::ViewListChanged
  1536 // -----------------------------------------------------------------------------
  1557 // -----------------------------------------------------------------------------
  1537 //
  1558 //
  1538 void CXnEditor::ViewListChanged()
  1559 void CXnEditor::ViewListChanged()
  1539     {
  1560     {
  1540     MHsContentControlUi* ui( 
  1561     TBuf8<KOpaQDataLen> oPaqDataStr;
  1541         iViewManager.AppUiAdapter().HsContentController( KWMUi ) );
  1562               
  1542             
  1563    MHsContentControlUi* ui( NULL );
       
  1564    if ( IdFromCrep ( oPaqDataStr ) == KErrNone )
       
  1565        {
       
  1566        ui = iViewManager.AppUiAdapter().HsContentController( oPaqDataStr ); 
       
  1567        }
  1543     if( ui )
  1568     if( ui )
  1544         {
  1569         {
  1545         ui->NotifyViewListChanged();
  1570         ui->NotifyViewListChanged();
  1546         }
  1571         }
  1547     MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() );
  1572     MHsContentControl* srv( iViewManager.AppUiAdapter().HsContentControlSrv() );