author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
/* |
williamr@4 | 2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 3 |
* All rights reserved. |
williamr@4 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@4 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 8 |
* |
williamr@4 | 9 |
* Initial Contributors: |
williamr@4 | 10 |
* Nokia Corporation - initial contribution. |
williamr@4 | 11 |
* |
williamr@4 | 12 |
* Contributors: |
williamr@4 | 13 |
* |
williamr@4 | 14 |
* Description: Phonebook 2 sort order manager. |
williamr@4 | 15 |
* |
williamr@4 | 16 |
*/ |
williamr@4 | 17 |
|
williamr@4 | 18 |
|
williamr@4 | 19 |
#ifndef CPBK2SORTORDERMANAGER_H |
williamr@4 | 20 |
#define CPBK2SORTORDERMANAGER_H |
williamr@4 | 21 |
|
williamr@4 | 22 |
// INCLUDE FILES |
williamr@4 | 23 |
#include <e32base.h> |
williamr@4 | 24 |
|
williamr@4 | 25 |
// FORWARD DECLARATIONS |
williamr@4 | 26 |
class MVPbkContactViewBase; |
williamr@4 | 27 |
class MVPbkFieldTypeList; |
williamr@4 | 28 |
class RFs; |
williamr@4 | 29 |
class CPbk2SortOrderManagerImpl; |
williamr@4 | 30 |
|
williamr@4 | 31 |
/** |
williamr@4 | 32 |
* Observer interface for receiving notifications of |
williamr@4 | 33 |
* view sort order changes. |
williamr@4 | 34 |
*/ |
williamr@4 | 35 |
class MPbk2SortOrderObserver |
williamr@4 | 36 |
{ |
williamr@4 | 37 |
public: // Interface |
williamr@4 | 38 |
|
williamr@4 | 39 |
/** |
williamr@4 | 40 |
* Called when sort order has changed. |
williamr@4 | 41 |
*/ |
williamr@4 | 42 |
virtual void SortOrderChanged() = 0; |
williamr@4 | 43 |
|
williamr@4 | 44 |
protected: // Disabled functions |
williamr@4 | 45 |
~MPbk2SortOrderObserver() |
williamr@4 | 46 |
{} |
williamr@4 | 47 |
}; |
williamr@4 | 48 |
|
williamr@4 | 49 |
/** |
williamr@4 | 50 |
* Phonebook 2 sort order manager. |
williamr@4 | 51 |
* Responsible for managing the sort order of the contacts in |
williamr@4 | 52 |
* a contact view. |
williamr@4 | 53 |
*/ |
williamr@4 | 54 |
class CPbk2SortOrderManager : public CBase |
williamr@4 | 55 |
{ |
williamr@4 | 56 |
public: // Enumerations |
williamr@4 | 57 |
|
williamr@4 | 58 |
/// Name display orders |
williamr@4 | 59 |
enum TPbk2NameDisplayOrder |
williamr@4 | 60 |
{ |
williamr@4 | 61 |
/// Last name First name |
williamr@4 | 62 |
EPbk2NameDisplayOrderLastNameFirstName, |
williamr@4 | 63 |
/// First name Last name |
williamr@4 | 64 |
EPbk2NameDisplayOrderFirstNameLastName, |
williamr@4 | 65 |
/// Last name<separator> First Name |
williamr@4 | 66 |
EPbk2NameDisplayOrderLastNameSeparatorFirstName |
williamr@4 | 67 |
}; |
williamr@4 | 68 |
|
williamr@4 | 69 |
public: // Construction and destruction |
williamr@4 | 70 |
|
williamr@4 | 71 |
/** |
williamr@4 | 72 |
* Creates a new instance of this class. |
williamr@4 | 73 |
* |
williamr@4 | 74 |
* @param aMasterFieldTypeList Master field type list. |
williamr@4 | 75 |
* Can be retrieved from Virtual |
williamr@4 | 76 |
* Phonebook contact manager. |
williamr@4 | 77 |
* @param aFs A file system session |
williamr@4 | 78 |
* reference for resource file |
williamr@4 | 79 |
* handling. If NULL then |
williamr@4 | 80 |
* an own session is created. |
williamr@4 | 81 |
* @return A new instance of this class. |
williamr@4 | 82 |
*/ |
williamr@4 | 83 |
IMPORT_C static CPbk2SortOrderManager* NewL( |
williamr@4 | 84 |
const MVPbkFieldTypeList& aMasterFieldTypeList, |
williamr@4 | 85 |
RFs* aFs = NULL ); |
williamr@4 | 86 |
|
williamr@4 | 87 |
/** |
williamr@4 | 88 |
* Destructor. |
williamr@4 | 89 |
*/ |
williamr@4 | 90 |
~CPbk2SortOrderManager(); |
williamr@4 | 91 |
|
williamr@4 | 92 |
public: // Interface |
williamr@4 | 93 |
|
williamr@4 | 94 |
/** |
williamr@4 | 95 |
* Sets the contact view that this manager manages. |
williamr@4 | 96 |
* Takes in use the sort order from the given view. |
williamr@4 | 97 |
* |
williamr@4 | 98 |
* @param aContactView The contact view to manage. |
williamr@4 | 99 |
*/ |
williamr@4 | 100 |
IMPORT_C void SetContactViewL( |
williamr@4 | 101 |
MVPbkContactViewBase& aContactView ); |
williamr@4 | 102 |
|
williamr@4 | 103 |
/** |
williamr@4 | 104 |
* Adds an observer. |
williamr@4 | 105 |
* |
williamr@4 | 106 |
* @param aObserver The observer to add. |
williamr@4 | 107 |
*/ |
williamr@4 | 108 |
IMPORT_C void AddObserverL( |
williamr@4 | 109 |
MPbk2SortOrderObserver& aObserver ); |
williamr@4 | 110 |
|
williamr@4 | 111 |
/** |
williamr@4 | 112 |
* Removes an observer. |
williamr@4 | 113 |
* |
williamr@4 | 114 |
* @param aObserver The observer to remove. |
williamr@4 | 115 |
*/ |
williamr@4 | 116 |
IMPORT_C void RemoveObserver( |
williamr@4 | 117 |
MPbk2SortOrderObserver& aObserver ); |
williamr@4 | 118 |
|
williamr@4 | 119 |
/** |
williamr@4 | 120 |
* Sets the name displaying order for the managed contact view. |
williamr@4 | 121 |
* |
williamr@4 | 122 |
* @param aNameDisplayOrder New name display order for |
williamr@4 | 123 |
* the managed contact view. |
williamr@4 | 124 |
* @param aSeparator Custom separator to be used between |
williamr@4 | 125 |
* lastname and firstname if it exists. |
williamr@4 | 126 |
* If KNullDesC is given, space is used |
williamr@4 | 127 |
* as separator. |
williamr@4 | 128 |
*/ |
williamr@4 | 129 |
IMPORT_C void SetNameDisplayOrderL( |
williamr@4 | 130 |
TPbk2NameDisplayOrder aNameDisplayOrder, |
williamr@4 | 131 |
const TDesC& aSeparator = KNullDesC ); |
williamr@4 | 132 |
|
williamr@4 | 133 |
/** |
williamr@4 | 134 |
* Returns the current name display order. |
williamr@4 | 135 |
* |
williamr@4 | 136 |
* @return Current name display order. |
williamr@4 | 137 |
*/ |
williamr@4 | 138 |
IMPORT_C TPbk2NameDisplayOrder NameDisplayOrder() const; |
williamr@4 | 139 |
|
williamr@4 | 140 |
/** |
williamr@4 | 141 |
* Returns the current sort order. |
williamr@4 | 142 |
* |
williamr@4 | 143 |
* @return Current sort order. |
williamr@4 | 144 |
*/ |
williamr@4 | 145 |
IMPORT_C const MVPbkFieldTypeList& SortOrder() const; |
williamr@4 | 146 |
|
williamr@4 | 147 |
/** |
williamr@4 | 148 |
* Returns the language specific default separator. |
williamr@4 | 149 |
* This can not be changed run time. |
williamr@4 | 150 |
* |
williamr@4 | 151 |
* @return the language specific default separator. |
williamr@4 | 152 |
*/ |
williamr@4 | 153 |
IMPORT_C const TDesC& DefaultSeparator(); |
williamr@4 | 154 |
|
williamr@4 | 155 |
/** |
williamr@4 | 156 |
* Returns the current separator. This the separator that |
williamr@4 | 157 |
* can be changed run time and saved to Central Repository. |
williamr@4 | 158 |
* |
williamr@4 | 159 |
* @return A current separator. |
williamr@4 | 160 |
*/ |
williamr@4 | 161 |
IMPORT_C const TDesC& CurrentSeparator() const; |
williamr@4 | 162 |
|
williamr@4 | 163 |
private: // Implementation |
williamr@4 | 164 |
void ConstructL( |
williamr@4 | 165 |
const MVPbkFieldTypeList& aMasterFieldTypeList, |
williamr@4 | 166 |
RFs* aFs ); |
williamr@4 | 167 |
|
williamr@4 | 168 |
private: // Data |
williamr@4 | 169 |
/// Own: Implementation object |
williamr@4 | 170 |
CPbk2SortOrderManagerImpl* iImpl; |
williamr@4 | 171 |
}; |
williamr@4 | 172 |
|
williamr@4 | 173 |
#endif // CPBK2SORTORDERMANAGER_H |
williamr@4 | 174 |
|
williamr@4 | 175 |
// End of File |