plugins/contacts/symbian/contactsmodel/inc/cntviewstore.h
changeset 0 876b1a06bc25
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /*
       
     2 * Copyright (c) 2005-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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CNTVIEWSTORE_H_
       
    20 #define CNTVIEWSTORE_H_
       
    21 
       
    22 class RContactViewSortOrder;
       
    23 
       
    24 
       
    25 /** Definition of a default remote view.
       
    26 
       
    27 Holds all the information (excluding a database) required to create 
       
    28 a standard or named remote view.
       
    29 
       
    30 @publishedPartner
       
    31 @released
       
    32 */
       
    33 NONSHARABLE_CLASS(CContactDefaultViewDefinition) : public CBase
       
    34 	{
       
    35 public:
       
    36 
       
    37 	enum TViewType
       
    38 		{
       
    39 		ERemoteView,
       
    40 		ENamedRemoteView
       
    41 		};
       
    42 		
       
    43 public:
       
    44 	IMPORT_C static CContactDefaultViewDefinition* NewLC(TViewType aViewType, const TDesC& aViewName, const RContactViewSortOrder& aSortOrder, TContactViewPreferences aContactTypes, const TDesC8& aSortPluginName);
       
    45 	IMPORT_C static CContactDefaultViewDefinition* NewLC(RReadStream& aStream);
       
    46 	IMPORT_C ~CContactDefaultViewDefinition();
       
    47 	
       
    48 	IMPORT_C const TDesC& ViewNameL() const;
       
    49 	IMPORT_C const TDesC8& SortPluginNameL() const;
       
    50 	IMPORT_C const RContactViewSortOrder& SortOrder() const;
       
    51 	IMPORT_C TContactViewPreferences ViewPreferences() const;
       
    52 	IMPORT_C TViewType ViewType() const;
       
    53 	
       
    54 	IMPORT_C void InternalizeL(RReadStream &aStream);
       
    55 	IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
       
    56 		
       
    57 private:
       
    58 	CContactDefaultViewDefinition();
       
    59 	CContactDefaultViewDefinition(TViewType aViewType, TContactViewPreferences aContactTypes);
       
    60 	void ConstructL(const TDesC& aViewName, const RContactViewSortOrder &aSortOrder, const TDesC8& aSortPluginName);
       
    61 	
       
    62 	void Close();
       
    63 	
       
    64 private:
       
    65 	HBufC* iViewName;
       
    66 	HBufC8* iSortPluginName;
       
    67 	RContactViewSortOrder iSortOrder;
       
    68 	TContactViewPreferences iContactTypes;
       
    69 	TViewType iViewType;	
       
    70 	};
       
    71 
       
    72 /** Class to access the default settings store within 
       
    73     Contacts model.
       
    74 
       
    75 @publishedPartner
       
    76 @released
       
    77 */
       
    78 class TContactViewStore
       
    79 	{
       
    80 public:
       
    81 	IMPORT_C static void SetDefaultViewsL(const RPointerArray<CContactDefaultViewDefinition> &aDefaultViews);
       
    82 	IMPORT_C static void GetDefaultViewsL(RPointerArray<CContactDefaultViewDefinition> &aDefaultViews);
       
    83 	};
       
    84 
       
    85 #endif // CNTVIEWSTORE_H_