// -----------------------------------------------------------------------------
// CLandmarksCategoriesView::AddCategoryL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksCategoriesView::AddCategoryL()
    {
    // Create and initialize dialog
    TBuf<KPosLmMaxCategoryNameLength> categoryName;
    CAknTextQueryDialog* queryDialog = CAknTextQueryDialog::NewL(categoryName);
    queryDialog->SetMaxLength(KPosLmMaxCategoryNameLength);
    CleanupStack::PushL(queryDialog);

    // Create and set title
    HBufC* title = 
        iCoeEnv->AllocReadResourceAsDes16LC(R_LMREFAPP_NEW_CATEGORY);
    queryDialog->SetPromptL(*title);
    CleanupStack::PopAndDestroy(title);

    // Launch dialog
    TBool dialogDismissed = queryDialog->ExecuteLD(R_LMREFAPP_RENAME_QUERY);
    CleanupStack::Pop(queryDialog);
    if (dialogDismissed)
        {
        // Create and add a new category with user defined name.
        CPosLandmarkCategory* newCategory = CPosLandmarkCategory::NewLC();
        newCategory->SetCategoryNameL(categoryName);
        iEngine->AddCategoryL(*newCategory);
        CleanupStack::PopAndDestroy(newCategory);
        }
    }
// -----------------------------------------------------------------------------
// CLandmarksCategoriesView::RenameCategoryL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksCategoriesView::RenameCategoryL()
    {
    // Fetch existing category name
    CPosLandmarkCategory* category = 
        iEngine->CategoryLC(iContainer->CurrentCategoryId());
    TPtrC categoryName;
    category->GetCategoryName(categoryName);
    TBuf<KPosLmMaxCategoryNameLength> newCategoryName;
    newCategoryName.Insert(0, categoryName);

    // Create and initialize dialog
    CAknTextQueryDialog* queryDialog = 
        CAknTextQueryDialog::NewL(newCategoryName);
    queryDialog->SetMaxLength(KPosLmMaxCategoryNameLength);
    CleanupStack::PushL(queryDialog);

    // Create and set title
    HBufC* title = 
        iCoeEnv->AllocReadResourceAsDes16LC(R_LMREFAPP_CATEGORY_NAME);
    queryDialog->SetPromptL(*title);
    CleanupStack::PopAndDestroy(title);

    // Launch dialog
    TBool dialogAccepted = queryDialog->ExecuteLD(R_LMREFAPP_RENAME_QUERY);
    CleanupStack::Pop(queryDialog);
    if (dialogAccepted)
        {
        // Update category name
        category->SetCategoryNameL(newCategoryName);
        iEngine->UpdateCategoryL(*category);
        }

    CleanupStack::PopAndDestroy(category);
    }
void CSetupGisWeatherSettingItemList::InputUrl()
    {
	HBufC* mess = StringLoader::LoadLC(R_STR_TITLE_URL);
	CAknTextQueryDialog* Dialog =CAknTextQueryDialog::NewL(iSettings.Edit3(),CAknQueryDialog::ENoTone);
	Dialog->PrepareLC(R_ASK_NAME_DIALOG);
	Dialog->SetPromptL(*mess);
	Dialog->RunLD();
	LoadSettingsL();
    }
예제 #4
0
TBool ShowInputDlgL(const TInt& aTextResourceId,TDes& aText)
	{
	HBufC* prompt = StringLoader::LoadLC( aTextResourceId );
	CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( aText );
	
	dlg->SetPromptL(prompt->Des());
	dlg->SetMaxLength(KMaxName);
	TInt retCode( dlg->ExecuteLD( R_DIALOG_INPUT ));
	
	CleanupStack::PopAndDestroy(); //prompt
	return retCode;
	}
