|
1 /* |
|
2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <eikinfo.h> |
|
20 #include <eikon.hrh> |
|
21 #include <eikcdlg.rsg> |
|
22 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
23 #include <eikdef.h> |
|
24 #else |
|
25 #include <eikdef.h> |
|
26 #include <uikon/eikdefconst.h> |
|
27 #endif |
|
28 |
|
29 EXPORT_C CEikInfoDialog::CEikInfoDialog(const TDesC& aTitle,const TDesC& aMsg,TExitKeys /*aExitKeys*/) |
|
30 : CAknNoteDialog(), iTitle(&aTitle), iMessage(&aMsg) |
|
31 {} |
|
32 |
|
33 CEikInfoDialog::CEikInfoDialog(TExitKeys /*aExitKeys*/) |
|
34 : CAknNoteDialog() |
|
35 {} |
|
36 |
|
37 EXPORT_C TBool CEikInfoDialog::RunDlgLD(const TDesC& aTitle,const TDesC& aMsg,TExitKeys aExitKeys) |
|
38 { // static |
|
39 CEikInfoDialog* dlg=new(ELeave)CEikInfoDialog(aTitle, aMsg, aExitKeys); |
|
40 return dlg->ExecuteLD(R_EIK_DIALOG_QUERY); |
|
41 } |
|
42 |
|
43 TBool CEikInfoDialog::RunDlgLD(TInt aResource, const TDesC& aTitle, const TDesC& aMsg) |
|
44 { |
|
45 iTitle = &aTitle; |
|
46 iMessage = &aMsg; |
|
47 |
|
48 if (aResource==KEikResIdQueryDialog) |
|
49 return ExecuteLD(R_EIK_DIALOG_QUERY); |
|
50 |
|
51 else if (aResource==KEikResIdInfoDialog) |
|
52 return ExecuteLD(R_EIK_DIALOG_INFO); |
|
53 |
|
54 else |
|
55 return ExecuteLD(aResource); |
|
56 } |
|
57 |
|
58 void CEikInfoDialog::PreLayoutDynInitL(void) |
|
59 { |
|
60 if (iMessage && iTitle) |
|
61 { |
|
62 HBufC* msg = HBufC::NewLC(iTitle->Length() + iMessage->Length() + 1); |
|
63 |
|
64 TPtr ptr = msg->Des(); |
|
65 ptr.Format(_L("%S\n%S"),iTitle,iMessage); |
|
66 |
|
67 SetTextL(ptr); |
|
68 CleanupStack::PopAndDestroy(); //msg |
|
69 } |
|
70 else if (iMessage) |
|
71 { |
|
72 SetTextL(*iMessage); |
|
73 } |
|
74 else if (iTitle) |
|
75 { |
|
76 SetTextL(*iTitle); |
|
77 } |
|
78 CAknNoteDialog::PreLayoutDynInitL(); |
|
79 } |
|
80 |
|
81 EXPORT_C void CEikInfoDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
82 { |
|
83 CAknNoteDialog::HandlePointerEventL(aPointerEvent); |
|
84 } |
|
85 |
|
86 EXPORT_C void* CEikInfoDialog::ExtensionInterface( TUid /*aInterface*/ ) |
|
87 { |
|
88 return NULL; |
|
89 } |
|
90 |
|
91 EXPORT_C void CEikInfoDialog::CEikDialog_Reserved_1() |
|
92 { |
|
93 } |
|
94 |
|
95 EXPORT_C void CEikInfoDialog::CEikDialog_Reserved_2() |
|
96 { |
|
97 } |