예제 #1
0
void ItemView::Init(inventory::ItemPtr item)
{
    SetOrientation(OrientationHorizontal);
    mItemIcon = IconPtr(new Icon(item->GetIcon()));
    mItemLabel = LabelPtr(new Label(item->GetTag()));
    mItemIcon->SetSize(32, 32);
    AddChild(mItemIcon);
    AddChild(mItemLabel);
}
// -----------------------------------------------------------------------------
// CWimJavaProvisioning::LabelAndPath
// -----------------------------------------------------------------------------
//
void CWimJavaProvisioning::LabelAndPath( const RMessage2& aMessage )
   {
   _WIMTRACE(_L("WIM | WIMServer | CWimJavaProvisioning::LabelAndPath | Begin"));

    TUint16 callStatus = KErrNone;
    
    WIMI_BinData_t path;
    WIMI_BinData_t label;
    
    if( iWimRef )
        {
        free_WIMI_Ref_t( iWimRef );
        iWimRef = NULL;
        }
    iWimRef = WIMI_GetWIMRef( 0 );

    if ( !iWimRef )
        {
        callStatus = WIMI_ERR_KeyNotFound; // Mapped to KErrNotFound
        }

    if ( callStatus == KErrNone )
        {
        path.pb_buf = NULL;
        label.pb_buf = NULL;
        
        path.ui_buf_length = 0;
        label.ui_buf_length = 0;
    
        //Get Path and label
        callStatus = WIMI_GetLabelAndPath(iWimRef,
                                          &path,
                                          &label );
        }

    if ( callStatus == KErrNone )
        {
        TPtrC8 PathPtr( path.pb_buf, path.ui_buf_length );
        TPtrC8 LabelPtr( label.pb_buf, label.ui_buf_length );
        
        TInt err = KErrNone; 
        err = aMessage.Write( 0, LabelPtr );
        if ( err != KErrNone )
            {
            aMessage.Complete( err );
            return;	
            }
        	  
        err = aMessage.Write( 1, PathPtr );
        if ( err != KErrNone )
            {
            aMessage.Complete( err );
            return;	
            }

        aMessage.Complete( KErrNone );
        }
    else
        {
        aMessage.Complete( CWimUtilityFuncs::MapWIMError( callStatus ) );	
        }    
          
    _WIMTRACE(_L("WIM | WIMServer | CWimJavaProvisioning::OmaFileContentL | End"));	
   }