|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Declares UI class for BVA application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _BVAAPPUI_H_ |
|
21 #define _BVAAPPUI_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include <msgbiocontrolObserver.h> |
|
25 #include <aknappui.h> |
|
26 #include <bldvariant.hrh> //__SERIES60_HELP |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CBvaContainer; |
|
30 |
|
31 enum TBVAPanic |
|
32 { |
|
33 EMenuPaneNull |
|
34 }; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Application UI class of BVA. |
|
41 */ |
|
42 NONSHARABLE_CLASS( CBvaAppUi ) : |
|
43 public CAknAppUi, public MMsgBioControlObserver |
|
44 { |
|
45 public: // Construction & destruction |
|
46 |
|
47 /// Second phase constructor. |
|
48 void ConstructL(); |
|
49 |
|
50 /// Destructor. |
|
51 ~CBvaAppUi(); |
|
52 |
|
53 public: // new functions |
|
54 |
|
55 /** |
|
56 * Loads the bio control. |
|
57 * @param aFile Data file handle. |
|
58 */ |
|
59 void LoadBioControlL( const RFile& aFile ); |
|
60 |
|
61 private: // from MEikMenuObserver |
|
62 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
63 |
|
64 public: // from MMsgBioControlObserver |
|
65 |
|
66 /** |
|
67 * Gives the first free command ID. |
|
68 * @return Gives the first free command ID. |
|
69 */ |
|
70 TInt FirstFreeCommand() const; |
|
71 |
|
72 /** |
|
73 * For requesting a command to be handled. |
|
74 * @param aCommand Command type. |
|
75 */ |
|
76 TInt RequestHandleCommandL(TMsgCommands aCommand); |
|
77 |
|
78 /** |
|
79 * For querying if a command is supported or not. |
|
80 * @param aCommand Command type. |
|
81 */ |
|
82 TBool IsCommandSupported(TMsgCommands aCommand) const; |
|
83 |
|
84 private: // from CEikAppUi |
|
85 /** |
|
86 * Command handler. |
|
87 * @param aCommand command to be handled |
|
88 */ |
|
89 void HandleCommandL(TInt aCommand); |
|
90 |
|
91 /** |
|
92 * Handles key events. |
|
93 * @param aKeyEvent Event to handled. |
|
94 * @param aType Type of the key event. |
|
95 * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed). |
|
96 */ |
|
97 virtual TKeyResponse HandleKeyEventL( |
|
98 const TKeyEvent& aKeyEvent,TEventCode aType); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * Whether a data file has been specified. |
|
104 * @return ETrue if there is no data file. |
|
105 */ |
|
106 TBool NoDataFile(); |
|
107 |
|
108 /** |
|
109 * Launches help application |
|
110 */ |
|
111 void LaunchHelpL(); |
|
112 |
|
113 /** |
|
114 * Returns help context |
|
115 * @return application specific help context |
|
116 */ |
|
117 CArrayFix<TCoeHelpContext>* HelpContextL() const; |
|
118 |
|
119 /** |
|
120 * Create a help context array. |
|
121 * @return Help context array |
|
122 */ |
|
123 CArrayFix<TCoeHelpContext>* CreateHelpContextArrayL( |
|
124 const TCoeHelpContext& aHelpContext ) const; |
|
125 |
|
126 /** |
|
127 * Panic wrapper. |
|
128 * @param aCode panic code |
|
129 */ |
|
130 void Panic(TBVAPanic aCode); |
|
131 |
|
132 private: //Data |
|
133 |
|
134 /// This is a CCoeControl window owning container. |
|
135 CBvaContainer* iContainer; |
|
136 |
|
137 /** |
|
138 * Is used to mark whether biocontrol was loaded using file handle fwk |
|
139 * instead of filename. -1 = file name based, 0 = invalid handle, |
|
140 * valid handle > 0. |
|
141 */ |
|
142 TInt iFileHandleSize; |
|
143 |
|
144 // Variable used to hold the status of BIO control instantiation status |
|
145 TBool iBioControlLoadFailed; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif //_BVAAPPUI_H_ |
|
150 |
|
151 // End of File |