williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Class declaration for EIKON hotkey table.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef __EIKHKEYT_H__
|
williamr@2
|
20 |
#define __EIKHKEYT_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
#include <e32keys.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
/**
|
williamr@2
|
26 |
* Hotkey parameters. This can be added to a hotkey table using
|
williamr@2
|
27 |
* the functions provided by the @c CEikHotKeyTable class.
|
williamr@2
|
28 |
*/
|
williamr@2
|
29 |
struct SEikHotKey
|
williamr@2
|
30 |
{
|
williamr@2
|
31 |
TInt iCommandId; ///< The command ID associated with the hotkey.
|
williamr@2
|
32 |
TInt iKeycode; ///< The key code associated with the hotkey.
|
williamr@2
|
33 |
};
|
williamr@2
|
34 |
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
* An array for hotkey commands and their associated key codes and modifiers.
|
williamr@2
|
37 |
*
|
williamr@2
|
38 |
* @lib eikcoctl.lib
|
williamr@2
|
39 |
* @since S60 0.9
|
williamr@2
|
40 |
*/
|
williamr@2
|
41 |
class CEikHotKeyTable : public CArrayFixFlat<SEikHotKey>
|
williamr@2
|
42 |
{
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
* Default C++ constructor.
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
IMPORT_C CEikHotKeyTable();
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/**
|
williamr@2
|
51 |
* Destructor
|
williamr@2
|
52 |
*/
|
williamr@2
|
53 |
IMPORT_C ~CEikHotKeyTable();
|
williamr@2
|
54 |
|
williamr@2
|
55 |
/**
|
williamr@2
|
56 |
* Gets the hotkey code and modifier for the specified command ID.
|
williamr@2
|
57 |
*
|
williamr@2
|
58 |
* @param aCommandId The ID of the hotkey for which the key code and
|
williamr@2
|
59 |
* modifiers are obtained.
|
williamr@2
|
60 |
* @param[out] aKeycode On return, the key code for the
|
williamr@2
|
61 |
* specified command ID.
|
williamr@2
|
62 |
* @param[out] aModifiers On return, the modifier for the
|
williamr@2
|
63 |
* specified command ID.
|
williamr@2
|
64 |
*
|
williamr@2
|
65 |
* @return @c ETrue if the hotkey exists, @c EFalse otherwise
|
williamr@2
|
66 |
*/
|
williamr@2
|
67 |
IMPORT_C TBool HotKeyFromCommandId( TInt aCommandId,
|
williamr@2
|
68 |
TInt& aKeycode,
|
williamr@2
|
69 |
TInt& aModifiers) const;
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
* Gets the command ID associated with the specified key code and modifier.
|
williamr@2
|
73 |
*
|
williamr@2
|
74 |
* @param aKeycode The key code for which the command ID is obtained.
|
williamr@2
|
75 |
* @param aModifiers The key modifier for which the command ID is obtained.
|
williamr@2
|
76 |
*
|
williamr@2
|
77 |
* @return The command ID for the specified key code and modifier.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C TInt CommandIdFromHotKey(TInt aKeycode,TInt aModifiers) const;
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* Adds the specified hotkey to the hotkey array.
|
williamr@2
|
83 |
*
|
williamr@2
|
84 |
* @param aCommandId The command associated with the hotkey.
|
williamr@2
|
85 |
* @param aKeycode The key code used to invoke the command.
|
williamr@2
|
86 |
* @param aModifiers Any modifiers used to invoke the command,
|
williamr@2
|
87 |
* shift or control for example.
|
williamr@2
|
88 |
*
|
williamr@2
|
89 |
* @leave KErrNotSupported If the specified modifier is not supported
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C void AddItemL(TInt aCommandId,TInt aKeycode,TInt aModifiers);
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
* Removes the item specified by command ID from the array.
|
williamr@2
|
95 |
*
|
williamr@2
|
96 |
* @param aCommandId The ID of the item to remove.
|
williamr@2
|
97 |
* @panic EIKCOCTL-7 If the array contains no hotkeys.
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
IMPORT_C void RemoveItem(TInt aCommandId);
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Constructs an empty array from resource.
|
williamr@2
|
103 |
*
|
williamr@2
|
104 |
* @param aResourceId The ID if the resource reader to use to
|
williamr@2
|
105 |
* construct the array.
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
IMPORT_C void ConstructFromResourceL(TInt aResourceId);
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
* Resets the hotkey array.
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
IMPORT_C void Reset();
|
williamr@2
|
113 |
|
williamr@2
|
114 |
private:
|
williamr@2
|
115 |
TInt iNumberPlain;
|
williamr@2
|
116 |
TInt iNumberCtrl;
|
williamr@2
|
117 |
TInt iNumberShiftCtrl;
|
williamr@2
|
118 |
TInt iSpare;
|
williamr@2
|
119 |
};
|
williamr@2
|
120 |
|
williamr@2
|
121 |
#endif // __EIKHKEYT_H__
|