Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
33 #include <techview/eikchlst.h>
34 #include <techview/eikfprev.h>
35 #include <techview/eikbtpan.h>
36 #include <techview/eikcmbut.h>
37 #include <techview/eikchkbx.h>
38 #include <techview/eikfpne.h>
39 #include <techview/eikcfdlg.h>
40 #include <techview/eikfsel.h>
41 #include <techview/eikprtdg.h>
42 #include <techview/eikinfo.h>
43 #include <techview/eikon.rsg>
44 #include <techview/eikfsel.h>
46 #include <techview/eikdclbm.h>
47 #include <techview/eikfbrow.h>
48 #include <techview/eikufsel.h>
49 #include <techview/eiklbbut.h>
50 #include <techview/eikchmap.h>
51 #include <techview/eikbtgpc.h>
56 #include "wpresources.h"
61 const TInt KShortErrorMessageLength = 64;
62 const TInt KMaxDisplayedFullNameLen = 35;
65 // class CWordBulletDialog
68 CWordBulletDialog::CWordBulletDialog(TBullet* aBullet,TRgb aBackColor, CPrinterDevice* ,const TDesC& aFontName)
73 iBackColor=aBackColor;
76 CWordBulletDialog::~CWordBulletDialog()
80 void CWordBulletDialog::PreLayoutDynInitL()
82 CEikCharMap* charMap = STATIC_CAST(CEikCharMap*, Control(EWordCidBulletCharMap));
83 charMap->SetChar(iBullet.iCharacterCode);
87 void CWordBulletDialog::HandleControlStateChangeL(TInt aControlId)
89 if (aControlId == EWordCidBulletCharMap)
91 const TUint charCode = STATIC_CAST(CEikCharMap*, Control(EWordCidBulletCharMap))->GetChar();
92 iBullet.iCharacterCode = (TText)charCode;
96 TBool CWordBulletDialog::OkToExitL(TInt aButtonId)
98 if (aButtonId==EWordCidFormatBullet)
100 CEikDialog* dialog=new(ELeave) CWordBulletFormatDialog(&iBullet,iBackColor,NULL,iFontName);
101 dialog->ExecuteLD(R_WORD_DIALOG_FORMAT_BULLET);
104 *iWordBullet=iBullet;
109 // class CWordBulletFormatDialog
112 CWordBulletFormatDialog::CWordBulletFormatDialog(TBullet* aBullet,TRgb aBackColor, CPrinterDevice* ,const TDesC& aFontName)
113 :iFontName(aFontName)
117 iBackColor=aBackColor;
120 CWordBulletFormatDialog::~CWordBulletFormatDialog()
125 SEikControlInfo CWordBulletFormatDialog::CreateCustomControlL(TInt aControlType)
127 SEikControlInfo info;
129 info.iTrailerTextId=0;
130 info.iFlags=EEikControlIsNonFocusing;
131 if (aControlType==EWordCtBulletPreviewLabel)
132 info.iControl=new(ELeave) CWordBulletPreviewLabel;
136 void CWordBulletFormatDialog::PreLayoutDynInitL()
138 CWordBulletPreviewLabel* label=(CWordBulletPreviewLabel*)Control(EWordCidBulletCharacter);
139 label->iBrushColor=iBackColor;
140 label->iTextColor=iBullet.iColor;
142 fontSpec.iHeight=iBullet.iHeightInTwips;
143 fontSpec.iTypeface.iName=_L("Swiss");
144 label->SetFontSpecL(fontSpec);
145 SetPreviewLabelL(iBullet.iCharacterCode);
146 SetGraySelectorColor(EWordCidBulletColor,iBullet.iColor);
147 iTwipsList=new(ELeave) CArrayFixFlat<TInt>(4);
148 iPointsList=new(ELeave) CDesCArrayFlat(4);
149 FontUtils::GetAvailableHeightsInTwipsAndPointsL(*iCoeEnv->ScreenDevice(),iFontName,*iTwipsList,*iPointsList);
150 CEikChoiceList* chlst=(CEikChoiceList*)Control(EWordCidBulletHeight);
151 chlst->SetArrayL(iPointsList);
152 chlst->SetArrayExternalOwnership(EFalse);
153 const TInt index = FontUtils::IndexOfNearestHeight(*iTwipsList, iBullet.iHeightInTwips);
154 chlst->SetCurrentItem(index);
155 CEikButtonBase::TState state=(iBullet.iHangingIndent? CEikButtonBase::ESet : CEikButtonBase::EClear);
156 SetCheckBoxState(EWordCidBulletIndent,state);
159 void CWordBulletFormatDialog::SetPreviewLabelL(TUint aCharCode)
161 TChar bullet(aCharCode);
164 SetLabelL(EWordCidBulletCharacter,buf);
167 void CWordBulletFormatDialog::HandleControlStateChangeL(TInt aControlId)
171 case EWordCidBulletColor:
173 const TRgb color=GraySelectorColor(EWordCidBulletColor);
174 CWordBulletPreviewLabel* label=(CWordBulletPreviewLabel*)Control(EWordCidBulletCharacter);
175 label->iTextColor=color;
177 iBullet.iColor=color;
180 case EWordCidBulletHeight:
182 const TInt height=(*iTwipsList)[ChoiceListCurrentItem(EWordCidBulletHeight)];
183 iBullet.iHeightInTwips=height;
185 CWordBulletPreviewLabel* label=(CWordBulletPreviewLabel*)Control(EWordCidBulletCharacter);
186 fontSpec.iHeight=height;
187 fontSpec.iTypeface.iName=_L("Swiss");
188 label->SetFontSpecL(fontSpec);
192 case EWordCidBulletIndent:
193 iBullet.iHangingIndent=(CheckBoxState(EWordCidBulletIndent)==CEikButtonBase::ESet);
200 TBool CWordBulletFormatDialog::OkToExitL(TInt /*aButtonId*/)
202 *iWordBullet=iBullet;
207 // class CWordBulletPreviewLabel
210 CWordBulletPreviewLabel::CWordBulletPreviewLabel()
213 CWordBulletPreviewLabel::~CWordBulletPreviewLabel()
215 iCoeEnv->ReleaseScreenFont(CONST_CAST(CFont*,iPrevFont));
218 void CWordBulletPreviewLabel::SetFontSpecL(TFontSpec& aFontSpec)
220 iCoeEnv->ReleaseScreenFont(CONST_CAST(CFont*,iPrevFont));
221 iPrevFont=iCoeEnv->CreateScreenFontL(aFontSpec);
224 TSize CWordBulletPreviewLabel::MinimumSize()
226 return TSize(40,40); // an attempt to make label big enough for most font heights
229 void CWordBulletPreviewLabel::Draw(const TRect& /*aRect*/) const
231 CWindowGc& gc=SystemGc();
232 gc.UseFont(iPrevFont);
233 gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
234 gc.SetBrushColor(iBrushColor);
235 gc.SetPenStyle(CGraphicsContext::ESolidPen);
236 gc.SetPenColor(iTextColor);
237 const TInt ascent=iPrevFont->AscentInPixels();
238 const TRect rect(Rect());
239 const TInt baselineOffset=ascent+((rect.Height()-ascent)/2);
240 gc.DrawText(*iText,rect,baselineOffset,CGraphicsContext::ECenter);
244 // class CWordGoToDialog
247 CWordGoToDialog::CWordGoToDialog(TInt aMaxPages, TInt* aCurrentPage)
250 iCurrentPage=aCurrentPage;
253 void CWordGoToDialog::PreLayoutDynInitL()
255 SetNumberEditorMinAndMax(EWordCidPageNumber,1,iMaxPages);
256 SetNumberEditorValue(EWordCidPageNumber,*iCurrentPage);
260 SetLabelL(EWordCidPages, buf);
263 TBool CWordGoToDialog::OkToExitL(TInt /*aButtonId*/)
265 *iCurrentPage=NumberEditorValue(EWordCidPageNumber);
270 // CWordViewPreferencesDialog
273 CWordViewPreferencesDialog::CWordViewPreferencesDialog(TNonPrintingCharVisibility& aVisibility)
274 : iVisibility(aVisibility)
277 void CWordViewPreferencesDialog::PreLayoutDynInitL()
279 CEikButtonBase::TState button=CEikButtonBase::EClear;
281 button=(iVisibility.TabsVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
282 SetCheckBoxState(EWordCidTab,button);
284 button=(iVisibility.SpacesVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
285 SetCheckBoxState(EWordCidSpaces,button);
287 button=(iVisibility.ParagraphDelimitersVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
288 SetCheckBoxState(EWordCidParaEnds,button);
290 button=(iVisibility.NonBreakingHyphensVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
291 SetCheckBoxState(EWordCidHardHyphens,button);
293 button=(iVisibility.LineBreaksVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
294 SetCheckBoxState(EWordCidForcedLineBreaks,button);
296 button=(iVisibility.NonBreakingSpacesVisible())?CEikButtonBase::ESet : CEikButtonBase::EClear;
297 SetCheckBoxState(EWordCidNonBreakingSpace,button);
300 void CWordViewPreferencesDialog::WordSetCheckBoxState(CEikButtonBase::TState aState)
302 SetCheckBoxState(EWordCidTab,aState);
303 SetCheckBoxState(EWordCidSpaces,aState);
304 SetCheckBoxState(EWordCidParaEnds,aState);
305 SetCheckBoxState(EWordCidHardHyphens,aState);
306 SetCheckBoxState(EWordCidForcedLineBreaks,aState);
307 SetCheckBoxState(EWordCidNonBreakingSpace,aState);
310 TBool CWordViewPreferencesDialog::OkToExitL(TInt /*aButtonId*/)
313 CEikButtonBase::TState button=CEikButtonBase::EClear;
315 button=CheckBoxState(EWordCidTab);
316 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
317 iVisibility.SetTabsVisible(visible);
319 button=CheckBoxState(EWordCidSpaces);
320 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
321 iVisibility.SetSpacesVisible(visible);
323 button=CheckBoxState(EWordCidParaEnds);
324 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
325 iVisibility.SetParagraphDelimitersVisible(visible);
327 button=CheckBoxState(EWordCidHardHyphens);
328 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
329 iVisibility.SetNonBreakingHyphensVisible(visible);
331 button=CheckBoxState(EWordCidForcedLineBreaks);
332 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
333 iVisibility.SetLineBreaksVisible(visible);
335 button=CheckBoxState(EWordCidNonBreakingSpace);
336 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
337 iVisibility.SetNonBreakingSpacesVisible(visible);
345 // CWordObjectPreferencesDialog & Revert To Style dialog
348 CWordObjectPreferencesDialog::CWordObjectPreferencesDialog(TBool& aSketchAsGlass,TBool& aGraphAsGlass/*,TInt aButton*/)
349 : iSketchAsGlass(aSketchAsGlass),iGraphAsGlass(aGraphAsGlass)/*,iButton(aButton)*/
352 void CWordObjectPreferencesDialog::PreLayoutDynInitL()
355 // // Change the dialog text as appropriate
356 // if (!iObjectPreferenceDialog)
358 /// SetTitleL(R_WORD_STYLE_REVERT_TITLE);
362 CEikButtonBase::TState button=CEikButtonBase::EClear;
365 button=(iSketchAsGlass) ? CEikButtonBase::EClear : CEikButtonBase::ESet;
366 SetCheckBoxState(EWordCidShowSketch,button);
368 button=(iGraphAsGlass) ? CEikButtonBase::EClear : CEikButtonBase::ESet;
369 SetCheckBoxState(EWordCidShowGraph,button);
372 void CWordObjectPreferencesDialog::WordSetCheckBoxState(CEikButtonBase::TState aState)
374 SetCheckBoxState(EWordCidShowSketch,aState);
375 SetCheckBoxState(EWordCidShowGraph,aState);
378 TBool CWordObjectPreferencesDialog::OkToExitL(TInt /*aButtonId*/)
381 CEikButtonBase::TState button=CEikButtonBase::EClear;
384 button=CheckBoxState(EWordCidShowSketch);
385 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
386 iSketchAsGlass=!visible;
388 button=CheckBoxState(EWordCidShowGraph);
389 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
390 iGraphAsGlass=!visible;
396 // CWordObjectPreferencesDialog & Revert To Style dialog
399 CWordRevertToStyleDialog::CWordRevertToStyleDialog(TBool& aSketchAsGlass,TBool& aGraphAsGlass)
400 : iSketchAsGlass(aSketchAsGlass),iGraphAsGlass(aGraphAsGlass)
403 void CWordRevertToStyleDialog::PreLayoutDynInitL()
406 // // Change the dialog text as appropriate
407 // if (!iObjectPreferenceDialog)
409 /// SetTitleL(R_WORD_STYLE_REVERT_TITLE);
413 CEikButtonBase::TState button=CEikButtonBase::EClear;
416 button=(iSketchAsGlass) ? CEikButtonBase::ESet : CEikButtonBase::EClear;
417 SetCheckBoxState(EWordCidRemoveChar,button);
419 button=(iGraphAsGlass) ? CEikButtonBase::ESet : CEikButtonBase::EClear;
420 SetCheckBoxState(EWordCidRemovePara,button);
423 void CWordRevertToStyleDialog::WordSetCheckBoxState(CEikButtonBase::TState aState)
425 SetCheckBoxState(EWordCidRemoveChar,aState);
426 SetCheckBoxState(EWordCidRemovePara,aState);
429 TBool CWordRevertToStyleDialog::OkToExitL(TInt /*aButtonId*/)
432 CEikButtonBase::TState button=CEikButtonBase::EClear;
435 button=CheckBoxState(EWordCidRemoveChar);
436 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
437 iSketchAsGlass=visible;
439 button=CheckBoxState(EWordCidRemovePara);
440 visible=button? CEikButtonBase::ESet : CEikButtonBase::EClear;
441 iGraphAsGlass=visible;
447 // Manual zoom setting dialog
450 CWordTempManualZoomDialog::CWordTempManualZoomDialog(TInt& aOrigZoomFactor)
451 : iOrigZoomFactor(aOrigZoomFactor)
452 {__ASSERT_DEBUG(iOrigZoomFactor>0,Panic(EWordZeroZoomFactor));}
455 void CWordTempManualZoomDialog::PreLayoutDynInitL()
457 // set the control with the current zoom factor
458 __ASSERT_DEBUG(iOrigZoomFactor>0,Panic(EWordZeroZoomFactor));
459 SetNumberEditorValue(EWordCidZoomSet,iOrigZoomFactor/10);
463 TBool CWordTempManualZoomDialog::OkToExitL(TInt /*aButtonId*/)
465 iOrigZoomFactor=(NumberEditorValue(EWordCidZoomSet))*10;
471 // Custom File Open dialog
475 CWordFileOpenDialog::CWordFileOpenDialog(TDes* aFileName,TBool& aReadOnly,TInt aTitleId)
476 : CEikFileOpenDialog(aFileName,aTitleId),
479 __DECLARE_NAME(_S("CWordFileOpenDialog"));
483 void CWordFileOpenDialog::HandleControlStateChangeL(TInt)
487 TBool CWordFileOpenDialog::OkToExitL(TInt aButtonId)
489 if (CEikFileOpenDialog::OkToExitL(aButtonId))
491 iReadOnly=CheckBoxState(EWordCidReadOnly)==CEikButtonBase::ESet;
498 // Custom File New dialog with templates
501 CWordTemplateNewFileDialog::CWordTemplateNewFileDialog(TDes* aFileName, TFileName& aTemplateFileName, TUidType aUid)
502 : CEikFileSaveAsDialog(aFileName,NULL,R_EIK_TBUF_CREATE_NEW_FILE), iTemplateFileName(aTemplateFileName),
507 TBool CWordTemplateNewFileDialog::OkToExitL(TInt aButtonId)
509 if(!CEikFileSaveAsDialog::OkToExitL(aButtonId))
511 // Check to see if the template is still there
512 CEikUnifiedFileNameSelector* templateFileNameSel = (CEikUnifiedFileNameSelector*) (Control(EEikCtUnifiedFileSel));
513 iTemplateFileName = templateFileNameSel->FullName();
514 if(ConeUtils::FileExists(iTemplateFileName))
518 iEikonEnv->InfoMsg(R_WORD_TEMPLATE_NOT_AVAILABLE);
523 void CWordTemplateNewFileDialog::PreLayoutDynInitL()
525 CEikFileSaveAsDialog::PreLayoutDynInitL();
526 TFileName templateFileName;
527 TWordFilePath::GetNormalTemplateFolderName(templateFileName);
528 TFileName tempFileName;
529 TFindFile ff(iEikonEnv->FsSession());
531 iEikonEnv->ReadResource(tempFileName, R_WORD_NORMAL_TEMPLATE_FILE_NAME);
532 templateFileName.Append(tempFileName);
533 templateFileName[0] = 'Y';
534 TParsePtr parse(templateFileName);
535 TInt err = ff.FindByDir(parse.NameAndExt(),parse.DriveAndPath());
538 // no normal template, search ROM for blank
539 TWordFilePath::GetNormalTemplateFolderName(templateFileName);
540 iEikonEnv->ReadResource(tempFileName, R_WORD_BLANK_TEMPLATE_FILE_NAME);
541 templateFileName.Append(tempFileName);
542 templateFileName[0] = 'Z';
543 TParsePtr blankParse(templateFileName);
544 User::LeaveIfError(ff.FindByDir(blankParse.NameAndExt(),blankParse.DriveAndPath()));
546 templateFileName = ff.File();
548 CEikUnifiedFileNameSelector* templateFileNameSel = (CEikUnifiedFileNameSelector*) (Control(EEikCtUnifiedFileSel));
549 templateFileNameSel->SetUidType(iUid);
550 templateFileNameSel->SetROMIncluded(ETrue);
551 templateFileNameSel->SetFullNameL(templateFileName);
554 SEikControlInfo CWordTemplateNewFileDialog::CreateCustomControlL(TInt aControlType)
556 SEikControlInfo controlInfo;
557 controlInfo.iControl=NULL;
558 controlInfo.iTrailerTextId=0;
559 controlInfo.iFlags=0;
563 case EWordUnifiedFileNameSelector:
565 CWordUnifiedFileSelector* newControl = new(ELeave) CWordUnifiedFileSelector();
566 controlInfo.iControl = newControl;
567 controlInfo.iFlags = EEikControlHasEars;
577 // class CWordUnifiedFileSelector file selector with sorting
580 void CWordUnifiedFileSelector::SortArray(MDesCArray* aFileNames)
583 iEikonEnv->ReadResource(blank, R_WORD_BLANK_TEMPLATE_FILE_NAME);
584 TInt count = aFileNames->MdcaCount();
585 for (TInt i = 0 ; i < count; i++)
587 if (aFileNames->MdcaPoint(i) == blank)
591 CDesCArray* array = STATIC_CAST(CDesCArray*,aFileNames);
592 TRAPD(err,array->InsertL(0, blank)); // top
602 void CWordUnifiedFileSelector::BuildFileNameArrayL(const TParse& aParse, MDesCArray* aFileNames)
604 CEikUnifiedFileNameSelector::BuildFileNameArrayL(aParse, aFileNames);
605 SortArray(aFileNames);
609 // class CWordDeleteTemplateDialog
612 CWordDeleteTemplateDialog::CWordDeleteTemplateDialog(TFileName& aTemplateFileName, TUidType aUid)
613 : iTemplateFileName(aTemplateFileName), iUid(aUid)
617 TBool CWordDeleteTemplateDialog::OkToExitL(TInt /*aButtonId*/)
619 CEikUnifiedFileNameSelector* templateFileNameSel = STATIC_CAST(CEikUnifiedFileNameSelector*,(Control(EEikCtUnifiedFileSel)));
620 iTemplateFileName = templateFileNameSel->FullName();
622 if (!iTemplateFileName.Length())
625 // Confirm this is what the user really wants
626 TParsePtrC parse(iTemplateFileName);
627 TFileName confirmPre;
628 TBuf<30> confirmPost;
629 iEikonEnv->ReadResource(confirmPre, R_WORD_TEMPLATE_DELETE_CONFIRMATION_PRE);
630 iEikonEnv->ReadResource(confirmPost, R_WORD_TEMPLATE_DELETE_CONFIRMATION_POST);
631 TInt gap = 60 - confirmPre.Length() - confirmPost.Length();
632 if (parse.NameAndExt().Length() > gap)
634 TFileName name = parse.NameAndExt();
635 confirmPre.Append(name.Left(gap - 1));
636 confirmPre.Append((TChar)KEllipsis);
639 confirmPre.Append(parse.NameAndExt());
640 confirmPre.Append(confirmPost);
641 confirmPost = _L("");
643 if (!iEikonEnv->QueryWinL(confirmPre, confirmPost))
644 iTemplateFileName = TFileName();
648 void CWordDeleteTemplateDialog::PreLayoutDynInitL()
650 CEikUnifiedFileNameSelector* templateFileNameSel = STATIC_CAST(CEikUnifiedFileNameSelector*,(Control(EEikCtUnifiedFileSel)));
651 templateFileNameSel->SetUidType(iUid);
652 templateFileNameSel->SetROMIncluded(EFalse);
653 templateFileNameSel->SetFullNameL(iTemplateFileName);
657 // class CWordSaveAsTemplateDialog
660 CWordSaveAsTemplateDialog::CWordSaveAsTemplateDialog(TFileName& aTemplateFileName, TUidType aUid)
661 : iTemplateFileName(aTemplateFileName), iUid(aUid)
665 TBool CWordSaveAsTemplateDialog::OkToExitL(TInt /*aButtonId*/)
667 CEikFileNameEditor* templateFileNameEd = STATIC_CAST(CEikFileNameEditor*,(Control(EEikCidFileNameEd)));
668 CEikDriveNameSelector *driveNameSelector = STATIC_CAST(CEikDriveNameSelector*,(Control(EEikCidDriveNameSel)));
669 templateFileNameEd->GetFullNameL(iTemplateFileName);
671 TFileName drivename = driveNameSelector->FullName();
673 User::LeaveIfError(parse.Set(drivename, &iTemplateFileName,NULL));
674 iTemplateFileName = parse.FullName();
675 TBool doNotReplaceExistingFile = EFalse;
676 TUint attributes = 0;
677 if (ConeUtils::FileExists(iTemplateFileName))
679 TBuf<32> infoDialogTitle;
680 iEikonEnv->ReadResource(infoDialogTitle, R_EIK_TBUF_DIALOG_TITLE_CONFIRM_FILE_REPLACE);
681 TBuf<KShortErrorMessageLength> formatStr;
682 User::LeaveIfError(iEikonEnv->FsSession().Att(iTemplateFileName, attributes));
683 if (attributes & KEntryAttReadOnly)
684 iEikonEnv->LeaveWithInfoMsg(R_EIK_TBUF_CANNOT_REPLACE_READONLY_FILE);
686 iEikonEnv->ReadResource(formatStr, R_EIK_TBUF_FILE_REPLACE_CONFIRM1);
687 TBuf<KMaxDisplayedFullNameLen> abbrevName;
688 User::LeaveIfError(EikFileUtils::Parse(iTemplateFileName));
689 TParsePtr parse(iTemplateFileName);
690 EikFileUtils::AbbreviateFileName(parse.NameAndExt(), abbrevName);
691 TBuf<KShortErrorMessageLength + KMaxDisplayedFullNameLen> textMsg;
692 textMsg.Format(formatStr, &abbrevName);
693 CEikDialog* infoDialog = new(ELeave) CEikInfoDialog(infoDialogTitle, textMsg,CEikInfoDialog::EIgnoreEnter);
694 if (!(infoDialog->ExecuteLD(R_EIK_DIALOG_SINGLE_FILE_REPLACE)))
695 doNotReplaceExistingFile = ETrue;
697 return !doNotReplaceExistingFile;
700 void CWordSaveAsTemplateDialog::PreLayoutDynInitL()
702 TFileName templateFileName;
703 TWordFilePath::GetNormalTemplateFolderName(templateFileName);
705 CEikFileNameEditor* templateFileNameEd = STATIC_CAST(CEikFileNameEditor*,(Control(EEikCidFileNameEd)));
706 CEikDriveNameSelector *driveNameSelector = STATIC_CAST(CEikDriveNameSelector*,(Control(EEikCidDriveNameSel)));
708 templateFileNameEd->SetFullNameL(templateFileName);
710 // set drive to be system drive
711 templateFileName[0] = 'A' + static_cast<TInt>(RFs::GetSystemDrive());
713 driveNameSelector->ShowRom(EFalse);
714 driveNameSelector->SetFullNameL(templateFileName);
719 CWordOutlineDialog::CWordOutlineDialog(CRichText* aText, CEikEdwin* aEdWin, TInt& aNewCursorPosition)
722 iNewCursorPosition(aNewCursorPosition)
728 TBool CWordOutlineDialog::OkToExitL(TInt aButtonId)
733 iNewCursorPosition = iOutlineNav->OutlineModel()->CurrentCharPosition();
735 case EWordBidOpenAll:
736 iOutlineNav->ExpandAllItemsL();
738 case EWordBidCloseAll:
739 iOutlineNav->CollapseAllItemsL();
747 SEikControlInfo CWordOutlineDialog::CreateCustomControlL(TInt aControlType)
749 SEikControlInfo controlInfo;
750 controlInfo.iControl=NULL;
751 controlInfo.iTrailerTextId=0;
752 controlInfo.iFlags=0;
754 COutlineHListBox* newControl;
758 case EWordCtOutlineNav:
759 newControl = new(ELeave)COutlineHListBox(iText,iEdWin->CursorPos());
760 controlInfo.iControl = newControl;
761 iOutlineNav = newControl;