|
1 /* |
|
2 * Copyright (c) 2008-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: Sets brand according service id. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // Include Files |
|
20 #include "telbrandingserverhandler.h" // CTelBrandingServerHandler |
|
21 #include <mbsaccess.h> |
|
22 #include <mbselement.h> |
|
23 #include <cbsfactory.h> |
|
24 #include <cbsbitmap.h> |
|
25 #include <barsread.h> |
|
26 |
|
27 _LIT8( KApplicationId, "xsp" ); |
|
28 _LIT8( KDefaultBrandId, "xsp" ); |
|
29 |
|
30 // Member Functions |
|
31 |
|
32 // --------------------------------------------------------- |
|
33 // CTelBrandingServerHandler::NewL |
|
34 // --------------------------------------------------------- |
|
35 // |
|
36 CTelBrandingServerHandler* CTelBrandingServerHandler::NewLC( |
|
37 const TDesC8& aBrandId ) |
|
38 { |
|
39 CTelBrandingServerHandler* self = |
|
40 new (ELeave) CTelBrandingServerHandler(); |
|
41 |
|
42 CleanupStack::PushL( self ); |
|
43 self->ConstructL( aBrandId ); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------- |
|
48 // CTelBrandingServerHandler::CTelBrandingServerHandler |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 CTelBrandingServerHandler::CTelBrandingServerHandler() : |
|
52 iAccess( NULL ), |
|
53 iFactory( NULL ) |
|
54 { |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------- |
|
58 // CTelBrandingServerHandler::ConstructL |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 void CTelBrandingServerHandler::ConstructL( const TDesC8& aBrandId ) |
|
62 { |
|
63 TInt languageId( ELangInternationalEnglish ); |
|
64 |
|
65 // connect to branding server |
|
66 iFactory = CBSFactory::NewL( |
|
67 KDefaultBrandId, |
|
68 KApplicationId ); |
|
69 |
|
70 |
|
71 // Create access to Branding server |
|
72 iAccess = iFactory->CreateAccessL( aBrandId, |
|
73 TLanguage( languageId ) ); |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------- |
|
77 // CTelBrandingServerHandler::GetBrandIconL |
|
78 // --------------------------------------------------------- |
|
79 // |
|
80 void CTelBrandingServerHandler::GetBrandIconL( |
|
81 const TDesC8& aImageId, |
|
82 CFbsBitmap*& aBitmap, |
|
83 CFbsBitmap*& aBitmask ) const |
|
84 { |
|
85 // Fetch brand image |
|
86 iAccess->GetBitmapL( aImageId, aBitmap, aBitmask ); |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------- |
|
90 // CTelBrandingServerHandler:::~CTelBrandingServerHandler |
|
91 // --------------------------------------------------------- |
|
92 // |
|
93 CTelBrandingServerHandler::~CTelBrandingServerHandler() |
|
94 { |
|
95 if( iAccess ) |
|
96 { |
|
97 iAccess->Close(); |
|
98 } |
|
99 |
|
100 delete iFactory; |
|
101 } |
|
102 |
|
103 |
|
104 |
|
105 // end of file |