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

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

?? contactviews.cpp

?? Symbain mobile code 手機應用程序源代碼--引
?? CPP
字號:
// ContactViews.cpp
//
// Copyright (c) 2005 Symbian Software Ltd.  All rights reserved.
//
//
//
///////////////////////////////////////////////////////////////////////
//
// Find and filtered views 
// -----------------------
//
// This example demonstrates CContactFindView and CContactFilteredView
//
//__________________________________________________________________
//
// This code creates a contact database, "exampleViews.cdb", adds an item 
// to it containing four fields, then uses a find view and filtered view 
// to search/filter the database. The contents of all matching items are 
// printed to the console.
////////////////////////////////////////////////////////////////////////


#include <e32base.h>
#include <e32cons.h>
#include <cntdb.h>
#include <cntitem.h>
#include <cntfield.h>
#include <cntfldst.h>
// User include
#include "ContactViews.h"

// stores the total number of views created in the example
const TInt KTotalViews = 3;
 
LOCAL_D CConsoleBase* console;
// name of contact database to be created
_LIT(KContactsFilename,"c:exampleViews.cdb");
// pointer to the database
LOCAL_C CContactDatabase* db;

CExampleViews* CExampleViews::NewL(CContactDatabase& aDb)
	{
	CExampleViews* self=new(ELeave) CExampleViews(aDb);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::Pop();
	return self;
	}

CExampleViews::~CExampleViews()
	{
	if (iFilterView!=NULL) 
		{
		iFilterView->Close(*this);	
		}
	if (iFindView!=NULL) 
		{
		iFindView->Close(*this);	
		}
	if (iLocalView!=NULL)
		{
		iLocalView->Close(*this);	
		}
	iSortOrder.Close();
	}
	

CExampleViews::CExampleViews(CContactDatabase& aDb)
:	CActive(EPriorityStandard),	iDb(aDb) {}

void CExampleViews::ConstructL()
	{
	// iSortOrder defines the fields that are used in the view
	iSortOrder.AppendL(KUidContactFieldGivenName);
	iSortOrder.AppendL(KUidContactFieldFamilyName);
	iSortOrder.AppendL(KUidContactFieldPhoneNumber);
	iSortOrder.AppendL(KUidContactFieldEMail);
	CActiveScheduler::Add(this);
	}

// Handles the active object抯 request completion event.
void CExampleViews::RunL()
	{
	iLocalView=CContactLocalView::NewL(*this,iDb,iSortOrder,EContactsOnly);
	// creates the search string for the find view
	CPtrCArray* desArray =new (ELeave) CPtrCArray(1);
	_LIT(KSearchString,"Smith");
    TPtrC searchString(KSearchString);
	desArray->AppendL(searchString);
	// Creates a find view based on the local view
	iFindView = CContactFindView::NewL(iDb, *iLocalView,*this, desArray);
	desArray->Reset();
    delete desArray;
    // Creates a filtered view based on the local view
    // Filters out items without a telephone number
	iFilterView = CContactFilteredView::NewL(*this, iDb, *iLocalView, CContactDatabase::EPhonable);
	}

// invoked by the active object mechanism
void CExampleViews::HandleContactViewEvent(const CContactViewBase& aView,const TContactViewEvent& aEvent)
 	{
	if (aEvent.iEventType==TContactViewEvent::EReady)
		{
		iNumViewsCreated++;
		if (&aView == iFindView)
		// find view is ready to be used
			{
			_LIT(KConsoleMessage,"Contents of find view:\n");
			console->Printf(KConsoleMessage);			
			for (TInt count = 0; count < iFindView->CountL(); count++)
				{
				// prints out contents of all fields for all items in the find view
				_LIT(KFieldSeparator,",");
				HBufC* text = iFindView->AllFieldsLC(count,KFieldSeparator);
				_LIT(KConsoleMessage2,"%S\n");
				console->Printf(KConsoleMessage2,text);
				CleanupStack::PopAndDestroy(); // text
				}
			}
		else if (&aView == iFilterView)
		// filter view is ready	
			{
			_LIT(KConsoleMessage,"Contents of filter view:\n");
			console->Printf(KConsoleMessage);
			for (TInt count = 0; count < iFilterView->CountL(); count++)
				{
				// prints out contents of all fields for all items in the filter view
				_LIT(KFieldSeparator,",");
				HBufC* text = iFilterView->AllFieldsLC(count,KFieldSeparator);
				_LIT(KConsoleMessage2,"%S\n");
				console->Printf(KConsoleMessage2,text);
				CleanupStack::PopAndDestroy(); // text
				}
			}
		// if all three views have been created, stop the active scheduler
		if (iNumViewsCreated == KTotalViews)
			{
			CActiveScheduler::Stop();
			}
		}
	}
	
	
