49 QList<HbIcon> mIcons; |
49 QList<HbIcon> mIcons; |
50 QRectF mBoundingRect; |
50 QRectF mBoundingRect; |
51 }; |
51 }; |
52 |
52 |
53 HbInputButtonPrivate::HbInputButtonPrivate() |
53 HbInputButtonPrivate::HbInputButtonPrivate() |
54 : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), |
54 : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), |
55 mPosition(0, 0), mSize(1, 1), mKeyCode(-1), mAutoRepeat(false) |
55 mPosition(0, 0), mSize(1, 1), mKeyCode(-1), mAutoRepeat(false) |
56 { |
56 { |
57 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
57 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
58 mTexts.append(""); |
58 mTexts.append(""); |
59 } |
59 } |
60 |
60 |
62 mIcons.append(HbIcon()); |
62 mIcons.append(HbIcon()); |
63 } |
63 } |
64 } |
64 } |
65 |
65 |
66 HbInputButtonPrivate::HbInputButtonPrivate(int keyCode, const QPoint &position, const QSize &size) |
66 HbInputButtonPrivate::HbInputButtonPrivate(int keyCode, const QPoint &position, const QSize &size) |
67 : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), |
67 : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), |
68 mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(false) |
68 mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(false) |
69 { |
69 { |
70 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
70 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
71 mTexts.append(""); |
71 mTexts.append(""); |
72 } |
72 } |
73 |
73 |
92 mAutoRepeat = true; |
92 mAutoRepeat = true; |
93 } |
93 } |
94 } |
94 } |
95 |
95 |
96 HbInputButtonPrivate::HbInputButtonPrivate(HbInputButton::HbInputButtonType type, HbInputButton::HbInputButtonState state, |
96 HbInputButtonPrivate::HbInputButtonPrivate(HbInputButton::HbInputButtonType type, HbInputButton::HbInputButtonState state, |
97 const QPoint &position, const QSize &size, int keyCode, bool autoRepeat, |
97 const QPoint &position, const QSize &size, int keyCode, bool autoRepeat, |
98 const QList<QString> &texts, const QString &mappedCharacters, const QList<HbIcon> &icons) |
98 const QList<QString> &texts, const QString &mappedCharacters, const QList<HbIcon> &icons) |
99 : mType(type), mState(state), mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(autoRepeat), |
99 : mType(type), mState(state), mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(autoRepeat), |
100 mMappedCharacters(mappedCharacters) |
100 mMappedCharacters(mappedCharacters) |
101 { |
101 { |
102 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
102 for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { |
103 if (i < texts.count()) { |
103 if (i < texts.count()) { |
104 mTexts.append(texts.at(i)); |
104 mTexts.append(texts.at(i)); |
105 } else { |
105 } else { |
161 integer value. |
161 integer value. |
162 position is button's position in grid cell units. |
162 position is button's position in grid cell units. |
163 size is button's size in grid cell units. |
163 size is button's size in grid cell units. |
164 */ |
164 */ |
165 HbInputButton::HbInputButton(int keyCode, const QPoint &position, const QSize &size) |
165 HbInputButton::HbInputButton(int keyCode, const QPoint &position, const QSize &size) |
166 : d_ptr(new HbInputButtonPrivate(keyCode, position, size)) |
166 : d_ptr(new HbInputButtonPrivate(keyCode, position, size)) |
167 { |
167 { |
168 } |
168 } |
169 |
169 |
170 /*! |
170 /*! |
171 Destructor |
171 Destructor |
432 } |
432 } |
433 } |
433 } |
434 |
434 |
435 /*! |
435 /*! |
436 Updates all button icons. |
436 Updates all button icons. |
437 Button can have three different icons. Icon position |
437 Button can have three different icons. Icon position |
438 will depend of other buttons icons and texts. If list contains |
438 will depend of other buttons icons and texts. If list contains |
439 more icons, then the rest will be ignored. Icon with same index |
439 more icons, then the rest will be ignored. Icon with same index |
440 than text will override the text. |
440 than text will override the text. |
441 |
441 |
442 \sa icon |
442 \sa icon |