|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef CNTVIEWSTORE_H_ |
|
17 #define CNTVIEWSTORE_H_ |
|
18 #include <cntviewbase.h> |
|
19 |
|
20 class RContactViewSortOrder; |
|
21 |
|
22 |
|
23 /** Definition of a default remote view. |
|
24 |
|
25 Holds all the information (excluding a database) required to create |
|
26 a standard or named remote view. |
|
27 |
|
28 @publishedPartner |
|
29 @released |
|
30 */ |
|
31 NONSHARABLE_CLASS(CContactDefaultViewDefinition) : public CBase |
|
32 { |
|
33 public: |
|
34 |
|
35 enum TViewType |
|
36 { |
|
37 ERemoteView, |
|
38 ENamedRemoteView |
|
39 }; |
|
40 |
|
41 public: |
|
42 IMPORT_C static CContactDefaultViewDefinition* NewLC(TViewType aViewType, const TDesC& aViewName, const RContactViewSortOrder& aSortOrder, TContactViewPreferences aContactTypes, const TDesC8& aSortPluginName); |
|
43 IMPORT_C static CContactDefaultViewDefinition* NewLC(RReadStream& aStream); |
|
44 IMPORT_C ~CContactDefaultViewDefinition(); |
|
45 |
|
46 IMPORT_C const TDesC& ViewNameL() const; |
|
47 IMPORT_C const TDesC8& SortPluginNameL() const; |
|
48 IMPORT_C const RContactViewSortOrder& SortOrder() const; |
|
49 IMPORT_C TContactViewPreferences ViewPreferences() const; |
|
50 IMPORT_C TViewType ViewType() const; |
|
51 |
|
52 IMPORT_C void InternalizeL(RReadStream &aStream); |
|
53 IMPORT_C void ExternalizeL(RWriteStream &aStream) const; |
|
54 |
|
55 private: |
|
56 CContactDefaultViewDefinition(); |
|
57 CContactDefaultViewDefinition(TViewType aViewType, TContactViewPreferences aContactTypes); |
|
58 void ConstructL(const TDesC& aViewName, const RContactViewSortOrder &aSortOrder, const TDesC8& aSortPluginName); |
|
59 |
|
60 void Close(); |
|
61 |
|
62 private: |
|
63 HBufC* iViewName; |
|
64 HBufC8* iSortPluginName; |
|
65 RContactViewSortOrder iSortOrder; |
|
66 TContactViewPreferences iContactTypes; |
|
67 TViewType iViewType; |
|
68 }; |
|
69 |
|
70 /** Class to access the default settings store within |
|
71 Contacts model. |
|
72 |
|
73 @publishedPartner |
|
74 @released |
|
75 */ |
|
76 class TContactViewStore |
|
77 { |
|
78 public: |
|
79 IMPORT_C static void SetDefaultViewsL(const RPointerArray<CContactDefaultViewDefinition> &aDefaultViews); |
|
80 IMPORT_C static void GetDefaultViewsL(RPointerArray<CContactDefaultViewDefinition> &aDefaultViews); |
|
81 }; |
|
82 |
|
83 #endif // CNTVIEWSTORE_H_ |