0
|
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 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
35 |
|
|
36 |
|
|
37 |
// -----------------------------------------------------------------------------
|
|
38 |
// CTestPublisherAppUi::ConstructL()
|
|
39 |
// Symbian 2nd phase constructor can leave.
|
|
40 |
// -----------------------------------------------------------------------------
|
|
41 |
//
|
|
42 |
void CTestPublisherAppUi::ConstructL()
|
|
43 |
{
|
|
44 |
// Initialise app UI with standard value.
|
|
45 |
BaseConstructL(CAknAppUi::EAknEnableSkin);
|
|
46 |
|
|
47 |
// Create view object
|
|
48 |
iAppView = CTestPublisherAppView::NewL(ClientRect());
|
|
49 |
}
|
|
50 |
// -----------------------------------------------------------------------------
|
|
51 |
// CTestPublisherAppUi::CTestPublisherAppUi()
|
|
52 |
// C++ default constructor can NOT contain any code, that might leave.
|
|
53 |
// -----------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
CTestPublisherAppUi::CTestPublisherAppUi()
|
|
56 |
{
|
|
57 |
// No implementation required
|
|
58 |
}
|
|
59 |
|
|
60 |
// -----------------------------------------------------------------------------
|
|
61 |
// CTestPublisherAppUi::~CTestPublisherAppUi()
|
|
62 |
// Destructor.
|
|
63 |
// -----------------------------------------------------------------------------
|
|
64 |
//
|
|
65 |
CTestPublisherAppUi::~CTestPublisherAppUi()
|
|
66 |
{
|
|
67 |
if (iAppView)
|
|
68 |
{
|
|
69 |
delete iAppView;
|
|
70 |
iAppView = NULL;
|
|
71 |
}
|
|
72 |
|
|
73 |
}
|
|
74 |
|
|
75 |
// -----------------------------------------------------------------------------
|
|
76 |
// CTestPublisherAppUi::HandleCommandL()
|
|
77 |
// Takes care of command handling.
|
|
78 |
// -----------------------------------------------------------------------------
|
|
79 |
//
|
|
80 |
void CTestPublisherAppUi::HandleCommandL(TInt aCommand)
|
|
81 |
{
|
|
82 |
switch (aCommand)
|
|
83 |
{
|
|
84 |
case EEikCmdExit:
|
|
85 |
case EAknSoftkeyExit:
|
|
86 |
Exit();
|
|
87 |
break;
|
|
88 |
|
|
89 |
case ECommand1:
|
|
90 |
{
|
|
91 |
|
|
92 |
// Load a string from the resource file and display it
|
|
93 |
HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT);
|
|
94 |
CAknInformationNote* informationNote;
|
|
95 |
|
|
96 |
informationNote = new (ELeave) CAknInformationNote;
|
|
97 |
|
|
98 |
// Show the information Note with
|
|
99 |
// textResource loaded with StringLoader.
|
|
100 |
informationNote->ExecuteLD(*textResource);
|
|
101 |
|
|
102 |
// Pop HBuf from CleanUpStack and Destroy it.
|
|
103 |
CleanupStack::PopAndDestroy(textResource);
|
|
104 |
}
|
|
105 |
break;
|
|
106 |
case ECommand2:
|
|
107 |
{
|
|
108 |
|
|
109 |
}
|
|
110 |
break;
|
|
111 |
case EAbout:
|
|
112 |
{
|
|
113 |
|
|
114 |
CAknMessageQueryDialog* dlg =
|
|
115 |
new (ELeave) CAknMessageQueryDialog();
|
|
116 |
dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
|
|
117 |
HBufC* title = iEikonEnv->AllocReadResourceLC(
|
|
118 |
R_ABOUT_DIALOG_TITLE);
|
|
119 |
dlg->QueryHeading()->SetTextL(*title);
|
|
120 |
CleanupStack::PopAndDestroy(); //title
|
|
121 |
HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
|
|
122 |
dlg->SetMessageTextL(*msg);
|
|
123 |
CleanupStack::PopAndDestroy(); //msg
|
|
124 |
dlg->RunLD();
|
|
125 |
}
|
|
126 |
break;
|
|
127 |
default:
|
|
128 |
Panic( ETestPublisherUi);
|
|
129 |
break;
|
|
130 |
}
|
|
131 |
}
|
|
132 |
// -----------------------------------------------------------------------------
|
|
133 |
// Called by the framework when the application status pane
|
|
134 |
// size is changed. Passes the new client rectangle to the
|
|
135 |
// AppView
|
|
136 |
// -----------------------------------------------------------------------------
|
|
137 |
//
|
|
138 |
void CTestPublisherAppUi::HandleStatusPaneSizeChange()
|
|
139 |
{
|
|
140 |
iAppView->SetRect(ClientRect());
|
|
141 |
}
|
|
142 |
|
|
143 |
// End of File
|