/*----------------------------------------------------------------------------* * NAME * HandleAlertUpdate * * DESCRIPTION * This function indicates the type and number of alerts received * over the UART (ANS) * * RETURNS * Nothing. *----------------------------------------------------------------------------*/ extern void HandleAlertUpdate(alert_type alert) { uint8 alert_cat = alert_cat_simple; uint8 num_alert = 0; /* The first byte is the category identifier */ /* The second byte is the number of new alerts in this category */ if(alert == alert_type_new) { alert_cat = g_app_ans_data.new_alert_value[0]; num_alert = g_app_ans_data.new_alert_value[1]; } else { /* Unread alert */ alert_cat= g_app_ans_data.unread_alert_status_value[0]; num_alert = g_app_ans_data.unread_alert_status_value[1]; } DisplayType(alert); DisplayCategory(alert_cat); writeNumAlerts(num_alert); writeString("\n"); }
void WINAPI DumpGraph(IFilterGraph *pGraph, DWORD dwLevel) { if( !pGraph ) { return; } IEnumFilters *pFilters; DbgLog((LOG_TRACE,dwLevel,TEXT("DumpGraph [%x]"), pGraph)); if (FAILED(pGraph->EnumFilters(&pFilters))) { DbgLog((LOG_TRACE,dwLevel,TEXT("EnumFilters failed!"))); } IBaseFilter *pFilter; ULONG n; while (pFilters->Next(1, &pFilter, &n) == S_OK) { FILTER_INFO info; if (FAILED(pFilter->QueryFilterInfo(&info))) { DbgLog((LOG_TRACE,dwLevel,TEXT(" Filter [%x] -- failed QueryFilterInfo"), pFilter)); } else { QueryFilterInfoReleaseGraph(info); // !!! should QueryVendorInfo here! DbgLog((LOG_TRACE,dwLevel,TEXT(" Filter [%x] '%ls'"), pFilter, info.achName)); IEnumPins *pins; if (FAILED(pFilter->EnumPins(&pins))) { DbgLog((LOG_TRACE,dwLevel,TEXT("EnumPins failed!"))); } else { IPin *pPin; while (pins->Next(1, &pPin, &n) == S_OK) { PIN_INFO info; if (FAILED(pPin->QueryPinInfo(&info))) { DbgLog((LOG_TRACE,dwLevel,TEXT(" Pin [%x] -- failed QueryPinInfo"), pPin)); } else { QueryPinInfoReleaseFilter(info); IPin *pPinConnected = NULL; HRESULT hr = pPin->ConnectedTo(&pPinConnected); if (pPinConnected) { DbgLog((LOG_TRACE,dwLevel,TEXT(" Pin [%x] '%ls' [%sput]") TEXT(" Connected to pin [%x]"), pPin, info.achName, info.dir == PINDIR_INPUT ? TEXT("In") : TEXT("Out"), pPinConnected)); pPinConnected->Release(); // perhaps we should really dump the type both ways as a sanity // check? if (info.dir == PINDIR_OUTPUT) { AM_MEDIA_TYPE mt; hr = pPin->ConnectionMediaType(&mt); if (SUCCEEDED(hr)) { DisplayType(TEXT("Connection type"), &mt); FreeMediaType(mt); } } } else { DbgLog((LOG_TRACE,dwLevel, TEXT(" Pin [%x] '%ls' [%sput]"), pPin, info.achName, info.dir == PINDIR_INPUT ? TEXT("In") : TEXT("Out"))); } } pPin->Release(); } pins->Release(); } } pFilter->Release(); } pFilters->Release(); }
/*----------------------------------------------------------------------------* * NAME * DisplaySupportedCategories * * DESCRIPTION * This function displays the supported categories of ANS * * RETURNS * Nothing. *----------------------------------------------------------------------------*/ extern void DisplaySupportedCategories(alert_type alert) { uint8 alert_cat[2]; writeString("Supported"); if(alert == alert_type_new) { MemCopy(alert_cat,&g_app_ans_data.supported_new_alert_cat_value[0], 2); } else if(alert == alert_type_unread) { MemCopy(alert_cat, &g_app_ans_data.supported_unread_alert_cat_value[0], 2); } /* Display the alert type */ DisplayType(alert); /* Display the categories which remote host supports */ if(alert_cat[0] & alert_cat_bitmask_simple) { DisplayCategory(alert_cat_simple); } if(alert_cat[0] & alert_cat_bitmask_email) { DisplayCategory(alert_cat_email); } if(alert_cat[0] & alert_cat_bitmask_news) { DisplayCategory(alert_cat_news); } if(alert_cat[0] & alert_cat_bitmask_call) { DisplayCategory(alert_cat_call); } if(alert_cat[0] & alert_cat_bitmask_missed_call) { DisplayCategory(alert_cat_missed_call); } if(alert_cat[0] & alert_cat_bitmask_message) { DisplayCategory(alert_cat_message); } if(alert_cat[0] & alert_cat_bitmask_vmail) { DisplayCategory(alert_cat_vmail); } if(alert_cat[0] & alert_cat_bitmask_schedule) { DisplayCategory(alert_cat_schedule); } if(alert_cat[1] & alert_cat_bitmask_priority) { DisplayCategory(alert_cat_priority); } if(alert_cat[1] & alert_cat_bitmask_instant_msg) { DisplayCategory(alert_cat_instant_msg); } writeString("\n"); }
// --------------------------------------------------------------------------- // CCodConfirm::ShowDownloadConfirmationL // --------------------------------------------------------------------------- // TBool CCodConfirm::ShowDownloadConfirmationL(TInt aCbaResource, const CCodData& aData, TBool aCod ) { HBufC* itemText = NULL; // a buffer holding the text for each list item CEikFormattedCellListBox* listBox = new ( ELeave ) CAknDoublePopupMenuStyleListBox; CleanupStack::PushL( listBox ); // If supported show OK & Cancel buttons, otherwise just CANCEL CAknPopupList* popupList = CAknPopupList::NewL ( listBox, aCbaResource, AknPopupLayouts::EMenuDoubleWindow ); CleanupStack::PushL( popupList ); TInt flags = CEikListBox::EDisableHighlight; listBox->ConstructL( popupList, flags ); listBox->CreateScrollBarFrameL( ETrue ); listBox->ScrollBarFrame()->SetScrollBarVisibilityL ( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); MDesCArray* itemList = listBox->Model()->ItemTextArray(); CDesCArray* itemArray = (CDesCArray*)itemList; //------------------------------------------- // Header HBufC* header = StringLoader::LoadLC( R_QTN_CD_TITLE ); popupList->SetTitleL( *header ); CleanupStack::PopAndDestroy( header ); // header header = NULL; // make description of buf HBufC* buf; //------------------------------------------- // Name // HBufC* popHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_NAME ); // If media count more than one, show album name if present itemText = FormatListBoxItemLC( *popHeader, aData.Count() > 1 && aData.Name().Length()? aData.Name() : (*aData[aData.ActiveDownload()]).Name() ); itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 2, popHeader ); // itemText,popHeader itemText = NULL; popHeader = NULL; //------------------------------------------- // Content Size // HBufC* sizeHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_SIZE ); TInt size = aData.Size(); if( size >= KCodKbyte ) { // Round up. buf = StringLoader::LoadLC ( R_QTN_SIZE_KB, (size - 1) / KCodKbyte + 1, iCoeEnv ); } else { buf = StringLoader::LoadLC( R_QTN_SIZE_B, size, iCoeEnv ); } buf->Des().Trim(); itemText = FormatListBoxItemLC( *sizeHeader, *buf ); itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 3, sizeHeader ); // itemText, sizeHeader itemText = NULL; sizeHeader = NULL; //------------------------------------------- // Type // popHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_TYPE ); buf = AllocTypeNameL( DisplayType(aData)); CleanupStack::PushL(buf); itemText = FormatListBoxItemLC( *popHeader, *buf ); itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 3, popHeader ); // itemText, nameHeader itemText = NULL; popHeader = NULL; //------------------------------------------- // Price: only if it's aCod // if ( aCod ) { popHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_PRICE ); itemText = FormatListBoxItemLC( *popHeader, aData.Price() ); itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 2, popHeader ); // itemText, nameHeader itemText = NULL; popHeader = NULL; } //------------------------------------------- // Detail Description // popHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_DESCRIPT ); HBufC* popValue = StringLoader::LoadLC(R_QTN_CD_VALUE_UNDEFINED ); if (aData.Description().Length()) { itemText = FormatListBoxItemLC( *popHeader, aData.Description() ); } else { itemText = FormatListBoxItemLC( *popHeader, *popValue ); } itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 3, popHeader ); // itemText, popValue itemText = NULL; popHeader = NULL; //------------------------------------------- // Vendor Information // popHeader = StringLoader::LoadLC( R_QTN_CD_DETAIL_VENDOR ); popValue = StringLoader::LoadLC(R_QTN_CD_VALUE_UNDEFINED ); if (aData.Vendor().Length()) itemText = FormatListBoxItemLC( *popHeader, aData.Vendor() ); else itemText = FormatListBoxItemLC( *popHeader, *popValue ); itemArray->AppendL( *itemText ); CleanupStack::PopAndDestroy( 3, popHeader ); // itemText, popValue itemText = NULL; popHeader = NULL; TInt popupOk = popupList->ExecuteLD(); // cleanup CleanupStack::Pop( popupList ); CleanupStack::PopAndDestroy( listBox ); // listBox return popupOk; }