|
1 /* |
|
2 * Copyright (c) 2007-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: Range that is allocated for a plug-in. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PBK2_CONTACT_POSITION_INFO_H |
|
20 #define PBK2_CONTACT_POSITION_INFO_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <MVPbkContactLink.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 |
|
30 /** |
|
31 * stores contact referred link and it's position in view |
|
32 */ |
|
33 class CPbk2ContactPositionInfo : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 static inline CPbk2ContactPositionInfo* NewLC( MVPbkContactLink* aContactLink, TInt aPos ) |
|
38 { |
|
39 CPbk2ContactPositionInfo* self = |
|
40 new ( ELeave ) CPbk2ContactPositionInfo( aContactLink, aPos ); |
|
41 CleanupStack::PushL( self ); |
|
42 return self; |
|
43 } |
|
44 |
|
45 static TInt CompareByPosition( const CPbk2ContactPositionInfo& aFirst, |
|
46 const CPbk2ContactPositionInfo& aSecond ); |
|
47 |
|
48 public: |
|
49 inline ~CPbk2ContactPositionInfo() |
|
50 { |
|
51 delete iContactLink; |
|
52 } |
|
53 |
|
54 /* |
|
55 * @return pointer of MVPbkContactLink, ownership is transferred |
|
56 */ |
|
57 inline MVPbkContactLink* ContactLink() |
|
58 { |
|
59 MVPbkContactLink* link = iContactLink; |
|
60 iContactLink = NULL; |
|
61 return link; |
|
62 } |
|
63 inline TInt Position() |
|
64 { |
|
65 return iPos; |
|
66 } |
|
67 private: // Construction |
|
68 |
|
69 inline CPbk2ContactPositionInfo( MVPbkContactLink* aContactLink, TInt aPos ) : |
|
70 iContactLink( aContactLink ), |
|
71 iPos( aPos ) |
|
72 { |
|
73 } |
|
74 |
|
75 private: // Data |
|
76 |
|
77 // contact referred link |
|
78 MVPbkContactLink* iContactLink; |
|
79 |
|
80 // the position of contact in the view |
|
81 TInt iPos; |
|
82 |
|
83 }; |
|
84 |
|
85 #endif // PBK2_TOPCONTACT_ORDER_INFO_H |
|
86 |
|
87 //End of file |