2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Class declaration for EIKON hotkey table.
19 #ifndef __EIKHKEYT_H__
20 #define __EIKHKEYT_H__
26 * Hotkey parameters. This can be added to a hotkey table using
27 * the functions provided by the @c CEikHotKeyTable class.
31 TInt iCommandId; ///< The command ID associated with the hotkey.
32 TInt iKeycode; ///< The key code associated with the hotkey.
36 * An array for hotkey commands and their associated key codes and modifiers.
41 class CEikHotKeyTable : public CArrayFixFlat<SEikHotKey>
46 * Default C++ constructor.
48 IMPORT_C CEikHotKeyTable();
53 IMPORT_C ~CEikHotKeyTable();
56 * Gets the hotkey code and modifier for the specified command ID.
58 * @param aCommandId The ID of the hotkey for which the key code and
59 * modifiers are obtained.
60 * @param[out] aKeycode On return, the key code for the
61 * specified command ID.
62 * @param[out] aModifiers On return, the modifier for the
63 * specified command ID.
65 * @return @c ETrue if the hotkey exists, @c EFalse otherwise
67 IMPORT_C TBool HotKeyFromCommandId( TInt aCommandId,
69 TInt& aModifiers) const;
72 * Gets the command ID associated with the specified key code and modifier.
74 * @param aKeycode The key code for which the command ID is obtained.
75 * @param aModifiers The key modifier for which the command ID is obtained.
77 * @return The command ID for the specified key code and modifier.
79 IMPORT_C TInt CommandIdFromHotKey(TInt aKeycode,TInt aModifiers) const;
82 * Adds the specified hotkey to the hotkey array.
84 * @param aCommandId The command associated with the hotkey.
85 * @param aKeycode The key code used to invoke the command.
86 * @param aModifiers Any modifiers used to invoke the command,
87 * shift or control for example.
89 * @leave KErrNotSupported If the specified modifier is not supported
91 IMPORT_C void AddItemL(TInt aCommandId,TInt aKeycode,TInt aModifiers);
94 * Removes the item specified by command ID from the array.
96 * @param aCommandId The ID of the item to remove.
97 * @panic EIKCOCTL-7 If the array contains no hotkeys.
99 IMPORT_C void RemoveItem(TInt aCommandId);
102 * Constructs an empty array from resource.
104 * @param aResourceId The ID if the resource reader to use to
105 * construct the array.
107 IMPORT_C void ConstructFromResourceL(TInt aResourceId);
110 * Resets the hotkey array.
112 IMPORT_C void Reset();
117 TInt iNumberShiftCtrl;
121 #endif // __EIKHKEYT_H__