-void CPerlAppUi::ConstructL()
-{
- BaseConstructL();
- iAppView = CPerlAppView::NewL(ClientRect());
- AddToStackL(iAppView);
- iFs = NULL;
- CEikonEnv::Static()->DisableExitChecks(ETrue); // Symbian FAQ-0577.
-}
-
-CPerlAppUi::~CPerlAppUi()
-{
- if (iAppView) {
- iEikonEnv->RemoveFromStack(iAppView);
- delete iAppView;
- iAppView = NULL;
- }
- if (iFs) {
- delete iFs;
- iFs = NULL;
- }
- if (iDoorObserver) // Otherwise the embedding application waits forever.
- iDoorObserver->NotifyExit(MApaEmbeddedDocObserver::EEmpty);
-}
-
-static TBool DlgOk(CAknNoteDialog* dlg)
-{
- return dlg && dlg->RunDlgLD() == EAknSoftkeyOk;
-}
-
-static TBool OkCancelDialogL(TDesC& aMessage)
-{
- CAknNoteDialog* dlg =
- new (ELeave) CAknNoteDialog(CAknNoteDialog::EConfirmationTone);
- dlg->PrepareLC(R_OK_CANCEL_DIALOG);
- dlg->SetTextL(aMessage);
- return DlgOk(dlg);
-}
-
-static TBool YesNoDialogL(TDesC& aMessage)
-{
- CAknNoteDialog* dlg =
- new (ELeave) CAknNoteDialog(CAknNoteDialog::EConfirmationTone);
- dlg->PrepareLC(R_YES_NO_DIALOG);
- dlg->SetTextL(aMessage);
- return DlgOk(dlg);
-}
-
-static TInt InformationNoteL(TDesC& aMessage)
-{
- CAknInformationNote* note = new (ELeave) CAknInformationNote;
- return note->ExecuteLD(aMessage);
-}
-
-static TInt ConfirmationNoteL(TDesC& aMessage)
-{
- CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote;
- return note->ExecuteLD(aMessage);
-}
-
-static TInt WarningNoteL(TDesC& aMessage)
-{
- CAknWarningNote* note = new (ELeave) CAknWarningNote;
- return note->ExecuteLD(aMessage);
-}
-
-static TInt TextQueryDialogL(const TDesC& aPrompt, TDes& aData, const TInt aMaxLength)
-{
- CAknTextQueryDialog* dlg =
- new (ELeave) CAknTextQueryDialog(aData);
- dlg->SetPromptL(aPrompt);
- dlg->SetMaxLength(aMaxLength);
- return dlg->ExecuteLD(R_TEXT_QUERY_DIALOG);
-}