예제 #5
0
int CAppView::TextBox(const TDesC& title, const TDesC& inText, TDes& outText, int constraints) {
	if(iEngine->IsDrawing())
		iEngine->StopDrawing();
	outText.Copy(inText);
	CAknTextQueryDialog* dlg = new (ELeave) CAknTextQueryDialog(outText);
	CleanupStack::PushL(dlg);
	dlg->SetPromptL(title);
	dlg->SetPredictiveTextInputPermitted(true);
	dlg->SetMaxLength(outText.MaxLength());
	TBool answer = dlg->ExecuteLD(R_TEXTBOX_QUERY);
	CleanupStack::Pop(dlg);
	return answer ? 1 : 0;
}
예제 #6
0
// ----------------------------------------------------------------------------
// CAknExQueryContainer::ShowDataQueryL()
// Display of Data Query.
// ----------------------------------------------------------------------------
//
void CAknExQueryContainer::ShowDataQueryL(
    const TInt aQueryResourceId,
    const TInt aTextResourceId,
    const TInt aPromptResourceId,
    const TInt aMaxLength,
    const TBool aDisplayFlag )
    {
    iDisplayDialog = ETrue;
    SetTextToLabelL( R_AKNEXQUERY_OPERATE_MESSAGE );

    TBuf<KAknExQueryTextBufLength> textData;
    if ( aTextResourceId )
        {
        iCoeEnv->ReadResource( textData, aTextResourceId );
        }

    CAknTextQueryDialog* dlg;
    if ( !aPromptResourceId )
        {
        dlg = new ( ELeave )CAknTextQueryDialog(
            textData, CAknQueryDialog::ENoTone );
        }
    else
        {
        TBuf<KAknExQueryTextBufLength> prompt;
        iCoeEnv->ReadResource( prompt, aTextResourceId );
        dlg = CAknTextQueryDialog::NewL(
            textData, CAknQueryDialog::ENoTone );
        CleanupStack::PushL( dlg );
        dlg->SetPromptL( prompt );
        CleanupStack::Pop(); // dlg
        }

    if ( aMaxLength )
        {
        dlg->SetMaxLength( aMaxLength );
        }

    TBool answer( dlg->ExecuteLD( aQueryResourceId ) );

    if ( aDisplayFlag && answer )
        {
        iLabelResultMessage->SetTextL( textData );
        }

    iDisplayDialog = EFalse;

    DrawNow();
    }