void CExampleViews::DoCancel()
	{
	//empty implementation.
	}

void CExampleViews::Start()
	{
	TRequestStatus *pS=&iStatus;
	User::RequestComplete(pS,KErrNone);
	SetActive();
	}


LOCAL_C void CreateExampleViewL()
// Create the example views
	{
	CExampleViews *exampleViews = CExampleViews::NewL(*db);
	CleanupStack::PushL(exampleViews);
	exampleViews->Start();
	CActiveScheduler::Start();
	CleanupStack::PopAndDestroy(exampleViews);
	// close and cleanup database
	delete db;
	db=NULL;
	}

// Adds a contact item to the contact database. 
LOCAL_C void AddEntryL()
	{
	_LIT(KForename,"John"); 
	_LIT(KSurname,"Smith"); 
	_LIT(KPhoneNumber,"+441617779700"); 
	_LIT(KEmailAddress,"john.smith@symbian.com"); 
	
	// Create a  contact card to contain the data
	CContactCard* newCard = CContactCard::NewLC();
    
	// Create the firstName field and add the data to it
	CContactItemField* firstName = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldGivenName);
	firstName->TextStorage()->SetTextL(KForename);
	newCard->AddFieldL(*firstName);
  	CleanupStack::Pop(firstName);
  	
	// Create the lastName field and add the data to it
   	CContactItemField* lastName= CContactItemField::NewLC(KStorageTypeText, KUidContactFieldFamilyName);
  	lastName ->TextStorage()->SetTextL(KSurname);
  	newCard->AddFieldL(*lastName);
  	CleanupStack::Pop(lastName);
  	
	// Create the emailAddress field and add the data to it
	CContactItemField* emailAddr = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldEMail);
	emailAddr->SetMapping(KUidContactFieldVCardMapEMAILINTERNET);
  	emailAddr ->TextStorage()->SetTextL(KEmailAddress);
  	newCard->AddFieldL(*emailAddr);
  	CleanupStack::Pop(emailAddr);
    	
	// Create the phoneNo field and add the data to it
  	CContactItemField* phoneNumber = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldPhoneNumber);
	phoneNumber->SetMapping(KUidContactFieldVCardMapTEL);
	phoneNumber ->TextStorage()->SetTextL(KPhoneNumber);
	newCard->AddFieldL(*phoneNumber);
  	CleanupStack::Pop(phoneNumber);
	
	// Add newCard to the database
    const TContactItemId contactId = db->AddNewContactL(*newCard);
  	CleanupStack::PopAndDestroy(newCard);
	}


// Creates the contact database and opens it
LOCAL_C void CreateDatabaseL()
	{
	TRAPD(err,db=CContactDatabase::ReplaceL(KContactsFilename));
         
	// Checks if the database was created successfully
	// if not, exits with an error message.
	
	if(err!=KErrNone)
		{
		_LIT(KConsoleMessage,"Not able to create the database"); 
		// Failed to create the database
		console->Printf(KConsoleMessage);
		User::Leave(err);
		}
	else
		{
		_LIT(KConsoleMessage,"Successfully created the database\n"); 
		console->Printf(KConsoleMessage);
		// Add a contact entry to the database
		AddEntryL();
		
		}
	}


