int32_t CFWL_GridImp::GetWidgetSpan(IFWL_Widget* pWidget, FX_BOOL bColumn) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { return bColumn ? pInfo->m_iColumnSpan : pInfo->m_iRowSpan; } return 0; }
FWL_ERR CFWL_GridImp::RemoveWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { pInfo->m_dwMarginFlag &= ~(1 << eMargin); } return FWL_ERR_Succeeded; }
FWL_ERR CFWL_GridImp::SetWidgetSpan(IFWL_Widget* pWidget, int32_t iSpan, FX_BOOL bColumn) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { bColumn ? pInfo->m_iColumnSpan = iSpan : pInfo->m_iRowSpan = iSpan; } return FWL_ERR_Succeeded; }
FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget* pWidget, int32_t iPos, FX_BOOL bColumn) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { bColumn ? pInfo->m_iColumn = iPos : pInfo->m_iRow = iPos; } return FWL_ERR_Succeeded; }
FWL_ERR CFWL_GridImp::SetWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin, FX_FLOAT fMargin) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { pInfo->m_Margin[eMargin] = fMargin; pInfo->m_dwMarginFlag |= (1 << eMargin); } return FWL_ERR_Succeeded; }
FX_BOOL CFWL_GridImp::GetWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin, FX_FLOAT& fMargin) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { fMargin = pInfo->m_Margin[eMargin]; return (pInfo->m_dwMarginFlag & (1 << eMargin)) != 0; } return FALSE; }
FX_FLOAT CFWL_GridImp::GetWidgetSize(IFWL_Widget* pWidget, FWL_GRIDSIZE eSize, FWL_GRIDUNIT& eUnit) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { eUnit = pInfo->m_Size[eSize].eUnit; return pInfo->m_Size[eSize].fLength; } return 0; }
FWL_ERR CFWL_GridImp::SetWidgetSize(IFWL_Widget* pWidget, FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit) { CFWL_GridWidgetInfo* pInfo = static_cast<CFWL_GridWidgetInfo*>(GetWidgetInfo(pWidget)); if (pInfo) { pInfo->m_Size[eSize].fLength = fSize; pInfo->m_Size[eSize].eUnit = eUit; } return FWL_ERR_Succeeded; }
ECode PreviewInflater::InflatePreview( /* [in] */ IIntent* intent, /* [out] */ IView** view) { VALIDATE_NOT_NULL(view); AutoPtr<WidgetInfo> info = GetWidgetInfo(intent); if (info == NULL) { *view = NULL; return NOERROR; } AutoPtr<IView> v = InflateWidgetView(info); if (v == NULL) { *view = NULL; return NOERROR; } AutoPtr<IKeyguardPreviewContainer> container = new KeyguardPreviewContainer(mContext, NULL); IViewGroup::Probe(container)->AddView(v); *view = IView::Probe(container); return NOERROR; }