예제 #7
0
int CAppView::TextBox(const TDesC& title, const TDesC& inText, TDes& outText, int constraints) {
	int resourceId;
	int type = constraints & 0xFFF;
	switch(type) {
	case MA_TB_TYPE_ANY:
		resourceId = R_TEXTBOX_QUERY;
		break;
	case MA_TB_TYPE_EMAILADDR:
	case MA_TB_TYPE_NUMERIC:
	case MA_TB_TYPE_PHONENUMBER:
	case MA_TB_TYPE_URL:
	case MA_TB_TYPE_DECIMAL:
	case MA_TB_TYPE_SINGLE_LINE:
		resourceId = R_TEXTBOX_QUERY_SINGLE_LINE;
		break;
	default:
		return MA_TB_RES_TYPE_UNAVAILABLE;
	}

	if(iEngine->IsDrawing())
		iEngine->StopDrawing();

	outText.Copy(inText);
	CAknTextQueryDialog* dlg = new (ELeave) CMyAknTextQueryDialog(outText);
	CleanupStack::PushL(dlg);
	dlg->SetPromptL(title);
	dlg->SetMaxLength(outText.MaxLength());

	if(type == MA_TB_TYPE_NUMERIC || type == MA_TB_TYPE_PHONENUMBER || type == MA_TB_TYPE_DECIMAL)
		dlg->SetDefaultInputMode(EAknEditorNumericInputMode);

	bool predict = (constraints & (MA_TB_FLAG_PASSWORD | MA_TB_FLAG_SENSITIVE |
		MA_TB_FLAG_NON_PREDICTIVE)) == 0;
	if(!(type == MA_TB_TYPE_ANY || type == MA_TB_TYPE_SINGLE_LINE))
		predict = false;
	dlg->SetPredictiveTextInputPermitted(predict);

	TBool answer = dlg->ExecuteLD(resourceId);
	CleanupStack::Pop(dlg);
	return answer ? 1 : 0;
}
예제 #8
0
/*
-----------------------------------------------------------------------------
RFile GetAttachmentFileL(TMsvAttachmentId aId)
----------------------------------------------------------------------------
*/
void CMailBoxContainer::CopyFileL(const TDesC& aFolderName)
{

	TFileName fileName,FullFilName;

	if(iSession && iSelectionBox && iListArray)
	{	
		TInt CurrItmIndex = iSelCopyItemIndex;
		iSelCopyItemIndex = -1;
		
		if(CurrItmIndex < 0 || CurrItmIndex >= iIDArray->Count())
		{
			CurrItmIndex = iSelectionBox->CurrentItemIndex();
		}
		
		TMsvSelectionOrdering sort;
		sort.SetShowInvisibleEntries(ETrue);
		sort.SetSorting(EMsvSortByDate);
		// Take a handle to the folder entry
		CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,iCurrentMailBox,sort);
		CleanupStack::PushL(parentEntry);
		
		// A selection of all BT entries
		CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt);
		CleanupStack::PushL(entries);
			
		//Process all entries
		if(CurrItmIndex >= 0 && CurrItmIndex < iIDArray->Count())
		{
			//Get entry
			CMsvEntry* btEntry = iSession->GetEntryL(iIDArray->At(CurrItmIndex).iEnt);
			CleanupStack::PushL(btEntry);
			
			//Then get entrys child
			CMsvEntrySelection* btChildren = btEntry->ChildrenL();
			CleanupStack::PushL(btChildren);
		
			btEntry->SetEntryL(iIDArray->At(CurrItmIndex).iMsg);
									
	
			if (btEntry->HasStoreL())
			{
				CMsvStore* store = btEntry->ReadStoreL();
				CleanupStack::PushL(store);
				
				MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
				CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(iIDArray->At(CurrItmIndex).iAtt);
				if(attachment)
				{
					fileName.Copy(attachment->AttachmentName());
					
					delete attachment;
					attachment = NULL;
				
					TBool OkToSave(EFalse),SkipMe(EFalse);
				
					do
					{
						FullFilName.Zero();
						StringLoader::Load(FullFilName,R_SH_STR_FILENAME);
					
						CAknTextQueryDialog* Dialog = CAknTextQueryDialog::NewL(fileName,CAknQueryDialog::ENoTone);
						Dialog->PrepareLC(R_ASK_NAME_DIALOG);
						Dialog->SetPromptL(FullFilName);
						if(Dialog->RunLD())
						{
							FullFilName.Copy(aFolderName);
							FullFilName.Append(fileName);
			
							if(BaflUtils::FileExists(CEikonEnv::Static()->FsSession(),FullFilName))
							{
								HBufC* TmpText = StringLoader::LoadLC(R_SH_STR_FILOVERRT);
								
								CAknQueryDialog* dlg = CAknQueryDialog::NewL();
								if(dlg->ExecuteLD(R_QUERY,*TmpText))
								{
									TInt Err = CEikonEnv::Static()->FsSession().Delete(FullFilName);
									if(Err == KErrNone)
									{
										OkToSave = ETrue;
									}
									else
									{
										iUtils.GetFileUtils().ShowFileErrorNoteL(FullFilName,Err);
									}
								}
								
								CleanupStack::PopAndDestroy(TmpText);
							}
							else
							{
								OkToSave = ETrue;
							}
						}
						else
						{
							SkipMe = ETrue;
						}
						
					}while(!SkipMe && !OkToSave);
					
					if(OkToSave)
					{
						
						delete iRFileCopier;
						iRFileCopier = NULL;
						
						iRFileCopier = CRFileCopier::NewL(*this,CEikonEnv::Static()->FsSession(),ETrue);
						
						RFile SourceFil(attMngr.GetAttachmentFileL(iIDArray->At(CurrItmIndex).iAtt));
						iRFileCopier->StartCopyL(SourceFil,FullFilName);
						SourceFil.Close();
					}
				}
				
				CleanupStack::PopAndDestroy(store);
			}
			
			CleanupStack::PopAndDestroy(2);
		}				
		CleanupStack::PopAndDestroy(2);
	}

}