resourcepool/src/alfresourcepool.cpp
branchRCL_3
changeset 25 4ea6f81c838a
parent 23 514d98f21c43
child 26 0e9bb658ef58
equal deleted inserted replaced
23:514d98f21c43 25:4ea6f81c838a
     1 /*
       
     2 * Copyright (c) 2008 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:  API for handling alf graphic resources
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "alf/alfresourcepool.h"
       
    20 #include "alfresourcepoolimpl.h"
       
    21 
       
    22 #include <osn/osnnew.h>
       
    23 
       
    24 namespace Alf 
       
    25 {
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // ?description_if_needed
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 OSN_EXPORT ResourcePool::ResourcePool( 
       
    34     CAlfTextureManager& aTextureManager,
       
    35     ResourcePool* aParentPool ) 
       
    36     : mResourcePoolImpl( 
       
    37         new (EMM) ResourcePoolImpl( aTextureManager, aParentPool ) )
       
    38     {
       
    39     }
       
    40 
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // ?description_if_needed
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 OSN_EXPORT ResourcePool::~ResourcePool()
       
    47     {
       
    48     }
       
    49 
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // ?implementation_description
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 OSN_EXPORT void ResourcePool::createLogicalImageResource( const Utf8* aTag )
       
    56     {
       
    57     mResourcePoolImpl->createLogicalImageResource( aTag );
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // ?implementation_description
       
    62 // ---------------------------------------------------------------------------
       
    63 //    
       
    64 OSN_EXPORT void ResourcePool::createThemeImageResource( 
       
    65         const Utf8* aTag,
       
    66         const UString& aThemeDefinition )
       
    67     {
       
    68     mResourcePoolImpl->createThemeImageResource( 
       
    69         aTag,
       
    70         aThemeDefinition );
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // ?implementation_description
       
    75 // ---------------------------------------------------------------------------
       
    76 //    
       
    77 OSN_EXPORT void ResourcePool::createFileImageResource( 
       
    78         const Utf8* aTag,
       
    79         const UString& aFileName ,
       
    80         TAlfTextureFlags aFlag)
       
    81     {
       
    82     mResourcePoolImpl->createFileImageResource( aTag, aFileName, aFlag);
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // ?implementation_description
       
    87 // ---------------------------------------------------------------------------
       
    88 //    
       
    89 OSN_EXPORT void ResourcePool::deleteImageResource( const Utf8* aTag )
       
    90     {
       
    91     mResourcePoolImpl->deleteImageResource( aTag );
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // ?implementation_description
       
    96 // ---------------------------------------------------------------------------
       
    97 //    
       
    98 OSN_EXPORT bool ResourcePool::hasImageResource( const Utf8* aTag ) const
       
    99     {
       
   100     return mResourcePoolImpl->hasImageResource( aTag );
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // ?implementation_description
       
   105 // ---------------------------------------------------------------------------
       
   106 //    
       
   107 OSN_EXPORT void ResourcePool::setInitialSize( 
       
   108     const Utf8* aTag, 
       
   109     const TAlfXYMetric& aInitialSizeHint )
       
   110     {
       
   111     mResourcePoolImpl->setInitialSize( aTag, aInitialSizeHint);
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // ?implementation_description
       
   116 // ---------------------------------------------------------------------------
       
   117 //     
       
   118 OSN_EXPORT void ResourcePool::setAspectRatio( 
       
   119         const Utf8* aTag, 
       
   120         AspectRatio aAspectRatio )
       
   121     {
       
   122     mResourcePoolImpl->setAspectRatio( aTag, aAspectRatio);
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // ?implementation_description
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 OSN_EXPORT TAlfImage ResourcePool::getImageResource( 
       
   130     const Utf8* aTag )
       
   131     {
       
   132     return mResourcePoolImpl->getImageResource( aTag );
       
   133     }
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // ?implementation_description
       
   137 // ---------------------------------------------------------------------------
       
   138 //
       
   139 OSN_EXPORT TAlfImage ResourcePool::getImageResource( 
       
   140     const Utf8* aTag, 
       
   141     const TAlfXYMetric& aSizeHint )
       
   142     {
       
   143     return mResourcePoolImpl->getImageResource( aTag, aSizeHint );
       
   144     }
       
   145 
       
   146 
       
   147 } // namespace Alf