|
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: Interface to add bubble touch pane buttons. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_BUBBLETOUCHPANEINTERFACE_H |
|
20 #define M_BUBBLETOUCHPANEINTERFACE_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 class CGulIcon; |
|
25 class TAknsItemID; |
|
26 |
|
27 /** |
|
28 * Interface for obtaining icon from skin, the icon is shown in touch pane |
|
29 * button. The client using MBubbleTouchPaneInterface must implement this |
|
30 * to support skinning. |
|
31 */ |
|
32 class MBubbleTouchPaneIconProvider |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Gets icon for command. |
|
37 * |
|
38 * @since S60 v5.0 |
|
39 * @param aCommandId The command id. |
|
40 * @return Icon instance. NULL if icon doesn't exist for command. |
|
41 */ |
|
42 virtual CGulIcon* GetIconForCommandL( TInt aCommandId ) = 0; |
|
43 |
|
44 /** |
|
45 * Gets button for command. |
|
46 * |
|
47 * @since TB 9.2 |
|
48 * @param aCommandId The command id. |
|
49 * @return frameId. Normal if special button doesn't exist for command. |
|
50 */ |
|
51 virtual TAknsItemID GetButtonForCommandL( TInt aCommandId ) = 0; |
|
52 |
|
53 }; |
|
54 |
|
55 /** |
|
56 * Interface to add bubble touch pane buttons. |
|
57 * |
|
58 * |
|
59 * @lib bubblemanager.lib |
|
60 * @since S60 v5.0 |
|
61 */ |
|
62 class MBubbleTouchPaneInterface |
|
63 { |
|
64 public: |
|
65 /** |
|
66 * Constructs touch pane buttons from resource. |
|
67 * |
|
68 * @since S60 v5.0 |
|
69 * @param aResourceId Resource id. 0 = empty set. |
|
70 * @return Error code. |
|
71 */ |
|
72 virtual TInt SetButtonSet( TInt aResourceId ) = 0; |
|
73 |
|
74 /** |
|
75 * Sets toggling button to the state, which triggers |
|
76 * the given command, when pressed. |
|
77 * |
|
78 * @since S60 v5.0 |
|
79 * @param aCommand Command id. |
|
80 */ |
|
81 virtual void SetButtonState( TInt aCommand ) = 0; |
|
82 |
|
83 /** |
|
84 * Sets button dimmed. |
|
85 * |
|
86 * Toggling buttons should be set to a state, where aCommand |
|
87 * is the active command before applying this method. |
|
88 * |
|
89 * @since S60 v5.0 |
|
90 * @param aCommand Command id. |
|
91 * @param aDimmed ETrue to set dimmed, EFalse to undim. |
|
92 */ |
|
93 virtual void SetButtonDimmed( TInt aCommand, TBool aDimmed ) = 0; |
|
94 |
|
95 /** |
|
96 * Returns number of buttons in touch pane. |
|
97 * |
|
98 * @since S60 v5.0 |
|
99 * @return Button count. |
|
100 */ |
|
101 virtual TInt NumberOfButtonsInPane() const = 0; |
|
102 |
|
103 /** |
|
104 * Returns command id assinged to button in given position. |
|
105 * If button is toggling, currently active command is |
|
106 * returned. |
|
107 * |
|
108 * @since S60 v5.0 |
|
109 * @param aButtonIndex Button index starting 0. |
|
110 * @return Command id assigned to given position. |
|
111 */ |
|
112 virtual TInt ButtonCommandId( TInt aButtonIndex ) const = 0; |
|
113 |
|
114 /** |
|
115 * Checks if button has state that generates given command. |
|
116 * |
|
117 * @since S60 v5.0 |
|
118 * @param aButtonIndex Button index starting 0. |
|
119 * @param aCommand Command id. |
|
120 * @return ETrue if button has this state, otherwise EFalse. |
|
121 */ |
|
122 virtual TBool ButtonHasState( TInt aButtonIndex, TInt aCommand ) const = 0; |
|
123 |
|
124 /** |
|
125 * Replaces button in given position. |
|
126 * |
|
127 * @since S60 v5.0 |
|
128 * @param aButtonIndex Button to be replaced. |
|
129 * @param aResourceId Resource definiton of replacing button. |
|
130 * @return Error code. |
|
131 */ |
|
132 virtual TInt ReplaceButton( TInt aButtonIndex, |
|
133 TInt aResourceId ) = 0; |
|
134 |
|
135 /** |
|
136 * Set icon provider. |
|
137 * |
|
138 * @since S60 v5.0 |
|
139 * @param aIconProvider Provider interface. |
|
140 */ |
|
141 virtual void SetIconProvider( |
|
142 MBubbleTouchPaneIconProvider* aIconProvider ) = 0; |
|
143 }; |
|
144 |
|
145 #endif // M_BUBBLETOUCHPANEINTERFACE_H |