|
1 /* |
|
2 * Copyright (c) 2002 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 * Wrapper for selectable items. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __TPbkAddItemWrapper_H__ |
|
21 #define __TPbkAddItemWrapper_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> // CBase |
|
25 #include "PbkFields.hrh" // TPbkAddItemOrdering |
|
26 #include "PbkIconId.hrh" // TPbkIconId |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CPbkFieldInfo; |
|
30 class CPbkFieldInfoGroup; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Wrapper for selectable items in selecting fields |
|
36 * to add in CPbkMemoryEntryAddItemDlg. |
|
37 */ |
|
38 NONSHARABLE_CLASS(TPbkAddItemWrapper) |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 /** |
|
42 * Constructor for creating a wrapper for CPbkFieldInfo aFieldInfo. |
|
43 */ |
|
44 TPbkAddItemWrapper(const CPbkFieldInfo& aFieldInfo); |
|
45 /** |
|
46 * Constructor for creating a wrapper for CPbkFieldInfoGroup aInfoGroup. |
|
47 */ |
|
48 TPbkAddItemWrapper(const CPbkFieldInfoGroup& aInfoGroup); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~TPbkAddItemWrapper(); |
|
54 |
|
55 public: // implementation |
|
56 /** |
|
57 * Returns the label of the instance. |
|
58 */ |
|
59 const TDesC& Label() const; |
|
60 /** |
|
61 * Returns the icon id of the instance. |
|
62 */ |
|
63 TPbkIconId IconId() const; |
|
64 /** |
|
65 * Returns the add item ordering value of the instance. |
|
66 */ |
|
67 TPbkAddItemOrdering AddItemOrdering() const; |
|
68 /** |
|
69 * Returns the count of CPbkFieldInfos that this instance |
|
70 * contains; one if this wrapps a aFieldInfo, otherwise |
|
71 * the count of CPbkFieldInfos in a wrapped CPbkFieldInfoGroup. |
|
72 */ |
|
73 TInt FieldInfoCount() const; |
|
74 /** |
|
75 * Returns the field info at gíven index. If CPbkFieldInfo is wrapped |
|
76 * returns always that regardless of the parameter. |
|
77 * @param aIndex Index for the desired field info. Meanigful only |
|
78 * if CPbkFieldInfoGroup is wrapped |
|
79 */ |
|
80 CPbkFieldInfo* FieldInfoAt(const TInt aIndex) const; |
|
81 |
|
82 private: // Data |
|
83 /// Ref: field info object |
|
84 const CPbkFieldInfo* iFieldInfo; |
|
85 /// Ref: field info group object |
|
86 const CPbkFieldInfoGroup* iInfoGroup; |
|
87 }; |
|
88 |
|
89 #endif // __TPbkAddItemWrapper_H__ |
|
90 |
|
91 // End of File |