equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
133 * using @c SHIFT button. |
133 * using @c SHIFT button. |
134 */ |
134 */ |
135 ENoExtendedSelection = SLafListBox::ENoExtendedSelection, |
135 ENoExtendedSelection = SLafListBox::ENoExtendedSelection, |
136 |
136 |
137 /** |
137 /** |
138 * Construction flag that sets the list box to match user’s keystrokes |
138 * Construction flag that sets the list box to match user?s keystrokes |
139 * incrementally. |
139 * incrementally. |
140 */ |
140 */ |
141 EIncrementalMatching = SLafListBox::EIncrementalMatching, |
141 EIncrementalMatching = SLafListBox::EIncrementalMatching, |
142 |
142 |
143 /** |
143 /** |
234 ES60StyleMultiselection = SLafListBox::ES60StyleMultiselection, |
234 ES60StyleMultiselection = SLafListBox::ES60StyleMultiselection, |
235 |
235 |
236 /** |
236 /** |
237 * Construction flag for enabling S60 style markable items. |
237 * Construction flag for enabling S60 style markable items. |
238 */ |
238 */ |
239 ES60StyleMarkable = SLafListBox::ES60StyleMarkable |
239 ES60StyleMarkable = SLafListBox::ES60StyleMarkable, |
|
240 |
|
241 /** |
|
242 * Construction flag for disabling item specific stylus popup menu. |
|
243 */ |
|
244 EDisableItemSpecificMenu = 0x00040000 |
240 }; |
245 }; |
241 enum {KEikMaxMatchingBufferLength = 2}; |
246 enum {KEikMaxMatchingBufferLength = 2}; |
242 |
247 |
243 /** |
248 /** |
244 * Indicates who owns the scroll bar. |
249 * Indicates who owns the scroll bar. |
771 // not available before Release 005u |
776 // not available before Release 005u |
772 |
777 |
773 /** |
778 /** |
774 * From @c CCoeControl |
779 * From @c CCoeControl |
775 * |
780 * |
776 * Handles a change to the list box’s resources of type @c aType which are |
781 * Handles a change to the list box?s resources of type @c aType which are |
777 * shared across the environment, colours or fonts for example. |
782 * shared across the environment, colours or fonts for example. |
778 * |
783 * |
779 * @param aType The type of resources that have changed. |
784 * @param aType The type of resources that have changed. |
780 */ |
785 */ |
781 IMPORT_C virtual void HandleResourceChange(TInt aType); |
786 IMPORT_C virtual void HandleResourceChange(TInt aType); |
942 */ |
947 */ |
943 IMPORT_C TBool LastCharMatched() const; |
948 IMPORT_C TBool LastCharMatched() const; |
944 |
949 |
945 // functions needed for supporting scrollbars |
950 // functions needed for supporting scrollbars |
946 /** |
951 /** |
947 * Updates the position of this list box’s scroll bars’ thumbs to reflect |
952 * Updates the position of this list box?s scroll bars? thumbs to reflect |
948 * the horizontal and vertical position of the list view within the list. |
953 * the horizontal and vertical position of the list view within the list. |
949 */ |
954 */ |
950 IMPORT_C virtual void UpdateScrollBarThumbs() const; |
955 IMPORT_C virtual void UpdateScrollBarThumbs() const; |
951 |
956 |
952 /** |
957 /** |
1031 * @param aFlags Construction flags. |
1036 * @param aFlags Construction flags. |
1032 */ |
1037 */ |
1033 IMPORT_C virtual void ConstructL(const CCoeControl* aParent, TInt aFlags = 0); |
1038 IMPORT_C virtual void ConstructL(const CCoeControl* aParent, TInt aFlags = 0); |
1034 |
1039 |
1035 /** |
1040 /** |
1036 * Completes the list box view’s construction. |
1041 * Completes the list box view?s construction. |
1037 * |
1042 * |
1038 * This function is called by @c ConstructL() to complete construction |
1043 * This function is called by @c ConstructL() to complete construction |
1039 * of the resource view, calling its @c ConstructL() with appropriate |
1044 * of the resource view, calling its @c ConstructL() with appropriate |
1040 * arguments and assigning it to @c iView. Also prepares the view for use. |
1045 * arguments and assigning it to @c iView. Also prepares the view for use. |
1041 */ |
1046 */ |
1217 * If there is no match buffer, this function returns immediately; |
1222 * If there is no match buffer, this function returns immediately; |
1218 * otherwise the cursor is drawn on the current item using |
1223 * otherwise the cursor is drawn on the current item using |
1219 * @c CListBoxView::DrawMatcherCursor() after scrolling to make the current |
1224 * @c CListBoxView::DrawMatcherCursor() after scrolling to make the current |
1220 * item visible. |
1225 * item visible. |
1221 * |
1226 * |
1222 * A list box control’s matcher cursor is an on-screen cursor which is |
1227 * A list box control?s matcher cursor is an on-screen cursor which is |
1223 * drawn to indicate to the user the location of the current text. Whether |
1228 * drawn to indicate to the user the location of the current text. Whether |
1224 * the cursor is drawn is dependent on the |
1229 * the cursor is drawn is dependent on the |
1225 * @c CListBoxView::TFlags::EHasMatcherCursor flag, which may be set on the |
1230 * @c CListBoxView::TFlags::EHasMatcherCursor flag, which may be set on the |
1226 * list box’s view. |
1231 * list box?s view. |
1227 * |
1232 * |
1228 * Note, that CListBoxView::DrawMatcherCursor() is not implemented in S60. |
1233 * Note, that CListBoxView::DrawMatcherCursor() is not implemented in S60. |
1229 */ |
1234 */ |
1230 IMPORT_C void DrawMatcherCursor() const; |
1235 IMPORT_C void DrawMatcherCursor() const; |
1231 |
1236 |
1258 IMPORT_C void FireItemChange(); |
1263 IMPORT_C void FireItemChange(); |
1259 |
1264 |
1260 |
1265 |
1261 protected: // functions which deal with extension |
1266 protected: // functions which deal with extension |
1262 /** |
1267 /** |
1263 * Sets the reason for the list box’s loss of focus. |
1268 * Sets the reason for the list box?s loss of focus. |
1264 * |
1269 * |
1265 * This is required so the list box can determine whether |
1270 * This is required so the list box can determine whether |
1266 * loss of focus is due to an external control or an internal component. |
1271 * loss of focus is due to an external control or an internal component. |
1267 * |
1272 * |
1268 * @param aReasonForFocusLost The reason for the loss of focus. |
1273 * @param aReasonForFocusLost The reason for the loss of focus. |
1269 */ |
1274 */ |
1270 IMPORT_C void SetReasonForFocusLostL( TReasonForFocusLost aReasonForFocusLost ); |
1275 IMPORT_C void SetReasonForFocusLostL( TReasonForFocusLost aReasonForFocusLost ); |
1271 |
1276 |
1272 /** |
1277 /** |
1273 * Gets the reason for the list box’s loss of focus. |
1278 * Gets the reason for the list box?s loss of focus. |
1274 * |
1279 * |
1275 * @return The reason for the loss of focus. |
1280 * @return The reason for the loss of focus. |
1276 */ |
1281 */ |
1277 IMPORT_C TReasonForFocusLost ReasonForFocusLostL(); |
1282 IMPORT_C TReasonForFocusLost ReasonForFocusLostL(); |
1278 |
1283 |
1429 * |
1434 * |
1430 * @since S60 5.0 |
1435 * @since S60 5.0 |
1431 * @param aItems Number of items in one grid line. |
1436 * @param aItems Number of items in one grid line. |
1432 */ |
1437 */ |
1433 IMPORT_C void SetItemsInSingleLine(TInt aItems); |
1438 IMPORT_C void SetItemsInSingleLine(TInt aItems); |
|
1439 |
|
1440 /** |
|
1441 * Gets the number of list items in one line. This is more than one for |
|
1442 * grids only. |
|
1443 * |
|
1444 * @since S60 5.2 |
|
1445 * @return The number of list items in one line. |
|
1446 */ |
|
1447 IMPORT_C TInt ItemsInSingleLine() const; |
1434 |
1448 |
1435 /** |
1449 /** |
1436 * Removes pointer event filtering for list items. |
1450 * Removes pointer event filtering for list items. |
1437 * |
1451 * |
1438 * When there are two pointer up events on the same item at short interval, |
1452 * When there are two pointer up events on the same item at short interval, |
1483 * |
1497 * |
1484 * @param aSuspend ETrue to suspend effects, EFalse to re-enable them. |
1498 * @param aSuspend ETrue to suspend effects, EFalse to re-enable them. |
1485 */ |
1499 */ |
1486 IMPORT_C void SuspendEffects( TBool aSuspend ); |
1500 IMPORT_C void SuspendEffects( TBool aSuspend ); |
1487 |
1501 |
|
1502 /** |
|
1503 * Disables the single click functionality in the list. |
|
1504 * By default the feature is enabled. |
|
1505 * |
|
1506 * @since S60 5.2 |
|
1507 * |
|
1508 * @param aDisabled @c ETrue to disable single click |
|
1509 * @c EFalse does currently nothing |
|
1510 */ |
|
1511 IMPORT_C void DisableSingleClick( TBool aDisabled ); |
|
1512 |
|
1513 /** |
|
1514 * Disables item specific menu from the list. This has the same effect as |
|
1515 * construction time flag @c EAknListBoxItemSpecificMenuDisabled and |
|
1516 * calling this method also turns that flag on. |
|
1517 * |
|
1518 * @since S60 5.2 |
|
1519 */ |
|
1520 IMPORT_C void DisableItemSpecificMenu(); |
|
1521 |
1488 private: |
1522 private: |
1489 IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only |
1523 IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only |
1490 void HorizontalScroll(TInt aScrollAmountInPixels); |
1524 void HorizontalScroll(TInt aScrollAmountInPixels); |
1491 void DrawItemInView(TInt aItemIndex) const; |
1525 void DrawItemInView(TInt aItemIndex) const; |
1492 void ClearMargins(CWindowGc& aGc) const; |
1526 void ClearMargins(CWindowGc& aGc) const; |
1525 * |
1559 * |
1526 * @internal |
1560 * @internal |
1527 * @since 5.0 |
1561 * @since 5.0 |
1528 */ |
1562 */ |
1529 void UpdateHighlightL( TInt aItemIndex ); |
1563 void UpdateHighlightL( TInt aItemIndex ); |
1530 |
1564 |
|
1565 public: |
|
1566 /** |
|
1567 * Sets this control as visible or invisible. |
|
1568 * |
|
1569 * @param aVisible ETrue to make the control visible, EFalse to make |
|
1570 * it invisible. |
|
1571 * @since 5.2 |
|
1572 */ |
|
1573 IMPORT_C virtual void MakeVisible( TBool aVisible ); |
|
1574 |
1531 protected: |
1575 protected: |
1532 /** Flags for this list box */ |
1576 /** Flags for this list box */ |
1533 TInt iListBoxFlags; |
1577 TInt iListBoxFlags; |
1534 |
1578 |
1535 /** This List box's view */ |
1579 /** This List box's view */ |
1581 |
1625 |
1582 /** |
1626 /** |
1583 * This is a list box that scrolls horizontally, displaying its items |
1627 * This is a list box that scrolls horizontally, displaying its items |
1584 * in as many vertical columns as needed. Columns are arranged across |
1628 * in as many vertical columns as needed. Columns are arranged across |
1585 * the control from left to right; within columns, items are arranged |
1629 * the control from left to right; within columns, items are arranged |
1586 * from top to bottom. The flow of items or text ‘snakes’ across the |
1630 * from top to bottom. The flow of items or text ?snakes? across the |
1587 * face of the control. |
1631 * face of the control. |
1588 * |
1632 * |
1589 * This is a flexible control class that makes good use of short, wide |
1633 * This is a flexible control class that makes good use of short, wide |
1590 * display areas; for instance, subclasses of @c CEikSnakingListBox could |
1634 * display areas; for instance, subclasses of @c CEikSnakingListBox could |
1591 * be used for file lists or for a control panel. A standard user |
1635 * be used for file lists or for a control panel. A standard user |
1619 * @return The view which will be used by the list box being created |
1663 * @return The view which will be used by the list box being created |
1620 */ |
1664 */ |
1621 IMPORT_C virtual CListBoxView* MakeViewClassInstanceL(); |
1665 IMPORT_C virtual CListBoxView* MakeViewClassInstanceL(); |
1622 |
1666 |
1623 /** |
1667 /** |
1624 * Sets the top item’s index. |
1668 * Sets the top item?s index. |
1625 * |
1669 * |
1626 * @param aItemIndex Index of the item to set as the top item. |
1670 * @param aItemIndex Index of the item to set as the top item. |
1627 */ |
1671 */ |
1628 IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex) const; |
1672 IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex) const; |
1629 |
1673 |
1630 /** |
1674 /** |
1631 * Gets the width of this list box’s columns. |
1675 * Gets the width of this list box?s columns. |
1632 * |
1676 * |
1633 * @return Width of each column. |
1677 * @return Width of each column. |
1634 */ |
1678 */ |
1635 IMPORT_C TInt ColumnWidth() const; |
1679 IMPORT_C TInt ColumnWidth() const; |
1636 |
1680 |
1781 CArrayFix<TCoeColorUse>& aColorUseList) const; |
1825 CArrayFix<TCoeColorUse>& aColorUseList) const; |
1782 // not available before Release 005u |
1826 // not available before Release 005u |
1783 /** |
1827 /** |
1784 * From @c CCoeControl. |
1828 * From @c CCoeControl. |
1785 * |
1829 * |
1786 * Handles a change to the list box’s resources of type @c aType which are |
1830 * Handles a change to the list box?s resources of type @c aType which are |
1787 * shared across the environment, colours or fonts for example. |
1831 * shared across the environment, colours or fonts for example. |
1788 * |
1832 * |
1789 * @param aType The type of resources that have changed. |
1833 * @param aType The type of resources that have changed. |
1790 */ |
1834 */ |
1791 IMPORT_C virtual void HandleResourceChange(TInt aType); |
1835 IMPORT_C virtual void HandleResourceChange(TInt aType); |