亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? telbookcontainer.cpp

?? symbian系統上的記事本程序
?? CPP
字號:
/*
* ============================================================================
*  Name     : CTelBookContainer from CCoeControl, MCoeControlObserver
*  Part of  : Hello
*  Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES


#include <EveryDay.rsg>
#include "EveryDay.hrh"
#include "TelBookContainer.h"
#include <aknnotewrappers.h>
#include <eikclbd.h>
#include <eiklabel.h>  // for example label control
#include <barsread.h>  // for resource reader
#include <eikedwin.h>  // for CEikEdwin
#include <eikgted.h>   // for CEikGlobalTextEditor
#include <aknselectionlist.h>	//for CAknSelectionListDialog
#include <AknQueryDialog.h>		//for CAknQueryDialog
#include <eikmenub.h>
#include <aknlists.h>		//for CAknSingleNumberStyleListBox
#include <StringLoader.h>	//for StringLoader
#include <AknIconArray.h>	//for CAknIconArray
#include "EveryDayAppUi.h"
#include "PHKServerBookEngine.h"


// ================= MEMBER FUNCTIONS =======================

// C++ default constructor can NOT contain any code, that
// might leave.
//
CTelBookContainer::CTelBookContainer()
{
	m_pListBox = NULL;
	m_pSearchBox = NULL;
	m_pListBoxArray = NULL;
}

// EPOC default constructor can leave.
void CTelBookContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();
	
    SetRect(aRect);
	MakeListBoxL();//界面
    ActivateL();
}

// Destructor
CTelBookContainer::~CTelBookContainer()
{
	if (m_pListBox)
	{
		delete m_pListBox;
		m_pListBox = NULL;
	}
	if (m_pSearchBox)
	{
		delete m_pSearchBox;
		m_pSearchBox = NULL;
	}
	if (m_pListBoxArray)
	{
		//	m_pListBoxArray->Reset();
		delete m_pListBoxArray;
		m_pListBoxArray = NULL;
	}
}

// ---------------------------------------------------------
// CTelBookContainer::FocusTo(TInt aCommand)
// Change foccused control.
// (other items were commented in a header).
// ---------------------------------------------------------
//

void CTelBookContainer::FocusTo(TInt aCommand)
{
}

// ---------------------------------------------------------
// CTelBookContainer::SizeChanged()
// Called by framework when the view size is changed
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CTelBookContainer::SizeChanged()
{
	if (m_pListBox)
    {
        if (m_pSearchBox)
        {
			CAknSingleNumberStyleListBox* aknListBox = STATIC_CAST(CAknSingleNumberStyleListBox*,
				m_pListBox);
			AknFind::HandleFixedFindSizeChanged(this, aknListBox, m_pSearchBox);			
        }
        else
        {
            m_pListBox->SetRect(Rect()); // Sets rectangle of lstbox.
		}
    }
}

// ---------------------------------------------------------
// CTelBookContainer::CountComponentControls() const
// (other items were commented in a header).
// ---------------------------------------------------------
//
TInt CTelBookContainer::CountComponentControls() const
{
	if(m_pListBox && m_pSearchBox)              //
	{
		return 2;
	}
	else
	{
		return 0;
	} 
}

// ---------------------------------------------------------
// CTelBookContainer::ComponentControl(TInt aIndex) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
CCoeControl* CTelBookContainer::ComponentControl(TInt aIndex) const
{
	if(m_pSearchBox && aIndex)
	{
		return m_pSearchBox;
	}	
	else
	{
		return m_pListBox;
	}	
}

// ---------------------------------------------------------
// CTelBookContainer::Draw(const TRect& aRect) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CTelBookContainer::Draw(const TRect& aRect) const
{
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbWhite);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
}

// ---------------------------------------------------------
// CTelBookContainer::OfferKeyEventL(...)
// Notify key events to editors.
// (other items were commented in a header).
// ---------------------------------------------------------
//
TKeyResponse CTelBookContainer::OfferKeyEventL(
											   const TKeyEvent& aKeyEvent, TEventCode aType)
{
	TKeyResponse Ret = EKeyWasNotConsumed;	
	
	switch (aKeyEvent.iCode)
	{
	case EKeyDevice3:
		break;
	default:
		if(m_pListBox)
		{
			if ( m_pSearchBox )
			{
				TBool needRefresh( EFalse );
				
				// Offers the key event to find box.
				if ( AknFind::HandleFindOfferKeyEventL( aKeyEvent, aType, this,
					m_pListBox, m_pSearchBox,
					EFalse,
					needRefresh ) ==
					EKeyWasConsumed )
				{
					if ( needRefresh )
					{
						SizeChanged();
						DrawNow();
					}
					
					return EKeyWasConsumed;
				}
			}
            
			Ret = m_pListBox->OfferKeyEventL(aKeyEvent, aType);
		}
		break;
	}
	
	return Ret;
	
}


// ---------------------------------------------------------
// CTelBookContainer::HandleControlEventL(
//     CCoeControl* aControl,TCoeEvent aEventType)
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CTelBookContainer::HandleControlEventL(
											CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
	
}

TInt CTelBookContainer::GetSelectedIndexL()	//hahaha
{
	
	TInt Ret(-1);
	if(m_pListBox)
	{
		TInt CurrItemInd = m_pListBox->CurrentItemIndex();
		CAknFilteredTextListBoxModel* model =
			STATIC_CAST(CAknFilteredTextListBoxModel*,m_pListBox->Model());		
		if(model && CurrItemInd >= 0)
		{	
			Ret = model->Filter()->FilteredItemIndex(CurrItemInd);	//It is used to fetch the content of a list item after filter has been used
		}				//Tests if cache cleanup should be performed on a message entry.
	}
	return Ret;
}
void CTelBookContainer::HandleResourceChange(TInt aType)
{
	TRect rect;
	
    if ( aType==KEikDynamicLayoutVariantSwitch )
    {   
		CWsScreenDevice* ws = CEikonEnv::Static()->ScreenDevice(); 
		rect = ws->SizeInPixels();
        SetRect(rect);
    }
	CCoeControl::HandleResourceChange(aType);
}


void CTelBookContainer::UpdateScrollBar(CAknSingleNumberStyleListBox* aListBox)
{
    if (aListBox)
	{   
        TInt pos(aListBox->View()->CurrentItemIndex());
        if (aListBox->ScrollBarFrame())
		{
            aListBox->ScrollBarFrame()->MoveVertThumbTo(pos);
		}
	}
}


CAknSearchField* CTelBookContainer::CreateFindBoxL(CAknSingleNumberStyleListBox* aListBox,
												   CTextListBoxModel* aModel, CAknSearchField::TSearchFieldStyle aStyle)
{
    CAknSearchField* findbox = NULL;
	
    if (aListBox && aModel)
	{
        // Gets pointer of CAknFilteredTextListBoxModel.
        CAknFilteredTextListBoxModel* model =
			STATIC_CAST( CAknFilteredTextListBoxModel*, aModel );
        // Creates FindBox.
        findbox = CAknSearchField::NewL( *this, aStyle, NULL, 20);
        CleanupStack::PushL(findbox);
        // Creates CAknListBoxFilterItems class.
        model->CreateFilterL( aListBox, findbox );
        //Filter can get by model->Filter();
        CleanupStack::Pop(findbox); // findbox
	}
	
    return findbox;
}


void CTelBookContainer::MakeListBoxL()
{
	TInt MySetIndex(0);
	
	if(m_pListBox)
	{
		MySetIndex = GetSelectedIndexL();
	}
	
	TResourceReader rReader;
	iCoeEnv->CreateResourceReaderLC(rReader, R_CARDLIST_LISTBOX);
    m_pListBox   = new( ELeave ) CAknSingleNumberStyleListBox;
	m_pListBox->SetContainerWindowL(*this);
	m_pListBox->ConstructFromResourceL(rReader);
	CleanupStack::PopAndDestroy();
	
	//無名片時顯示(無名片)
	ShowNoCard();
	
	CArrayPtr<CGulIcon>* icons = new( ELeave ) CAknIconArray(2);
	CleanupStack::PushL(icons);
	CEveryDayAppUi* pApp = (CEveryDayAppUi*)CEikonEnv::Static()->AppUi();
	icons->AppendL(pApp->LoadGraphicsL(9));
	CleanupStack::Pop(icons);
	
	m_pListBox->ItemDrawer()->ColumnData()->SetIconArray(icons);
	m_pListBoxArray = new (ELeave) CDesCArrayFlat (10);
	
	// get Model
	CTextListBoxModel* model = m_pListBox->Model();
	// setItemTextArray
	model->SetItemTextArray( m_pListBoxArray );
	// setOwnershipType NotOwn
	model->SetOwnershipType(ELbmDoesNotOwnItemArray);
	
	
	m_pListBox->CreateScrollBarFrameL( ETrue );
    m_pListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
		CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
	
	m_pListBox->SetRect(Rect());
	
	m_pSearchBox = CreateFindBoxL(m_pListBox, m_pListBox->Model(),
		CAknSearchField::ESearch);
	SizeChanged();
	
	m_pListBox->ActivateL();
	
	TInt ItemsCount = m_pListBox->Model()->ItemTextArray()->MdcaCount();
	
	if(ItemsCount > MySetIndex && MySetIndex >= 0)
		m_pListBox->SetCurrentItemIndex(MySetIndex);
	else if(ItemsCount > 0)
		m_pListBox->SetCurrentItemIndex(0);
	
	UpdateScrollBar(m_pListBox);
}


void CTelBookContainer::SetItemToListBox (RPointerArray<CBookInfo>& aBookInfo)
{
	// 	m_pListBox->DrawNow();
	
	m_pListBoxArray->Reset();
	TInt i = 0;		
	for (i = 0; i < aBookInfo.Count(); i++)
	{
		TBuf<KMaxPath> szTemp;
		szTemp.Copy(_L("\t"));
		HBufC * sNameBuf = NULL;
		
		sNameBuf = aBookInfo[i]->GetLastName();
		// 判斷是否為空
		if (sNameBuf != NULL)
		{
			szTemp.Append(sNameBuf->Des());
		}
		sNameBuf = aBookInfo[i]->GetFirstName();
		if (sNameBuf != NULL)
		{
			szTemp.Append(sNameBuf->Des());
		}
		if ((aBookInfo[i]->GetLastName()==NULL) && (aBookInfo[i]->GetFirstName()==NULL))	
		{
			szTemp.Copy(_L("\t"));
			TBuf<32> szNoName;
			StringLoader::Load(szNoName, R_QTN_IM_PBMAIN_NAME);
			szTemp.Append(szNoName);
		}
		
		//		iEikonEnv->InfoMsg(szTemp);
		m_pListBoxArray->AppendL(szTemp);
	}
	m_pListBox->HandleItemAdditionL();
	
}



void CTelBookContainer::GetDeleteResult (TInt & anResult)
{
	// querDialog
	CAknQueryDialog* pdialog = CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
	
	TBuf <32>szTemp;
	StringLoader::Load(szTemp, R_QTN_IM_PBDELETE_NAME);
	
	szTemp.Append(_L("\n"));
	
	TBuf <KMaxName> sInfo;
	sInfo.Copy(m_pListBox->Model()->ItemText(m_pListBox->CurrentItemIndex()));
	sInfo.TrimLeft();
	szTemp.Append(sInfo);
	szTemp.Append(_L("?"));
	pdialog->SetPromptL(szTemp);
	anResult = pdialog->ExecuteLD( R_QTN_PROMPT_DIALOG1);
}


void CTelBookContainer::ShowNoCard()
{
	//無名片時顯示(無名片)
	TBuf<32> szNoCard;
	StringLoader::Load(szNoCard, R_QTN_IM_PBMAIN_PB);
	m_pListBox->View()->SetListEmptyTextL(szNoCard);
}

void CTelBookContainer::GetListNum(TInt& anum)
{
	anum = m_pListBox->CurrentItemIndex();
}
void CTelBookContainer::HandleMarkCommandL(TInt aCommand)
{
    if (m_pListBox)
    {
        AknSelectionService::HandleMarkableListProcessCommandL (aCommand, m_pListBox);
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品在线一区二区| 99精品久久只有精品| 精彩视频一区二区三区| 不卡一区中文字幕| 日韩一区国产二区欧美三区| 国产精品日产欧美久久久久| 亚洲不卡一区二区三区| 成人国产精品免费网站| 免费人成黄页网站在线一区二区| 国产福利一区在线| 欧美一级夜夜爽| 亚洲免费观看高清完整版在线| 精品制服美女久久| 337p亚洲精品色噜噜狠狠| 18成人在线观看| 国产sm精品调教视频网站| 日韩欧美一区二区免费| 日韩午夜激情视频| 亚洲va欧美va天堂v国产综合| zzijzzij亚洲日本少妇熟睡| 久久综合九色欧美综合狠狠| 亚洲高清免费观看高清完整版在线观看| 国产精品一区二区三区网站| 8x8x8国产精品| 一区二区日韩电影| 91免费视频网址| 国产亚洲精品aa| 国产女同性恋一区二区| 精品一区二区三区免费视频| 欧美一区二区在线免费播放| 日韩中文字幕亚洲一区二区va在线| av不卡在线播放| 中文在线一区二区| 国产麻豆欧美日韩一区| 久久综合色8888| 久久99久久99| 精品国产自在久精品国产| 久久久激情视频| 国产精品中文字幕日韩精品| 久久综合成人精品亚洲另类欧美| 九九精品一区二区| 久久久99久久| 成人激情小说网站| 亚洲视频一区二区在线| 国产不卡在线播放| 欧美经典一区二区三区| 丁香网亚洲国际| 成人免费在线视频| 欧美色倩网站大全免费| 首页国产丝袜综合| 欧美videofree性高清杂交| 国产在线视视频有精品| 久久综合久久综合久久| 成人高清免费观看| 玉米视频成人免费看| 欧美日韩亚洲另类| 热久久免费视频| 国产婷婷色一区二区三区四区| av在线不卡免费看| 亚洲国产一二三| 日韩一区二区影院| 国产精品99久久久久| 亚洲欧美乱综合| 91精品国产欧美一区二区成人| 黑人巨大精品欧美黑白配亚洲| 亚洲国产精品高清| 欧美日韩国产综合一区二区三区| 久久99日本精品| 国产精品免费久久| 欧美日韩国产大片| 国产精品正在播放| 亚洲一二三专区| 久久亚洲一区二区三区明星换脸| 91免费国产视频网站| 免费观看一级欧美片| 国产精品乱人伦一区二区| 欧美男女性生活在线直播观看| 中文一区二区完整视频在线观看| 色综合久久综合中文综合网| 老司机精品视频一区二区三区| 中文字幕在线一区免费| 欧美成人精品高清在线播放| 亚洲自拍偷拍图区| 久久这里只精品最新地址| 91蜜桃传媒精品久久久一区二区| 麻豆91在线播放免费| 亚洲精品免费看| 久久亚洲免费视频| 欧美日韩成人综合天天影院| 国产精品亚洲午夜一区二区三区| 午夜精品在线视频一区| 日韩一区欧美一区| 国产69精品久久777的优势| 亚洲黄一区二区三区| 久久嫩草精品久久久精品| 99在线精品观看| 精品一区二区日韩| 午夜日韩在线电影| 亚洲视频一二区| 国产欧美视频一区二区三区| 日韩精品一区二区三区中文不卡 | 欧美中文字幕一区二区三区亚洲| 麻豆精品一二三| 亚洲另类在线制服丝袜| 亚洲国产岛国毛片在线| 日韩精品一区二区三区视频在线观看 | 欧美在线三级电影| 国产丶欧美丶日本不卡视频| 亚洲午夜精品网| 国产精品女同一区二区三区| 精品国产麻豆免费人成网站| 欧美系列日韩一区| 欧美伊人精品成人久久综合97 | 激情六月婷婷久久| 日韩黄色免费电影| 日本中文在线一区| 日日摸夜夜添夜夜添精品视频| 亚洲综合久久久| 亚洲第一综合色| 亚洲成人动漫精品| 丝袜a∨在线一区二区三区不卡| 中文字幕亚洲一区二区va在线| 国产日本欧洲亚洲| 国产校园另类小说区| 欧美经典一区二区三区| 中文字幕在线观看不卡视频| 亚洲欧洲av另类| 亚洲美女一区二区三区| 亚洲一级二级三级| 青青草国产精品亚洲专区无| 日韩高清在线电影| 日韩高清一级片| 老司机一区二区| 国产高清不卡二三区| 91最新地址在线播放| 色综合天天综合网天天看片 | 精品系列免费在线观看| 麻豆高清免费国产一区| 国产99久久久精品| 99精品欧美一区二区三区综合在线| 91国偷自产一区二区使用方法| 欧美日韩一区在线| 欧美一区二区三区四区五区| 欧美成人综合网站| 国产精品你懂的| 三级久久三级久久久| 精品在线一区二区| 97久久人人超碰| 欧美一级欧美三级| 国产精品三级视频| 亚洲一区二区欧美| 狠狠色丁香久久婷婷综合丁香| 91在线视频网址| 91精品国产高清一区二区三区蜜臀| 久久蜜臀精品av| 亚洲另类在线视频| 韩日av一区二区| 97se亚洲国产综合自在线不卡| 九九**精品视频免费播放| 91在线精品一区二区| 日韩一区二区三区在线观看| 久久久精品tv| 亚洲美女屁股眼交| 激情综合五月天| 亚洲欧美一区二区三区久本道91 | 精品中文字幕一区二区小辣椒| 国产一区二区三区视频在线播放| 97久久超碰国产精品| 精品成人一区二区三区四区| 亚洲精品日产精品乱码不卡| 国产在线国偷精品免费看| 欧美在线综合视频| 精品国产凹凸成av人导航| 亚洲免费观看高清在线观看| 日韩国产在线观看一区| 91蜜桃在线免费视频| 久久久www成人免费无遮挡大片| 午夜私人影院久久久久| eeuss鲁片一区二区三区在线观看| 欧美精品九九99久久| 《视频一区视频二区| 激情五月激情综合网| 欧美日韩免费电影| 一区二区三区不卡视频在线观看 | 亚洲第一综合色| 一本色道久久综合亚洲91| 久久久噜噜噜久久人人看 | 国产精品一线二线三线精华| 欧美人狂配大交3d怪物一区| 中文字幕制服丝袜一区二区三区 | 9i看片成人免费高清| 欧美不卡激情三级在线观看| 首页国产丝袜综合| 欧美三级日韩三级国产三级| 亚洲国产成人私人影院tom| 精品一区二区免费在线观看| 日韩一级欧美一级| 男女男精品视频网| 欧美精品日韩一区| 丝袜诱惑制服诱惑色一区在线观看|