|
1 /* |
|
2 * Copyright (c) {Year(s)} {Copyright owner}. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * {Name} {Company} ? Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * {Name} {Company} ? {{Description of contribution}} |
|
14 * |
|
15 * Description: |
|
16 * {{Description of the file}} |
|
17 * |
|
18 */ |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <avkon.hrh> |
|
22 #include <aknmessagequerydialog.h> |
|
23 #include <aknnotewrappers.h> |
|
24 #include <stringloader.h> |
|
25 |
|
26 #include <TestPublisher_0xE5555555.rsg> |
|
27 |
|
28 #include "TestPublisher.hrh" |
|
29 #include "TestPublisher.pan" |
|
30 #include "TestPublisherApplication.h" |
|
31 #include "TestPublisherAppUi.h" |
|
32 #include "TestPublisherAppView.h" |
|
33 |
|
34 _LIT( KText, "Test publisher!"); |
|
35 |
|
36 // ============================ MEMBER FUNCTIONS =============================== |
|
37 |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CTestPublisherAppUi::ConstructL() |
|
41 // Symbian 2nd phase constructor can leave. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void CTestPublisherAppUi::ConstructL() |
|
45 { |
|
46 // Initialise app UI with standard value. |
|
47 BaseConstructL(CAknAppUi::EAknEnableSkin); |
|
48 |
|
49 // Create view object |
|
50 iAppView = CTestPublisherAppView::NewL(ClientRect()); |
|
51 } |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CTestPublisherAppUi::CTestPublisherAppUi() |
|
54 // C++ default constructor can NOT contain any code, that might leave. |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 CTestPublisherAppUi::CTestPublisherAppUi() |
|
58 { |
|
59 // No implementation required |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CTestPublisherAppUi::~CTestPublisherAppUi() |
|
64 // Destructor. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 CTestPublisherAppUi::~CTestPublisherAppUi() |
|
68 { |
|
69 if (iAppView) |
|
70 { |
|
71 delete iAppView; |
|
72 iAppView = NULL; |
|
73 } |
|
74 |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CTestPublisherAppUi::HandleCommandL() |
|
79 // Takes care of command handling. |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 void CTestPublisherAppUi::HandleCommandL(TInt aCommand) |
|
83 { |
|
84 switch (aCommand) |
|
85 { |
|
86 case EEikCmdExit: |
|
87 case EAknSoftkeyExit: |
|
88 Exit(); |
|
89 break; |
|
90 |
|
91 case ECommand1: |
|
92 { |
|
93 |
|
94 // Load a string from the resource file and display it |
|
95 HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT); |
|
96 CAknInformationNote* informationNote; |
|
97 |
|
98 informationNote = new (ELeave) CAknInformationNote; |
|
99 |
|
100 // Show the information Note with |
|
101 // textResource loaded with StringLoader. |
|
102 informationNote->ExecuteLD(*textResource); |
|
103 |
|
104 // Pop HBuf from CleanUpStack and Destroy it. |
|
105 CleanupStack::PopAndDestroy(textResource); |
|
106 } |
|
107 break; |
|
108 case ECommand2: |
|
109 { |
|
110 |
|
111 } |
|
112 break; |
|
113 case EAbout: |
|
114 { |
|
115 |
|
116 CAknMessageQueryDialog* dlg = |
|
117 new (ELeave) CAknMessageQueryDialog(); |
|
118 dlg->PrepareLC(R_ABOUT_QUERY_DIALOG); |
|
119 HBufC* title = iEikonEnv->AllocReadResourceLC( |
|
120 R_ABOUT_DIALOG_TITLE); |
|
121 dlg->QueryHeading()->SetTextL(*title); |
|
122 CleanupStack::PopAndDestroy(); //title |
|
123 HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT); |
|
124 dlg->SetMessageTextL(*msg); |
|
125 CleanupStack::PopAndDestroy(); //msg |
|
126 dlg->RunLD(); |
|
127 } |
|
128 break; |
|
129 default: |
|
130 Panic( ETestPublisherUi); |
|
131 break; |
|
132 } |
|
133 } |
|
134 // ----------------------------------------------------------------------------- |
|
135 // Called by the framework when the application status pane |
|
136 // size is changed. Passes the new client rectangle to the |
|
137 // AppView |
|
138 // ----------------------------------------------------------------------------- |
|
139 // |
|
140 void CTestPublisherAppUi::HandleStatusPaneSizeChange() |
|
141 { |
|
142 iAppView->SetRect(ClientRect()); |
|
143 } |
|
144 |
|
145 // End of File |