LOCAL_C void DoExampleL()
	{
	_LIT(KTxtConsoleTitle,"Contact views example");
	// Create a console
	console = Console::NewL(KTxtConsoleTitle,TSize(KConsFullScreen,KConsFullScreen));
	CleanupStack::PushL(console);
	
	// Create the database 
   	CreateDatabaseL();
   	
   	// Create the views
	CreateExampleViewL();
   	    
	// wait for user to press a key before destroying console
 	_LIT(KMsgPressAnyKey,"Press any key to continue\n\n");
	console->Printf(KMsgPressAnyKey);
 	console->Getch();
	CleanupStack::PopAndDestroy(console);
 	}

// Standard entry point function
GLDEF_C TInt E32Main()
	{
	__UHEAP_MARK;
	// Active scheduler required as this is a console app
	CActiveScheduler* scheduler=new CActiveScheduler;

	// If active scheduler has been created, install it.
	if (scheduler)
		{
		CActiveScheduler::Install(scheduler); 
		// Cleanup stack needed
		CTrapCleanup* cleanup=CTrapCleanup::New();
		if (cleanup)
			{
            // Call the function DoExampleL()
		    TRAP_IGNORE(DoExampleL());
			delete cleanup;
			}
		delete scheduler;
		}

	__UHEAP_MARKEND;
	return KErrNone;
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
9人人澡人人爽人人精品| 欧美午夜理伦三级在线观看| 亚洲欧美乱综合| 国产精品久久久久aaaa樱花 | 成人美女视频在线看| 青青青伊人色综合久久| 奇米精品一区二区三区在线观看一 | 美洲天堂一区二卡三卡四卡视频| 亚洲小说欧美激情另类| 亚洲一区二区视频| 国产精品一区二区不卡| 国产一区二区三区四| 国产福利视频一区二区三区| 高清国产一区二区三区| 舔着乳尖日韩一区| 奇米影视一区二区三区小说| 日韩成人av影视| 久久91精品国产91久久小草 | 久久久久久久久久看片| 久久久不卡影院| 国产精品视频线看| 亚洲女人小视频在线观看| 亚洲一区中文日韩| 日韩精品亚洲一区二区三区免费| 蜜臀av性久久久久av蜜臀妖精| 精品一区二区免费视频| 国产成人av网站| 91久久一区二区| 欧美一级生活片| 亚洲国产精品av| 懂色av一区二区三区免费看| 成人在线一区二区三区| 欧美日韩三级一区| 中文字幕一区二区三区四区| 国产精品女主播av| 亚洲免费资源在线播放| 日韩国产精品91| 成人教育av在线| 8v天堂国产在线一区二区| 久久精品一区二区三区av| 亚洲黄色片在线观看| 免费美女久久99| 9人人澡人人爽人人精品| 欧美一区二区三区婷婷月色 | 久久国产成人午夜av影院| 成人va在线观看| 3d成人动漫网站| 中文字幕亚洲一区二区av在线 | 日韩理论在线观看| 亚洲一区二区三区四区在线观看| 蜜桃视频第一区免费观看| 97久久精品人人爽人人爽蜜臀| 717成人午夜免费福利电影| 日韩成人免费电影| 91亚洲资源网| 久久精品在线观看| 奇米精品一区二区三区四区| 色先锋aa成人| 国产精品无遮挡| 国产揄拍国内精品对白| 欧美群妇大交群中文字幕| 亚洲色图在线视频| 国产成人综合亚洲91猫咪| 337p亚洲精品色噜噜噜| 亚洲尤物视频在线| 91日韩一区二区三区| 国产精品毛片无遮挡高清| 激情综合五月婷婷| 久久九九影视网| 日韩影院精彩在线| 欧洲av一区二区嗯嗯嗯啊| 国产精品久久影院| 国产成人午夜99999| 欧美草草影院在线视频| 日韩1区2区3区| 欧美放荡的少妇| 天堂影院一区二区| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 在线观看一区二区视频| 成人免费在线视频| 91首页免费视频| 亚洲精品一二三| 在线影视一区二区三区| 亚洲精品高清在线| 在线观看免费视频综合| 亚洲成人免费在线| 日韩欧美美女一区二区三区| 日韩精品五月天| 日韩一区二区视频在线观看| 蜜桃av一区二区在线观看| 日韩精品资源二区在线| 国产91精品一区二区| 国产精品色婷婷久久58| 色伊人久久综合中文字幕| 亚洲午夜免费电影| 日韩天堂在线观看| 国产成人自拍在线| 夜夜嗨av一区二区三区网页 | 欧美成人官网二区| 国产sm精品调教视频网站| 国产精品午夜电影| 欧美色倩网站大全免费| 麻豆91小视频| 国产精品久久久久天堂| 欧美三级中文字| 激情久久五月天| 亚洲欧美乱综合| 91精品在线麻豆| 成人午夜激情在线| 五月天一区二区三区| 久久久久久久久久看片| 欧美亚洲动漫精品| 国产美女av一区二区三区| 亚洲乱码国产乱码精品精可以看| 51久久夜色精品国产麻豆| 国产精品亚洲午夜一区二区三区| 亚洲激情图片qvod| 国产亚洲一区字幕| 91麻豆精品久久久久蜜臀| 成人综合婷婷国产精品久久免费| 亚洲成国产人片在线观看| 中文字幕第一页久久| 91精品在线免费观看| 日本道在线观看一区二区| 国产毛片一区二区| 日本一区中文字幕 | 午夜精品福利在线| 中文字幕高清不卡| 精品久久久久久久人人人人传媒 | 中文字幕制服丝袜成人av | 日韩一区二区在线观看视频播放| 粉嫩蜜臀av国产精品网站| 石原莉奈一区二区三区在线观看| 中文字幕乱码日本亚洲一区二区 | 日韩欧美国产1| 欧美中文字幕不卡| thepron国产精品| 国产一区二区不卡在线| 午夜精品久久久久久久久久| 亚洲欧美韩国综合色| 国产视频亚洲色图| 欧美精品一区二区三| 337p亚洲精品色噜噜| 欧美天堂一区二区三区| 91美女片黄在线观看91美女| 国产成人免费9x9x人网站视频| 美国一区二区三区在线播放| 亚洲综合免费观看高清完整版 | 在线免费不卡电影| 91小宝寻花一区二区三区| 成人免费不卡视频| 成人网页在线观看| 国产**成人网毛片九色| 高清日韩电视剧大全免费| 国产乱码精品一区二区三区av | 国产精品福利av| 国产精品久久久久永久免费观看| 欧美国产日韩精品免费观看| 精品美女一区二区| 久久久另类综合| 国产色婷婷亚洲99精品小说| 国产欧美一区二区三区鸳鸯浴 | 亚洲精品中文在线观看| 樱花草国产18久久久久| 亚洲乱码一区二区三区在线观看| 国产麻豆精品在线观看| 91福利精品第一导航| 99re这里只有精品6| av在线这里只有精品| 成人黄色免费短视频| 97久久超碰精品国产| 色综合中文字幕国产 | 国产精品一区专区| 国产伦精品一区二区三区视频青涩| 久久91精品久久久久久秒播| 国产成人免费在线| 91在线云播放| 欧美高清激情brazzers| 2021国产精品久久精品| 中文字幕一区二区日韩精品绯色| 一区2区3区在线看| 三级一区在线视频先锋| 国产精品影视在线| 91美女片黄在线观看| 日韩精品资源二区在线| 国产精品国产三级国产aⅴ原创 | 色欧美日韩亚洲| 88在线观看91蜜桃国自产| 337p日本欧洲亚洲大胆精品 | 亚洲精品一区二区三区精华液| 国产欧美日韩不卡免费| 亚洲五月六月丁香激情| 在线观看一区二区精品视频| 日韩在线播放一区二区| 韩日精品视频一区| 99热国产精品| 欧美一区二区三区精品| 国产精品高清亚洲| 久久91精品国产91久久小草 | 亚洲一区二区三区爽爽爽爽爽|