Ejemplo n.º 1
0
TBool AVisWidget::HandleCompChanged(Elem& aContext, Elem& aComp)
{
    TBool res = EFalse;
    Elem* eprntcp = aContext.GetNode("ConnPoint:Child");
    if (eprntcp != NULL) {
	if (eprntcp == &aComp || eprntcp->IsComp(&aComp)) {
	    MVisContainer* mcont = (MVisContainer*) eprntcp->GetSIfiC(MVisContainer::Type(), this);
	    if (mcont != NULL) {
		if (iWidget->get_parent() == NULL) {
		    Container& cont = mcont->GetContainer();
		    cont.add(*iWidget);
		}
		else {
		    Logger()->Write(MLogRec::EErr, this, "Attempt to attach already attached child");
		}
	    }
	    else if (iWidget->get_parent() != NULL) {
		iWidget->get_parent()->remove(*iWidget);
	    }
	}
    }
    else {
	Logger()->Write(MLogRec::EErr, this, "Input [Child] not exists");
    }
    return res;
}
Ejemplo n.º 2
0
TInt AVisWidget::GetParData(ParentSizeProv::TData aData)
{
    TInt res = 0;
    // Update parent of widget. It is requied because there is no notification of parent change or
    // connection to parent change. In fact the observation via HandleCompChanged give us only
    // info of local connection change, but not the whole connection chain change. Ref grayb uc_010
    Container* parent = iWidget->get_parent();
    if (parent == NULL) {
	Elem* eprntcp = GetNode("../../ConnPoint:Child");
	if (eprntcp != NULL) {
	    MVisContainer* mcont = (MVisContainer*) eprntcp->GetSIfiC(MVisContainer::Type(), this);
	    if (mcont != NULL) {
		if (iWidget->get_parent() == NULL) {
		    Container& cont = mcont->GetContainer();
		    cont.add(*iWidget);
		    parent = iWidget->get_parent();
		}
	    }
	}
    }
    if (parent != NULL) {
	Allocation palc = parent->get_allocation();
	res = aData == ParentSizeProv::ED_W ? palc.get_width() : palc.get_height();
    }
    return res;
}
Ejemplo n.º 3
0
MVisContainer* AVisWidget::GetVisContainer()
{
    MVisContainer* res = NULL;
    Elem* eprntcp = Host()->GetNode("ConnPoint:Child");
    if (eprntcp != NULL) {
	res = (MVisContainer*) eprntcp->GetSIfiC(MVisContainer::Type(), this);
    }
    else {
	Logger()->Write(MLogRec::EErr, this, "Input [Child] not exists");
    }
    return res;
}
Ejemplo n.º 4
0
bool AVisWidget::GetDataInt(const string& aInpUri, int& aData) 
{
    bool res = false;
    Elem* einp = Host()->GetNode(aInpUri);
    if (einp != NULL) {
	MDIntGet* mdata = (MDIntGet*) einp->GetSIfiC(MDIntGet::Type(), this);
	if (mdata != NULL) {
	    aData = mdata->Value();
	    res = true;
	}
    }
    else {
	Logger()->Write(MLogRec::EErr, this, "Input [%s] not exists", aInpUri.c_str());
    }
    return res;
}