localisation/apparchitecture/apgrfx/APGPRIV.CPP
branchSymbian3
changeset 57 b8d18c84f71c
parent 6 c108117318cb
equal deleted inserted replaced
56:aa99f2208aad 57:b8d18c84f71c
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
       
    14 // apgpriv.cpp
    14 //
    15 //
    15 
    16 
    16 #include "APGPRIV.H"
    17 #include "APGPRIV.H"
    17 #include <e32hal.h>
    18 #include <e32hal.h>
    18 #include <s32strm.h>
    19 #include <s32strm.h>
    36 	: iAppUid(aAppUid),
    37 	: iAppUid(aAppUid),
    37 	iOriginalSizeInTwips(aIconSizeInTwips),
    38 	iOriginalSizeInTwips(aIconSizeInTwips),
    38 	iScaleFactorWidth(1000),
    39 	iScaleFactorWidth(1000),
    39 	iScaleFactorHeight(1000)
    40 	iScaleFactorHeight(1000)
    40 	{
    41 	{
    41 	__DECLARE_NAME(_S("CApaIconPicture"));
       
    42 	}
    42 	}
    43 
    43 
    44 void CApaIconPicture::ConstructL()
    44 void CApaIconPicture::ConstructL()
    45 	{
    45 	{
    46 	TMachineInfoV1Buf machineInfoBuf;
    46 	TMachineInfoV1Buf machineInfoBuf;
   136 
   136 
   137 TPictureCapability CApaIconPicture::Capability() const
   137 TPictureCapability CApaIconPicture::Capability() const
   138 	{
   138 	{
   139 	return TPictureCapability(TPictureCapability::ENotScaleable,EFalse); // scalable, not cropable
   139 	return TPictureCapability(TPictureCapability::ENotScaleable,EFalse); // scalable, not cropable
   140 	}
   140 	}
       
   141 
       
   142 
       
   143 //
       
   144 // class CApaAppServiceInfoArrayImpl
       
   145 //
       
   146 
       
   147 void CleanupAppServiceArray(TAny* aServiceArray)
       
   148 	{
       
   149 	__ASSERT_DEBUG(aServiceArray, Panic(EPanicNullPointer));
       
   150 	CArrayFixFlat<TApaAppServiceInfo>* serviceArray = static_cast<CArrayFixFlat<TApaAppServiceInfo>*>(aServiceArray);
       
   151 	TInt serviceCount = serviceArray->Count();
       
   152 	if (serviceCount > 0)
       
   153 		{
       
   154 		for (TInt i = serviceCount - 1; i >= 0; i--)
       
   155 			{
       
   156 			(*serviceArray)[i].Release();
       
   157 			}
       
   158 		}
       
   159 	delete serviceArray;
       
   160 	serviceArray = 0;
       
   161 	}
       
   162 
       
   163 CApaAppServiceInfoArrayImpl* CApaAppServiceInfoArrayImpl::NewL(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
       
   164 	{
       
   165 	CApaAppServiceInfoArrayImpl* self = new CApaAppServiceInfoArrayImpl(aServiceInfoArray);
       
   166 	if (!self)
       
   167 		{
       
   168 		CleanupAppServiceArray(aServiceInfoArray);
       
   169 		User::LeaveNoMemory();
       
   170 		}
       
   171 	return self;
       
   172 	}
       
   173 
       
   174 CApaAppServiceInfoArrayImpl::CApaAppServiceInfoArrayImpl(CArrayFix<TApaAppServiceInfo>* aServiceInfoArray)
       
   175 	: iServiceInfoArray(aServiceInfoArray)
       
   176 	{
       
   177 	}
       
   178 
       
   179 CApaAppServiceInfoArrayImpl::~CApaAppServiceInfoArrayImpl()
       
   180 	{
       
   181 	CleanupAppServiceArray(iServiceInfoArray);
       
   182 	iServiceInfoArray = NULL;
       
   183 	}
       
   184 
       
   185 TArray<TApaAppServiceInfo> CApaAppServiceInfoArrayImpl::Array()
       
   186 	{
       
   187 	return iServiceInfoArray->Array();
       
   188 	}
       
   189 
       
   190 
       
   191