1.1 --- a/epoc32/include/mw/mclfsortingstyle.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/mclfsortingstyle.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,163 @@
1.4 -mclfsortingstyle.h
1.5 +/*
1.6 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef MCLFSORTINGSTYLE_H
1.24 +#define MCLFSORTINGSTYLE_H
1.25 +
1.26 +// INCLUDES
1.27 +#include <CLFContentListing.hrh>
1.28 +#include <CLFContentListing.h>
1.29 +#include <e32std.h>
1.30 +
1.31 +// FORWARD DECLARATIONS
1.32 +class MCLFSortingStyleExt;
1.33 +
1.34 +// CLASS DECLARATION
1.35 +
1.36 +/**
1.37 +* Sorting style for Content Listing Framework.
1.38 +* This class can be used to define primary and secondary sorting styles for
1.39 +* Content Listing Framework list model. Sorting styles are used to sort the
1.40 +* list model.<br><br>
1.41 +* Secondary sorting style is used to sort items that could not be sorted by
1.42 +* the primary sorting style. In other words, items that do not have the
1.43 +* field defined by primary or any previous secondary sorting style, the items
1.44 +* are sorted using the next secondary sorting style. When a secondary sorting
1.45 +* style is appended, it becomes the least significant sorting style until a
1.46 +* new one is added after it. Items with undefined fields are placed before or
1.47 +* after items with defined fields, depending on the undefined field position
1.48 +* setting in MCLFSortingStyle.
1.49 +* <br><br>
1.50 +* Usage:
1.51 +* @code
1.52 +* // Create a sorting style instance
1.53 +* MCLFSortingStyle* sortingStyle = ContentListingFactory::NewSortingStyleLC();
1.54 +*
1.55 +* // Set sort ordering
1.56 +* sortingStyle->SetOrdering( ECLFOrderingDescending );
1.57 +*
1.58 +* // Set undefied item position. Undefined items are items that doesn't
1.59 +* // have field that is defined in sorting style fields
1.60 +* sortingStyle->SetUndefinedItemPosition( ECLFSortingStyleUndefinedEnd );
1.61 +*
1.62 +* // All sorting style parameter fields are string type
1.63 +* sortingStyle->SetSortingDataType( ECLFItemDataTypeDesC );
1.64 +*
1.65 +* // Set default sorting parameter
1.66 +* sortingStyle->AddFieldL( ECLFFieldIdSongName );
1.67 +*
1.68 +* // Set secondary sorting parameter
1.69 +* sortingStyle->AddFieldL( ECLFFieldIdFileName );
1.70 +*
1.71 +* // If item doesn't have ECLFFieldIdSongName field then
1.72 +* // ECLFFieldIdFileName field is used to sort item.
1.73 +* @endcode
1.74 +*
1.75 +* @lib ContentListingFramework.lib
1.76 +* @since S60 3.1
1.77 +*/
1.78 +class MCLFSortingStyle
1.79 + {
1.80 + public: // Destructor
1.81 +
1.82 + /**
1.83 + * Destructor.
1.84 + */
1.85 + virtual ~MCLFSortingStyle() {}
1.86 +
1.87 + public: // New functions
1.88 +
1.89 + /**
1.90 + * Reset settings of the sorting style to default.
1.91 + * @since S60 3.1
1.92 + */
1.93 + virtual void ResetL() = 0;
1.94 +
1.95 + /**
1.96 + * Set sort ordering. Ordering can be ascending or descending. See
1.97 + * TCLFSortingStyleOrdering
1.98 + * @since S60 3.1
1.99 + * @param aOrdering Sort ordering to be set
1.100 + */
1.101 + virtual void SetOrdering( TCLFSortingStyleOrdering aOrdering ) = 0;
1.102 +
1.103 + /**
1.104 + * Get current sort ordering of the sorting style.
1.105 + * @since S60 3.1
1.106 + * @return Current sort ordering
1.107 + */
1.108 + virtual TCLFSortingStyleOrdering Ordering() const = 0;
1.109 +
1.110 + /**
1.111 + * Set data type of sorting parameter fields. Data type can be text,
1.112 + * time or number. See TCLFItemDataType
1.113 + * @since S60 3.1
1.114 + * @param aDataType Data type to be set
1.115 + */
1.116 + virtual void SetSortingDataType( TCLFItemDataType aDataType ) = 0;
1.117 +
1.118 + /**
1.119 + * Get current sorting data type of fields.
1.120 + * @since S60 3.1
1.121 + * @return Current data type sorting of sorting fields
1.122 + */
1.123 + virtual TCLFItemDataType SortingDataType() const = 0;
1.124 +
1.125 + /**
1.126 + * Set undefined item position. Items not having information for defined
1.127 + * sorting parameter fields are placed to top or bottom of the model. See
1.128 + * TCLFUndefinedItemPosition
1.129 + * @since S60 3.1
1.130 + * @param aUndefinedItemPosition Position for undefiened items
1.131 + */
1.132 + virtual void SetUndefinedItemPosition(
1.133 + TCLFUndefinedItemPosition aUndefinedItemPosition ) = 0;
1.134 +
1.135 + /**
1.136 + * Get current position of undefined items.
1.137 + * @since S60 3.1
1.138 + * @return Current position for undefined items
1.139 + */
1.140 + virtual TCLFUndefinedItemPosition UndefinedItemPosition() const = 0;
1.141 +
1.142 + /**
1.143 + * Add new field to the sorting style. First added field will be the
1.144 + * default field. Remember to set type of field(s) with
1.145 + * SetSortingDataType. Fields that are some other type will be ignored.
1.146 + * See TCLFDefaultFieldId in CLFContentListing.hrh
1.147 + * @since S60 3.1
1.148 + * @param aFieldId Id of the sorting parameter field
1.149 + */
1.150 + virtual void AddFieldL( TCLFFieldId aFieldId ) = 0;
1.151 +
1.152 + /**
1.153 + * Get IDs of fields that have been set to the sorting style.
1.154 + * @since S60 3.1
1.155 + * @param aArray Array of field IDs
1.156 + */
1.157 + virtual void GetFieldsL( RArray<TCLFFieldId>& aArray ) const = 0;
1.158 +
1.159 + private: // Extension interface
1.160 +
1.161 + virtual MCLFSortingStyleExt* Extension() { return NULL; }
1.162 +
1.163 + };
1.164 +
1.165 +#endif // MCLFSORTINGSTYLE_H
1.166 +
1.167 +// End of File