|
1 /*! |
|
2 * Copyright (c) 2009 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: Actions and associated translated texts. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PHONEACTION_H |
|
19 #define PHONEACTION_H |
|
20 |
|
21 #include <hbicon.h> |
|
22 |
|
23 #ifdef BUILD_PHONEUIQTVIEW |
|
24 #define PHONEACTION_EXPORT Q_DECL_EXPORT |
|
25 #else |
|
26 #define PHONEACTION_EXPORT Q_DECL_IMPORT |
|
27 #endif |
|
28 |
|
29 class PHONEACTION_EXPORT PhoneAction |
|
30 { |
|
31 |
|
32 public: |
|
33 |
|
34 class ToolBarItem { |
|
35 public: |
|
36 ToolBarItem(int commandId, bool enabled) : |
|
37 mCommandId(commandId),mEnabled(enabled) {} |
|
38 |
|
39 int mCommandId; |
|
40 bool mEnabled; |
|
41 }; |
|
42 |
|
43 enum ActionType { |
|
44 LeftButton = 1, |
|
45 RightButton, |
|
46 Text, |
|
47 ToolbarButton1, |
|
48 ToolbarButton2, |
|
49 ToolbarButton3, |
|
50 ToolbarButton4 |
|
51 }; |
|
52 |
|
53 enum ActionRole { |
|
54 None, // no specific role - default button |
|
55 Accept, // positive action - green button |
|
56 Decline // negative action - red button |
|
57 }; |
|
58 |
|
59 PhoneAction (); |
|
60 ~PhoneAction (); |
|
61 void setText (QString text); |
|
62 QString text () const; |
|
63 void setCommand (int command); |
|
64 int command () const; |
|
65 HbIcon icon () const; |
|
66 void setIcon (HbIcon icon); |
|
67 void setDisabled(bool disabled); |
|
68 bool isDisabled() const; |
|
69 void setActionRole(ActionRole role); |
|
70 ActionRole actionRole() const; |
|
71 |
|
72 private: |
|
73 |
|
74 QString m_text; |
|
75 int m_command; |
|
76 HbIcon m_icon; |
|
77 bool m_disabled; |
|
78 ActionRole m_role; |
|
79 }; |
|
80 |
|
81 #endif // PHONEACTION_H |