DirectPrint/DirectPrintApp/ui/src/directprintsettinglistbox.cpp
author msekine <m.sekine@kthree.co.jp>
Wed, 31 Mar 2010 00:04:55 +0900
branchRCL_3
changeset 12 613a5ff70823
child 15 2275db202402
permissions -rw-r--r--
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)

/*
* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
*
* Contributors:
*
* Description:
*
*/

#include "clog.h"
#include "directprintapp.hrh"
#include "directprintsettinglistbox.h"

CDirectPrintSettingListBox::CDirectPrintSettingListBox()
	{
	}

CDirectPrintSettingListBox::~CDirectPrintSettingListBox()
	{
	}

CDirectPrintSettingListBox* CDirectPrintSettingListBox::NewL(const TRect& aRect)
	{
	CDirectPrintSettingListBox* self = CDirectPrintSettingListBox::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

CDirectPrintSettingListBox* CDirectPrintSettingListBox::NewLC(const TRect& aRect)
	{
	CDirectPrintSettingListBox* self = new(ELeave) CDirectPrintSettingListBox();
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

void CDirectPrintSettingListBox::ConstructL(const TRect& aRect)
	{
	CreateWindowL();
	SetRect(aRect);
	}

void CDirectPrintSettingListBox::EditItemL(TInt aIndex, TBool aCalledFromMenu)
	{
	TBuf<25> beforeText, afterText;
	beforeText.Copy((*SettingItemArray())[aIndex]->SettingTextL());

	CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);

	if (iObserver)
		{
		afterText.Copy((*SettingItemArray())[aIndex]->SettingTextL());
		TBool changed = (beforeText.Compare(afterText) != 0);
		iObserver->HandleEditItemL(aIndex, changed);
		}
	}

void CDirectPrintSettingListBox::SetSettingListObserver(MDirectPrintSettingListObserver* aObserver)
	{
	iObserver = aObserver;
	}