|
1 /* |
|
2 * Copyright (c) 2007 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: UI command bases class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_VTUICMDBASE_H |
|
20 #define C_VTUICMDBASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * CVtUiCmdBase |
|
26 * |
|
27 * Base class for UI commands. |
|
28 * |
|
29 * @since S60 v3.2 |
|
30 */ |
|
31 NONSHARABLE_CLASS( CVtUiCmdBase ) : public CBase |
|
32 { |
|
33 |
|
34 public: // public methods |
|
35 |
|
36 /** |
|
37 * Returns command id. |
|
38 * |
|
39 * @return This command's id. |
|
40 */ |
|
41 TInt CommandId() const; |
|
42 |
|
43 public: // public abstract methods |
|
44 |
|
45 /** |
|
46 * Execute command |
|
47 * |
|
48 */ |
|
49 virtual void HandleL() = 0; |
|
50 |
|
51 /** |
|
52 * Returns ETrue if command is enabled. |
|
53 * |
|
54 * @return ETrue if this command is enabled (can be executed), EFalse |
|
55 * otherwise. |
|
56 */ |
|
57 virtual TBool IsEnabled() const = 0; |
|
58 |
|
59 public: // public static methods |
|
60 |
|
61 /** |
|
62 * Key comparing function type definition. |
|
63 */ |
|
64 typedef TInt ( *TKeyOrder ) ( const TInt*, const CVtUiCmdBase& ); |
|
65 |
|
66 /** |
|
67 * Returns linear order object for ordered array inserting. |
|
68 * |
|
69 * @return TLinearOrder instance for searching and inserting CVtUiCmdBase |
|
70 * based objects into RArray. |
|
71 */ |
|
72 static TLinearOrder< CVtUiCmdBase > LinearOrder(); |
|
73 |
|
74 /** |
|
75 * Returns linear order object for ordered array inserting. |
|
76 * |
|
77 * @return Pointer to key comparaing function, that can be used in |
|
78 * FindInOrder() method call. |
|
79 */ |
|
80 static TKeyOrder KeyOrder(); |
|
81 |
|
82 protected: |
|
83 |
|
84 /** |
|
85 * C++ constructor. |
|
86 * |
|
87 * @aCommandId Id of this command. |
|
88 * |
|
89 */ |
|
90 CVtUiCmdBase( TInt aCommandId ); |
|
91 |
|
92 protected: |
|
93 |
|
94 // Command id |
|
95 const TInt iCommandId; |
|
96 |
|
97 }; |
|
98 |
|
99 #endif // C_VTUICMDBASE_H |