|
1 /** |
|
2 * Copyright (c) 2010 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: CUpnpTmClientIconPref class implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "upnptmclienticonpref.h" |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "upnptmclienticonprefTraces.h" |
|
23 #endif |
|
24 |
|
25 // Literal |
|
26 _LIT8(KBmpMimeType, "image/bmp"); |
|
27 |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =================================== |
|
30 |
|
31 // --------------------------------------------------------------------------------- |
|
32 // CUpnpTmClientIconPref::NewL |
|
33 // Two-phased constructor. |
|
34 // @param aProfileId ProfileID of the client profile. |
|
35 // --------------------------------------------------------------------------------- |
|
36 // |
|
37 EXPORT_C CUpnpTmClientIconPref* CUpnpTmClientIconPref::NewL( TUint aProfileId ) |
|
38 { |
|
39 OstTraceFunctionEntry0( CUPNPTMCLIENTICONPREF_NEWL_ENTRY ); |
|
40 CUpnpTmClientIconPref* self = new (ELeave) CUpnpTmClientIconPref(aProfileId); |
|
41 CleanupStack::PushL(self); |
|
42 self->ConstructL( ); |
|
43 CleanupStack::Pop(self); |
|
44 OstTraceFunctionExit0( CUPNPTMCLIENTICONPREF_NEWL_EXIT ); |
|
45 return self; |
|
46 } |
|
47 |
|
48 // --------------------------------------------------------------------------------- |
|
49 // CUpnpTmClientIconPref::CUpnpTmClientIconPref |
|
50 // C++ default constructor can NOT contain any code, that |
|
51 // might leave. |
|
52 // --------------------------------------------------------------------------------- |
|
53 // |
|
54 CUpnpTmClientIconPref::CUpnpTmClientIconPref( TUint aProfileId ):iClientProfileId(aProfileId), |
|
55 iIconWidth(KErrNone),iIconHeight(KErrNone),iIconDepth(KDefaultDepthValue) |
|
56 { |
|
57 |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------------------------------- |
|
61 // CUpnpTmClientIconPref::ConstructL |
|
62 // Symbian 2nd phase constructor can leave. |
|
63 // --------------------------------------------------------------------------------- |
|
64 // |
|
65 void CUpnpTmClientIconPref::ConstructL( ) |
|
66 { |
|
67 OstTraceFunctionEntry0( CUPNPTMCLIENTICONPREF_CONSTRUCTL_ENTRY ); |
|
68 iIconMimeType = KBmpMimeType().AllocL(); |
|
69 OstTraceFunctionExit0( CUPNPTMCLIENTICONPREF_CONSTRUCTL_EXIT ); |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------------- |
|
73 // CUpnpTmClientIconPref::~CUpnpTmClientIconPref |
|
74 // Destructor |
|
75 // --------------------------------------------------------------------------------- |
|
76 // |
|
77 CUpnpTmClientIconPref::~CUpnpTmClientIconPref() |
|
78 { |
|
79 OstTraceFunctionEntry0( CUPNPTMCLIENTICONPREF_CUPNPTMCLIENTICONPREF_ENTRY ); |
|
80 delete iIconMimeType; |
|
81 OstTraceFunctionExit0( CUPNPTMCLIENTICONPREF_CUPNPTMCLIENTICONPREF_EXIT ); |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------------------------------- |
|
85 // CUpnpTmClientIconPref::SetMimeTypeL |
|
86 // Method is used to provide the preferred mime type of the client. |
|
87 // @param aMimeType mime type of the icon |
|
88 // --------------------------------------------------------------------------------- |
|
89 // |
|
90 EXPORT_C void CUpnpTmClientIconPref::SetMimeTypeL( const TDesC8& aMimeType ) |
|
91 { |
|
92 OstTraceFunctionEntry0( CUPNPTMCLIENTICONPREF_SETMIMETYPEL_ENTRY ); |
|
93 delete iIconMimeType; |
|
94 iIconMimeType = NULL; |
|
95 iIconMimeType = aMimeType.AllocL(); |
|
96 OstTraceFunctionExit0( CUPNPTMCLIENTICONPREF_SETMIMETYPEL_EXIT ); |
|
97 } |
|
98 |
|
99 |
|
100 // End of File |