DirectPrint/DirectPrintApp/engine/src/directprinttintcapability.cpp
branchRCL_3
changeset 12 613a5ff70823
child 15 2275db202402
equal deleted inserted replaced
8:3f1fec088555 12:613a5ff70823
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * {Description of the file}
       
    16 *
       
    17 */
       
    18 
       
    19 // System include files
       
    20 #include <stringloader.h>
       
    21 #include <akntextsettingpage.h>
       
    22 #include <DirectPrintApp.rsg>
       
    23 
       
    24 #include "directprinttintcapability.h"
       
    25 
       
    26 const TInt KMaxTIntCharNum( 11 );
       
    27 
       
    28 // Destructor
       
    29 CDirectPrintTIntCapability::~CDirectPrintTIntCapability()
       
    30     {
       
    31     }
       
    32 
       
    33 // Creates text string for the settings list box
       
    34 HBufC* CDirectPrintTIntCapability::ListBoxTextL()
       
    35     {
       
    36     const TInt KGranularity( 4 );
       
    37     TBuf<KMaxTIntCharNum> numStr;
       
    38     numStr.Zero();
       
    39     numStr.AppendNum( iValue );
       
    40 
       
    41     CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( KGranularity );
       
    42     CleanupStack::PushL( strings );
       
    43     strings->AppendL( iTitle );
       
    44     strings->AppendL( numStr );
       
    45 
       
    46     HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
       
    47     CleanupStack::PopAndDestroy();  // strings
       
    48 
       
    49     return buf;
       
    50     }
       
    51 
       
    52 // Clones itself
       
    53 CDirectPrintBaseCapability* CDirectPrintTIntCapability::CloneL()
       
    54     {
       
    55     CDirectPrintTIntCapability* clone = new ( ELeave ) CDirectPrintTIntCapability;
       
    56 
       
    57     clone->iIndexOnList = iIndexOnList;
       
    58     clone->iMax = iMax;
       
    59     clone->iMin = iMin;
       
    60     clone->iTitle = iTitle;
       
    61     clone->iUid = iUid;
       
    62     clone->iValue = iValue;
       
    63 
       
    64     return clone;
       
    65     }
       
    66 
       
    67 // Creates setting item for the settings list box
       
    68 CAknSettingItem* CDirectPrintTIntCapability::SettingItemLC(TInt aIndex)
       
    69 	{
       
    70 	CAknIntegerEdwinSettingItem* item = new (ELeave) CAknIntegerEdwinSettingItem(aIndex, iValue);
       
    71 	CleanupStack::PushL(item);
       
    72 	item->ConstructL(EFalse, aIndex, iTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
       
    73 
       
    74 	return item;
       
    75 	}
       
    76 
       
    77 //  End of File