vmbx/vmbxengine/src/vmbshandler.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2 * Copyright (c) 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: Implementation of CVmBSHandler class.
       
    15  *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <mbsaccess.h>
       
    20 #include <cbsfactory.h>
       
    21 #include <mbselement.h>
       
    22 #include <cbsbitmap.h>
       
    23 #include <coemain.h>
       
    24 #include <AknsItemID.h>
       
    25 #include <AknsSkinInstance.h>
       
    26 #include <AknsUtils.h>
       
    27 
       
    28 #include "vmsettingsuiiconfileprovider.h"
       
    29 #include "vmbshandler.h"
       
    30 #include "vmbxlogger.h"
       
    31 
       
    32 
       
    33 // CONSTANTS used in VoIP branding, remove/update when branding is handled
       
    34 // Branding server & data constants.
       
    35 //const TInt KVmSettingsUiBrandingIconSize  = 21;         // icon size
       
    36 
       
    37 //_LIT8( KVmSettingsUiBSApplicationId, "xsp" );                 // application id
       
    38 //_LIT8( KVmSettingsUiBSIconId, "service_active_image_small" ); // icon id
       
    39 
       
    40 
       
    41 // ============================ MEMBER FUNCTIONS =============================
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CVmBSHandler::CVmBSHandler
       
    45 // C++ default constructor can NOT contain any code, that might leave.
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CVmBSHandler::CVmBSHandler()
       
    49     {
       
    50     VMBLOGSTRING( "VMBX: CVmBSHandler::CVmBSHandler <=>" );
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 // CVmBSHandler::ConstructL
       
    55 // Symbian 2nd phase constructor can leave.
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 void CVmBSHandler::ConstructL()
       
    59     {
       
    60     VMBLOGSTRING( "VMBX: CVmBSHandler::ConstructL <=>" );
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // CVmBSHandler::NewL
       
    65 // Two-phased constructor.
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 CVmBSHandler* CVmBSHandler::NewL( )
       
    69     {
       
    70     VMBLOGSTRING( "VMBX: CVmBSHandler::NewL =>" );
       
    71     CVmBSHandler* self = CVmBSHandler::NewLC();
       
    72     CleanupStack::Pop( self );
       
    73     VMBLOGSTRING( "VMBX: CVmBSHandler::NewL <=" );
       
    74     return self;
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // CVmBSHandler::NewLC
       
    79 // Two-phased constructor.
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 CVmBSHandler* CVmBSHandler::NewLC()
       
    83     {
       
    84     VMBLOGSTRING( "VMBX: CVmBSHandler::NewLC =>" );
       
    85     CVmBSHandler* self = new (ELeave) CVmBSHandler();
       
    86     CleanupStack::PushL( self );
       
    87     self->ConstructL();
       
    88     VMBLOGSTRING( "VMBX: CVmBSHandler::NewLC =>" );
       
    89     return self;
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // CVmBSHandler::NewLC
       
    94 // Destructor
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 CVmBSHandler::~CVmBSHandler()
       
    98     {
       
    99     VMBLOGSTRING( "VMBX: CVmBSHandler::~CVmBSHandler <=>" );
       
   100     }
       
   101 
       
   102 // Commented out because branding is not supported yet.
       
   103 // ---------------------------------------------------------------------------
       
   104 // CVmBSHandler::GetBrandedIconL
       
   105 // (other items were commented in a header).
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 // void CVmBSHandler::GetBrandedIconL(
       
   109 //     const TDesC8& aBrandingId,
       
   110 //     CFbsBitmap*& aBrandedBitmap,
       
   111 //     CFbsBitmap*& aBrandedBitmapMask ) const
       
   112 //     {
       
   113 //     VMBLOGSTRING( "VMBX: CVmBSHandler::GetBrandedIconL =>" );
       
   114 //     // Create branding server factory and access to branding data.
       
   115 //     CBSFactory* factory = CBSFactory::NewL(
       
   116 //         aBrandingId, KVmSettingsUiBSApplicationId );
       
   117 //     CleanupStack::PushL( factory );
       
   118 //
       
   119 //     MBSAccess* access = factory->CreateAccessL(
       
   120 //         aBrandingId, ELangInternationalEnglish );
       
   121 //     CleanupClosePushL( *access );
       
   122 //
       
   123 //     // Get structure which contains bitmap information.
       
   124 //     MBSElement* element = access->GetStructureL( KVmSettingsUiBSIconId );
       
   125 //     CleanupClosePushL( *element );
       
   126 //     const CBSBitmap& bitmap = element->BitmapDataL();
       
   127 //
       
   128 //     // Open file which contains branded bitmaps.
       
   129 //     RFile file;
       
   130 //     CleanupClosePushL( file );
       
   131 //     access->GetFileL( bitmap.BitmapFileId(), file );
       
   132 //
       
   133 //     // Try to load a skinned bitmap.
       
   134 //     if ( CCoeEnv::Static() )
       
   135 //         {
       
   136 //         TAknsItemID itemId;
       
   137 //         itemId.Set( bitmap.SkinIdMajor(), bitmap.SkinIdMinor() );
       
   138 //         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   139 //         TRAP_IGNORE( ( aBrandedBitmap =
       
   140 //             AknsUtils::CreateBitmapL( skin, itemId ) ) );
       
   141 //         }
       
   142 //
       
   143 //     // If skinned bitmaps was not found, try to load bitmaps manually.
       
   144 //     if ( !aBrandedBitmap )
       
   145 //         {
       
   146 //         CVmSettingsUiIconFileProvider* ifp =
       
   147 //             CVmSettingsUiIconFileProvider::NewL( file );
       
   148 //
       
   149 //         AknIconUtils::CreateIconL(
       
   150 //             aBrandedBitmap,
       
   151 //             aBrandedBitmapMask,
       
   152 //             *ifp,
       
   153 //             bitmap.BitmapId(),
       
   154 //             bitmap.BitmapMaskId() );
       
   155 //          }
       
   156 //
       
   157 //     // Set sizes.
       
   158 //     const TInt iconSize( KVmSettingsUiBrandingIconSize );
       
   159 //     AknIconUtils::SetSize( aBrandedBitmap, TSize( iconSize, iconSize ) );
       
   160 //     AknIconUtils::SetSize( aBrandedBitmapMask, TSize( iconSize, iconSize ) );
       
   161 //
       
   162 //     // Destroy some items.
       
   163 //     CleanupStack::PopAndDestroy( &file );
       
   164 //     CleanupStack::PopAndDestroy( element );
       
   165 //     CleanupStack::PopAndDestroy( access );
       
   166 //     CleanupStack::PopAndDestroy( factory );
       
   167 //     VMBLOGSTRING( "VMBX: CVmBSHandler::GetBrandedIconL <=" );
       
   168 //     }
       
   169 
       
   170 //  End of File