使用第三方FEP时显示SMS统计
文章信息
- 详细描述
这篇文章描述了如何在使用第三方FEP输入法时(基于S60 Platform: FEP Example)可以显示短信统计。
根据S60 Platform: FEP Example,你可以使用iNaviPane->CreateMessageLabelL(KNaviPaneTextPinYin)方法,以便更新导航栏的显示。但时这也使得用户在短信程序中无法看到短信统计信息。
- 解决方案
在S60 Platform: FEP Example中,CreateMessageLabelL生成了一个新的CAknNavigationDecorator的对象,从而覆盖了好的。而这时第三方程序(如短信程序)需要它。你应该使用下列方法,获得原始导航栏的信息,并将它们增加到你生成的新CAknNavigationDecorator对象中。
void CFepIndicator::SetState(TAknEditingState aState)
{
.
.
.
else if (aState == ENumeric)
{
if (iNaviDecorator)
{
delete iNaviDecorator;
iNaviDecorator = NULL;
}
// Get original the pointer to CAknNavigationDecorator object
// from original navi pane
CAknNavigationDecorator* deco = iNaviPane->Top();
// If the original object is text or navi label type, retrieve
// its content
if( deco->ControlType() == CAknNavigationDecorator::EHintText
|| deco->ControlType() == AknNavigationDecorator::ENaviLabel )
{
CAknNaviLabel* label =
STATIC_CAST(CAknNaviLabel*, deco->DecoratedControl());
// After this, label->Text() retrieves the text used in the orig.
// label, which can then be added to the new navi label.
}
}
要获得原始导航栏的事件触发。你需要生成一个MAknNaviDecoratorObserver对象,并用deco->SetNaviDecoratorObserver()设置。
这样其成员函数HandleNaviDecoratorEventL即在你需要更新导航栏时进行检查。

