|
1 /* |
|
2 * Copyright (c) 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: Command handler interface of the engine. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MVTENGCOMMANDHANDLER_H |
|
21 #define MVTENGCOMMANDHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "vtengcommands.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 class MVtEngCommandObserver; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Handler for commands from client. |
|
43 * |
|
44 * @lib videoteleng |
|
45 * @since 2.6 |
|
46 */ |
|
47 class MVtEngCommandHandler |
|
48 { |
|
49 public: |
|
50 |
|
51 /** |
|
52 * EAttribAsync |
|
53 * command is asynchronous. |
|
54 * EAttribEnabled |
|
55 * Command can be executed at the moment. |
|
56 * EAttribSupported |
|
57 * Command is supported by the engine. |
|
58 */ |
|
59 enum TCommandCaps |
|
60 { |
|
61 EAttribAsync = 0x00000001, |
|
62 EAttribEnabled = 0x00000002, |
|
63 EAttribSupported = 0x00000004 |
|
64 }; |
|
65 |
|
66 /** |
|
67 * Excecutes a command. This function leaves KErrNotReady |
|
68 * if engine is in such a state that command cannot be |
|
69 * executed. |
|
70 * |
|
71 * @param aCommandId command to be executed. |
|
72 * @param aParams command parameters, NULL if command |
|
73 * does not require any. |
|
74 */ |
|
75 virtual void ExecuteL( |
|
76 const TVtEngCommandId aCommandId, |
|
77 TDesC8* aParams ) = 0; |
|
78 |
|
79 /** |
|
80 * Cancels a command. |
|
81 * @param aCommandId command to cancel. |
|
82 * @return KErrNotFound if command is not pending. |
|
83 */ |
|
84 virtual TInt CancelCommand( const TVtEngCommandId aCommandId ) = 0; |
|
85 |
|
86 /** |
|
87 * Returns capabilities of a command. |
|
88 * @return command caps |
|
89 */ |
|
90 virtual TInt GetCommandCaps( |
|
91 const TVtEngCommandId aCommand ) = 0; |
|
92 |
|
93 /** |
|
94 * Returns pending command. |
|
95 * @return pending command |
|
96 */ |
|
97 virtual TVtEngCommandId PendingCommand() = 0; |
|
98 |
|
99 /** |
|
100 * Returns invalid command. |
|
101 * @return invalid command |
|
102 */ |
|
103 virtual TVtEngCommandId InvalidCommand() = 0; |
|
104 |
|
105 /** |
|
106 * Sets command observer. First call on this is guaranteed |
|
107 * to succeed. |
|
108 * @param aObserver command observer. |
|
109 */ |
|
110 virtual void AddObserverL( MVtEngCommandObserver& aObserver ) = 0; |
|
111 |
|
112 /** |
|
113 * Removes a command observer or if non-op if specified observer |
|
114 * is not found. |
|
115 * @param aObserver command observer to be removed. |
|
116 */ |
|
117 virtual void RemoveObserver( MVtEngCommandObserver& aObserver ) = 0; |
|
118 }; |
|
119 |
|
120 #endif //MVTENGCOMMANDHANDLER_H |
|
121 |
|
122 // End of File |