|
1 /* |
|
2 * Copyright (c) 2007 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: Class stores basic information about application |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include "bsapplicationinfo.h" |
|
22 |
|
23 // ================= MEMBER FUNCTIONS ======================= |
|
24 |
|
25 // ----------------------------------------------------------------------------- |
|
26 // Constructor |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 CBSApplicationInfo::CBSApplicationInfo() |
|
30 { |
|
31 // No implementation required |
|
32 } |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // Destructor. |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 CBSApplicationInfo::~CBSApplicationInfo() |
|
39 { |
|
40 delete iItemState; |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // Two-phased constructor. |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CBSApplicationInfo* CBSApplicationInfo::NewLC() |
|
48 { |
|
49 CBSApplicationInfo* self = new (ELeave)CBSApplicationInfo(); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL( ); |
|
52 return self; |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // Two-phased constructor. |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CBSApplicationInfo* CBSApplicationInfo::NewL() |
|
60 { |
|
61 CBSApplicationInfo* self = CBSApplicationInfo::NewLC( ); |
|
62 CleanupStack::Pop( self ); |
|
63 return self; |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // Symbian 2nd phase constructor can leave. |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 void CBSApplicationInfo::ConstructL() |
|
71 { |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CBSApplicationInfo::SetAppUid( const TUid& aApp ) |
|
79 { |
|
80 iAppUid = aApp; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 TUid CBSApplicationInfo::AppUid() |
|
88 { |
|
89 return iAppUid; |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 void CBSApplicationInfo::SetPrevAppUid( const TUid& aApp ) |
|
97 { |
|
98 iPrevAppUid = aApp; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TUid CBSApplicationInfo::PrevAppUid() |
|
106 { |
|
107 return iPrevAppUid; |
|
108 } |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 void CBSApplicationInfo::SetItemStateL( const TDesC8& aState ) |
|
115 { |
|
116 delete iItemState; |
|
117 iItemState = NULL; |
|
118 iItemState = aState.AllocL( ); |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 const TDesC8& CBSApplicationInfo::ItemState() |
|
126 { |
|
127 if ( iItemState ) |
|
128 return *iItemState; |
|
129 else |
|
130 return KNullDesC8; |
|
131 } |