equal
deleted
inserted
replaced
385 TBool CCreatorScriptElement::IsCommandElement() const |
385 TBool CCreatorScriptElement::IsCommandElement() const |
386 { |
386 { |
387 return iIsCommandElement; |
387 return iIsCommandElement; |
388 } |
388 } |
389 |
389 |
390 void CCreatorScriptElement::AsyncExecuteCommandAndWaitL() |
|
391 { |
|
392 iAsyncCallback.Cancel(); |
|
393 iLoopIndex = 0; |
|
394 iAsyncOpError = KErrNone; |
|
395 // start async executing |
|
396 iAsyncCallback.CallBack(); |
|
397 // wait until async executing is finished |
|
398 iWaiter.Start(); |
|
399 User::LeaveIfError( iAsyncOpError ); |
|
400 } |
|
401 |
|
402 TInt CCreatorScriptElement::ExecuteCommandCB( TAny* aPtr ) |
|
403 { |
|
404 static_cast<CCreatorScriptElement*>( aPtr )->AsyncExecuteCommand(); |
|
405 return KErrNone; |
|
406 } |
|
407 |
|
408 void CCreatorScriptElement::AsyncExecuteCommand() |
|
409 { |
|
410 TRAPD( err, AsyncExecuteCommandL() ); |
|
411 if( err != KErrNone ) |
|
412 { |
|
413 iAsyncOpError = err; |
|
414 iAsyncCallback.Cancel(); |
|
415 iWaiter.AsyncStop(); |
|
416 } |
|
417 } |
|
418 |
|
419 void CCreatorScriptElement::AsyncExecuteCommandL() |
|
420 { |
|
421 User::Panic(_L("CCreatorScriptElement::AsyncExecuteCommandL not written"), -1000); |
|
422 } |
|
423 |
|
424 void CCreatorScriptElement::StartNextLoop() |
|
425 { |
|
426 iLoopIndex++; |
|
427 iAsyncCallback.CallBack(); |
|
428 } |
|
429 |
|
430 void CCreatorScriptElement::AsyncCommandFinished() |
|
431 { |
|
432 iWaiter.AsyncStop(); |
|
433 } |
|
434 |
|
435 void CCreatorScriptElement::ExecuteCommandL() |
390 void CCreatorScriptElement::ExecuteCommandL() |
436 { |
391 { |
437 |
392 |
438 } |
393 } |
439 |
394 |
443 if(iName->Des() == KRootName) |
398 if(iName->Des() == KRootName) |
444 return ETrue; |
399 return ETrue; |
445 return EFalse; |
400 return EFalse; |
446 } |
401 } |
447 |
402 |
448 CCreatorScriptElement::CCreatorScriptElement(CCreatorEngine* aEngine) : |
403 CCreatorScriptElement::CCreatorScriptElement(CCreatorEngine* aEngine) |
449 iIsCommandElement(EFalse), |
404 : |
450 iIsRoot(EFalse), |
405 iIsCommandElement(EFalse), |
451 iEngine(aEngine), |
406 iIsRoot(EFalse), |
452 iAsyncCallback( CActive::EPriorityLow ) |
407 iEngine(aEngine) |
453 { |
408 {} |
454 TCallBack callback( ExecuteCommandCB, this); |
|
455 iAsyncCallback.Set( callback ); |
|
456 } |
|
457 |
409 |
458 void CCreatorScriptElement::ConstructL(const TDesC& aName, const TDesC& aContext) |
410 void CCreatorScriptElement::ConstructL(const TDesC& aName, const TDesC& aContext) |
459 { |
411 { |
460 SetNameL(aName); |
412 SetNameL(aName); |
461 SetContextL(aContext); |
413 SetContextL(aContext); |
739 CCreatorScriptElement(aEngine) |
691 CCreatorScriptElement(aEngine) |
740 { |
692 { |
741 iIsRoot=ETrue; |
693 iIsRoot=ETrue; |
742 } |
694 } |
743 |
695 |
|
696 |
|
697 CCreatorCalendarElementBase* CCreatorCalendarElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
|
698 { |
|
699 CCreatorCalendarElementBase* self = new (ELeave) CCreatorCalendarElementBase(aEngine); |
|
700 CleanupStack::PushL(self); |
|
701 self->ConstructL(aName, aContext); |
|
702 CleanupStack::Pop(); |
|
703 return self; |
|
704 } |
|
705 CCreatorCalendarElementBase::CCreatorCalendarElementBase(CCreatorEngine* aEngine) |
|
706 : |
|
707 CCreatorScriptElement(aEngine) |
|
708 { } |
|
709 |
|
710 CCreatorMessageElementBase* CCreatorMessageElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
|
711 { |
|
712 CCreatorMessageElementBase* self = new (ELeave) CCreatorMessageElementBase(aEngine); |
|
713 CleanupStack::PushL(self); |
|
714 self->ConstructL(aName, aContext); |
|
715 CleanupStack::Pop(); |
|
716 return self; |
|
717 } |
|
718 CCreatorMessageElementBase::CCreatorMessageElementBase(CCreatorEngine* aEngine) |
|
719 : |
|
720 CCreatorScriptElement(aEngine) |
|
721 { } |