|
1 /* |
|
2 * Copyright (c) 2005 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: LandmarksUi Content File - |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 // INCLUDE FILES |
|
26 #include "CLmkLandmark.h" |
|
27 #include <e32math.h> |
|
28 |
|
29 |
|
30 // ================= MEMBER FUNCTIONS ======================= |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CLmkLandmark::CLmkLandmark() |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CLmkLandmark::CLmkLandmark() |
|
40 // C++ default constructor can NOT contain any code, that |
|
41 // might leave. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CLmkLandmark::CLmkLandmark() |
|
45 { |
|
46 } |
|
47 |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CLmkLandmark::ConstructL |
|
51 // Symbian 2nd phase constructor can leave. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 void CLmkLandmark::ConstructL(const CPosLandmark* aLandmark, |
|
55 const RPointerArray<CPosLandmarkCategory>& aCategories) |
|
56 { |
|
57 iLandmark = CPosLandmark::NewL(*aLandmark); |
|
58 TInt count = aCategories.Count(); |
|
59 for (TInt i(0); i < count ; i++) |
|
60 { |
|
61 CPosLandmarkCategory* category = CPosLandmarkCategory::NewL(*aCategories[i]); |
|
62 CleanupStack::PushL(category); |
|
63 User::LeaveIfError(iCategories.Append(category)); |
|
64 CleanupStack::Pop();//category |
|
65 } |
|
66 } |
|
67 |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CLmkLandmark::NewL |
|
71 // Two-phased copy constructor. |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C CLmkLandmark* CLmkLandmark::NewL( |
|
75 const CPosLandmark* aLandmark, |
|
76 const RPointerArray<CPosLandmarkCategory>& aCategories) |
|
77 { |
|
78 CLmkLandmark* self = new (ELeave) CLmkLandmark(); |
|
79 CleanupStack::PushL(self); |
|
80 self->ConstructL(aLandmark,aCategories); |
|
81 CleanupStack::Pop(); |
|
82 return self; |
|
83 } |
|
84 |
|
85 EXPORT_C CLmkLandmark* CLmkLandmark::NewL( |
|
86 const CLmkLandmark& aLandmark) |
|
87 { |
|
88 CLmkLandmark* self = new (ELeave) CLmkLandmark(); |
|
89 CleanupStack::PushL(self); |
|
90 self->ConstructL(aLandmark.iLandmark,aLandmark.iCategories); |
|
91 CleanupStack::Pop(); |
|
92 return self; |
|
93 } |
|
94 // Destructor |
|
95 CLmkLandmark::~CLmkLandmark() |
|
96 { |
|
97 delete iLandmark; |
|
98 iCategories.ResetAndDestroy(); |
|
99 } |
|
100 |
|
101 EXPORT_C CPosLandmark* CLmkLandmark::PosLandmark() |
|
102 { |
|
103 return iLandmark; |
|
104 } |
|
105 EXPORT_C RPointerArray<CPosLandmarkCategory>& CLmkLandmark::Categories() |
|
106 { |
|
107 return iCategories; |
|
108 } |
|
109 |
|
110 // End of File |