|
1 /* |
|
2 * Copyright (c) 2006 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: Contains CNcdInstalledTheme class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ncdnodeinstallproxy.h" |
|
20 #include "ncdinstalledthemeimpl.h" |
|
21 #include "ncdinstallationservice.h" |
|
22 #include "catalogsinterfaceidentifier.h" |
|
23 #include "catalogsutils.h" |
|
24 #include "catalogsdebug.h" |
|
25 |
|
26 |
|
27 // ======== PUBLIC MEMBER FUNCTIONS ======== |
|
28 |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // Constructor |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 CNcdInstalledTheme::CNcdInstalledTheme( |
|
35 CNcdNodeInstallProxy& aParent, |
|
36 HBufC* aTheme ) |
|
37 : CNcdInstalledContent( aParent ), |
|
38 iTheme( aTheme ) |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // 2nd phase constructor |
|
45 // --------------------------------------------------------------------------- |
|
46 // |
|
47 void CNcdInstalledTheme::ConstructL() |
|
48 { |
|
49 DLTRACEIN(("this: %x", this)); |
|
50 CNcdInstalledContent::ConstructL(); |
|
51 |
|
52 // Theme name cannot be NULL but it can be empty |
|
53 User::LeaveIfNull( iTheme ); |
|
54 |
|
55 // Register the interface |
|
56 MNcdInstalledTheme* interface( this ); |
|
57 AddInterfaceL( |
|
58 CCatalogsInterfaceIdentifier::NewL( interface, this, |
|
59 MNcdInstalledTheme::KInterfaceUid ) ); |
|
60 } |
|
61 |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // NewL |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 CNcdInstalledTheme* CNcdInstalledTheme::NewL( |
|
68 CNcdNodeInstallProxy& aParent, |
|
69 HBufC* aTheme ) |
|
70 { |
|
71 CNcdInstalledTheme* self = |
|
72 CNcdInstalledTheme::NewLC( aParent, aTheme ); |
|
73 CleanupStack::Pop( self ); |
|
74 return self; |
|
75 } |
|
76 |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // NewLC |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 CNcdInstalledTheme* CNcdInstalledTheme::NewLC( |
|
83 CNcdNodeInstallProxy& aParent, |
|
84 HBufC* aTheme ) |
|
85 { |
|
86 CNcdInstalledTheme* self = |
|
87 new( ELeave ) CNcdInstalledTheme( aParent, aTheme ); |
|
88 // Using PushL because the object does not have any references yet |
|
89 CleanupStack::PushL( self ); |
|
90 self->ConstructL(); |
|
91 return self; |
|
92 } |
|
93 |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // Destructor |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CNcdInstalledTheme::~CNcdInstalledTheme() |
|
100 { |
|
101 DLTRACEIN(("this: %x", this)); |
|
102 |
|
103 // Remove interfaces implemented by this class from the interface list. |
|
104 // So, the interface list is up to date when this class object is deleted. |
|
105 RemoveInterface( MNcdInstalledTheme::KInterfaceUid ); |
|
106 |
|
107 |
|
108 // Delete member variables here |
|
109 delete iTheme; |
|
110 } |
|
111 |
|
112 |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // Is installed |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 TBool CNcdInstalledTheme::IsInstalledL() const |
|
119 { |
|
120 return ContentOwner().InstallationService().IsThemeInstalledL( *iTheme ); |
|
121 } |
|
122 |
|
123 |
|
124 // --------------------------------------------------------------------------- |
|
125 // Theme name getter |
|
126 // --------------------------------------------------------------------------- |
|
127 // |
|
128 const TDesC& CNcdInstalledTheme::Theme() const |
|
129 { |
|
130 return *iTheme; |
|
131 } |
|
132 |
|
133 |