skins/AknSkins/srvsrc/tfxconfigparser.cpp
branchRCL_3
changeset 106 e4e3998ddda2
parent 54 08459e712984
child 107 9f95a5546443
equal deleted inserted replaced
100:9dbe1b043bea 106:e4e3998ddda2
    80         return KNullDesC;
    80         return KNullDesC;
    81         }
    81         }
    82     return *iFilename;
    82     return *iFilename;
    83     }
    83     }
    84 
    84 
    85 void CTFxEffect::SetNameL(const TDesC8& aName)
    85 void CTFxEffect::SetName(const TDesC8& aName)
    86     {
    86     {
    87     if (iName)
    87     if (iName)
    88         {
    88         {
    89         delete iName;
    89         delete iName;
    90         iName = NULL;
    90         iName = NULL;
    91         }
    91         }
    92     iName = HBufC::NewL(aName.Length()*2);
    92     iName = HBufC::NewL(aName.Length()*2);
    93     iName->Des().Copy(aName);
    93     iName->Des().Copy(aName);
    94     }
    94     }
    95 
    95 
    96 void CTFxEffect::SetFilenameL(const TDesC8& aFilename)
    96 void CTFxEffect::SetFilename(const TDesC8& aFilename)
    97     {
    97     {
    98     if (iFilename)
    98     if (iFilename)
    99         {
    99         {
   100         delete iFilename;
   100         delete iFilename;
   101         iFilename = NULL;
   101         iFilename = NULL;
   116 TInt CTFxEffect::CachePriority()
   116 TInt CTFxEffect::CachePriority()
   117     {
   117     {
   118     return iCachePriority;
   118     return iCachePriority;
   119     }
   119     }
   120 
   120 
   121 void CTFxEffect::SetWantedTimeL(const TDesC8& aTime)
   121 void CTFxEffect::SetWantedTime(const TDesC8& aTime)
   122     {
   122     {
   123     if (aTime.Length() > 0)
   123     if (aTime.Length() > 0)
   124         {
   124         {
   125         TLex8 lexer(aTime);
   125         TLex8 lexer(aTime);
   126         User::LeaveIfError(lexer.Val(iWantedTime));
   126         User::LeaveIfError(lexer.Val(iWantedTime));
   129         {
   129         {
   130         iWantedTime = -1;
   130         iWantedTime = -1;
   131         }
   131         }
   132     }
   132     }
   133 
   133 
   134 void CTFxEffect::SetMinTimeL(const TDesC8& aTime)
   134 void CTFxEffect::SetMinTime(const TDesC8& aTime)
   135     {
   135     {
   136     if (aTime.Length() > 0)
   136     if (aTime.Length() > 0)
   137         {
   137         {
   138         TLex8 lexer(aTime);
   138         TLex8 lexer(aTime);
   139         User::LeaveIfError(lexer.Val(iMinTime));
   139         User::LeaveIfError(lexer.Val(iMinTime));
   142         {
   142         {
   143         iMinTime = -1;
   143         iMinTime = -1;
   144         }
   144         }
   145     }
   145     }
   146 
   146 
   147 void CTFxEffect::SetCachePriorityL(const TDesC8& aPriority)
   147 void CTFxEffect::SetCachePriority(const TDesC8& aPriority)
   148     {
   148     {
   149     if (aPriority.Length() > 0)
   149     if (aPriority.Length() > 0)
   150         {
   150         {
   151         TLex8 lexer(aPriority);
   151         TLex8 lexer(aPriority);
   152         User::LeaveIfError(lexer.Val(iCachePriority));
   152         User::LeaveIfError(lexer.Val(iCachePriority));
   209 TInt CTFxTransition::Type()
   209 TInt CTFxTransition::Type()
   210     {
   210     {
   211     return iType;
   211     return iType;
   212     }
   212     }
   213 
   213 
   214 void CTFxTransition::SetUidL(const TDesC8& aUid)
   214 void CTFxTransition::SetUid(const TDesC8& aUid)
   215     {
   215     {
   216     if (aUid.Length())
   216     if (aUid.Length())
   217         {
   217         {
   218         TLex8 lexer(aUid.Mid(2));
   218         TLex8 lexer(aUid.Mid(2));
   219         TUint32 uid;
   219         TUint32 uid;
   231     {
   231     {
   232     return iContextId;
   232     return iContextId;
   233     }
   233     }
   234 
   234 
   235 
   235 
   236 void CTFxTransition::SetContextIdL(const TDesC8& aId)
   236 void CTFxTransition::SetContextId(const TDesC8& aId)
   237     {
   237     {
   238     if (aId.Length() > 0)
   238     if (aId.Length() > 0)
   239         {
   239         {
   240         TLex8 lexer(aId);
   240         TLex8 lexer(aId);
   241         User::LeaveIfError(lexer.Val(iContextId));
   241         User::LeaveIfError(lexer.Val(iContextId));
   255         }
   255         }
   256     iEffectName = HBufC::NewL(aEffect.Length()*2);
   256     iEffectName = HBufC::NewL(aEffect.Length()*2);
   257     iEffectName->Des().Copy(aEffect);
   257     iEffectName->Des().Copy(aEffect);
   258     }
   258     }
   259 
   259 
   260 void CTFxTransition::SetTypeL(const TDesC8& aType)
   260 void CTFxTransition::SetType(const TDesC8& aType)
   261     {
   261     {
   262     if (aType.Length() > 0)
   262     if (aType.Length() > 0)
   263         {
   263         {
   264         TLex8 lexer(aType);
   264         TLex8 lexer(aType);
   265         User::LeaveIfError(lexer.Val(iType));
   265         User::LeaveIfError(lexer.Val(iType));
   704         {
   704         {
   705         RAttribute attribute = aAttributes[count];
   705         RAttribute attribute = aAttributes[count];
   706         RTagInfo tag = attribute.Attribute();
   706         RTagInfo tag = attribute.Attribute();
   707         if (!tag.LocalName().DesC().CompareF(KEffectNameTag))
   707         if (!tag.LocalName().DesC().CompareF(KEffectNameTag))
   708             {
   708             {
   709             iCurrentEffect->SetNameL(attribute.Value().DesC());
   709             iCurrentEffect->SetName(attribute.Value().DesC());
   710             }
   710             }
   711         else if (!tag.LocalName().DesC().CompareF(KEffectFileTag))
   711         else if (!tag.LocalName().DesC().CompareF(KEffectFileTag))
   712             {
   712             {
   713             iCurrentEffect->SetFilenameL(attribute.Value().DesC());
   713             iCurrentEffect->SetFilename(attribute.Value().DesC());
   714             }
   714             }
   715         else if (!tag.LocalName().DesC().CompareF(KEffectWantedTimeTag))
   715         else if (!tag.LocalName().DesC().CompareF(KEffectWantedTimeTag))
   716             {
   716             {
   717             iCurrentEffect->SetWantedTimeL(attribute.Value().DesC());
   717             iCurrentEffect->SetWantedTime(attribute.Value().DesC());
   718             }
   718             }
   719         else if (!tag.LocalName().DesC().CompareF(KEffectMinTimeTag))
   719         else if (!tag.LocalName().DesC().CompareF(KEffectMinTimeTag))
   720             {
   720             {
   721             iCurrentEffect->SetMinTimeL(attribute.Value().DesC());
   721             iCurrentEffect->SetMinTime(attribute.Value().DesC());
   722             }
   722             }
   723         else if (!tag.LocalName().DesC().CompareF(KEffectCachePriorityTag))
   723         else if (!tag.LocalName().DesC().CompareF(KEffectCachePriorityTag))
   724             {
   724             {
   725             iCurrentEffect->SetCachePriorityL(attribute.Value().DesC());
   725             iCurrentEffect->SetCachePriority(attribute.Value().DesC());
   726             }
   726             }
   727         }
   727         }
   728     }
   728     }
   729 
   729 
   730 void CTFXConfigParser::OnSelStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt /*aErrorCode*/)
   730 void CTFXConfigParser::OnSelStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt /*aErrorCode*/)
   771                 {
   771                 {
   772                 RAttribute attribute = aAttributes[count];
   772                 RAttribute attribute = aAttributes[count];
   773                 RTagInfo tag = attribute.Attribute();
   773                 RTagInfo tag = attribute.Attribute();
   774                 if (!tag.LocalName().DesC().CompareF(KContextTag))
   774                 if (!tag.LocalName().DesC().CompareF(KContextTag))
   775                     {
   775                     {
   776                     iCurrentTransition->SetContextIdL(attribute.Value().DesC());
   776                     iCurrentTransition->SetContextId(attribute.Value().DesC());
   777                     }
   777                     }
   778                 else if (!tag.LocalName().DesC().CompareF(KEffectTag))
   778                 else if (!tag.LocalName().DesC().CompareF(KEffectTag))
   779                     {
   779                     {
   780                     iCurrentTransition->SetEffectNameL(attribute.Value().DesC());
   780                     iCurrentTransition->SetEffectNameL(attribute.Value().DesC());
   781                     }
   781                     }
   782                 else if (!tag.LocalName().DesC().CompareF(KUidTag))
   782                 else if (!tag.LocalName().DesC().CompareF(KUidTag))
   783                     {
   783                     {
   784                     iCurrentTransition->SetUidL(attribute.Value().DesC());
   784                     iCurrentTransition->SetUid(attribute.Value().DesC());
   785                     }
   785                     }
   786                 else if( !tag.LocalName().DesC().CompareF(KTypeTag))
   786                 else if( !tag.LocalName().DesC().CompareF(KTypeTag))
   787                     {
   787                     {
   788                     iCurrentTransition->SetTypeL(attribute.Value().DesC());
   788                     iCurrentTransition->SetType(attribute.Value().DesC());
   789                     }
   789                     }
   790                 }
   790                 }
   791             }
   791             }
   792         else if (iParserState == EStateParsingCtrl)
   792         else if (iParserState == EStateParsingCtrl)
   793             {
   793             {
   987 
   987 
   988         for (TInt count = 0; count < transitionarray->Count();count++)
   988         for (TInt count = 0; count < transitionarray->Count();count++)
   989             {
   989             {
   990             CTFxTransition* transition = transitionarray->operator[](count);
   990             CTFxTransition* transition = transitionarray->operator[](count);
   991             CTFxEffect* effect = transition->Effect();
   991             CTFxEffect* effect = transition->Effect();
   992             if (transition && effect && effect->PathIndex() >=0)
   992             if ( effect && effect->PathIndex() >=0 )
   993                 {
   993                 {
   994                 err = aTransSrv->RegisterFullscreenKml(transition->ContextId(),
   994                 err = aTransSrv->RegisterFullscreenKml(transition->ContextId(),
   995                     transition->Uid(),
   995                     transition->Uid(),
   996                     aConfigParser->KmlBasePath(effect->PathIndex()),
   996                     aConfigParser->KmlBasePath(effect->PathIndex()),
   997                     effect->Filename(),
   997                     effect->Filename(),
  1012 
  1012 
  1013         for (TInt count = 0; count < ctrltransitionarray->Count();count++)
  1013         for (TInt count = 0; count < ctrltransitionarray->Count();count++)
  1014             {
  1014             {
  1015             CTFxCtrlTransition* ctrltransition = ctrltransitionarray->operator[](count);
  1015             CTFxCtrlTransition* ctrltransition = ctrltransitionarray->operator[](count);
  1016             CTFxEffect* effect = ctrltransition->Effect();
  1016             CTFxEffect* effect = ctrltransition->Effect();
  1017             if (ctrltransition && effect && effect->PathIndex() >=0)
  1017             if ( effect && effect->PathIndex() >=0)
  1018                 {
  1018                 {
  1019                 if (!ctrltransition->KmlRegistrationStatus())
  1019                 if (!ctrltransition->KmlRegistrationStatus())
  1020                     {
  1020                     {
  1021                     err = aTransSrv->RegisterControlKml(ctrltransition->ContextUid(),
  1021                     err = aTransSrv->RegisterControlKml(ctrltransition->ContextUid(),
  1022                         aConfigParser->KmlBasePath(effect->PathIndex()),
  1022                         aConfigParser->KmlBasePath(effect->PathIndex()),