当前位置: 首页>>代码示例>>C++>>正文


C++ CContactItemField::StoreStorage方法代码示例

本文整理汇总了C++中CContactItemField::StoreStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactItemField::StoreStorage方法的具体用法?C++ CContactItemField::StoreStorage怎么用?C++ CContactItemField::StoreStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContactItemField的用法示例。


在下文中一共展示了CContactItemField::StoreStorage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoCompareCContactItemFieldStorageTypeL

TBool CPackagerCntComparator::DoCompareCContactItemFieldStorageTypeL(const CContactItemField& anItemField1, const CContactItemField& anItemField2) const
/** Compares two storage type items contained within their respective CContactItemField parent.

@param anItemField1 The first CContactItemField containing the storage type to be compared.
@param anItemField2 The second CContactItemField containing the storage type to be compared.
@return ETrue if the two items are equal, EFalse otherwise. */
	{
	// Check if storage type is same first, otherwise don't need to 
	// compare storage content.
	if(!DoCompareTUint(anItemField1.StorageType(), anItemField2.StorageType()))
		{
		return EFalse;
		}	
	
	TBool result = ETrue;
    switch (anItemField1.StorageType())
        {
    case KStorageTypeText:
		result = DoCompareTPtrC(anItemField1.TextStorage()->Text(), anItemField2.TextStorage()->Text());
        break;
        
    case KStorageTypeStore:
		result = (anItemField1.StoreStorage()->Thing()==anItemField2.StoreStorage()->Thing());
        break;
        
    case KStorageTypeDateTime:
		result = DoCompareTTime(anItemField1.DateTimeStorage()->Time(), anItemField2.DateTimeStorage()->Time());
        break;
        
    case KStorageTypeContactItemId:
		result = DoCompareTContactItemId(anItemField1.AgentStorage()->Value(), anItemField2.AgentStorage()->Value());
        break;
        
    default:
    	User::Leave(KErrNotSupported);
    	break;
        }
        		
	return result;	
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:40,代码来源:t_packagertesthelper.cpp

示例2: InsertBinaryFieldL

//------------------------------------------------------------------------------------------------------------	
void CPerfTestContact::InsertBinaryFieldL(TUid aID, const TDesC8& aBufOfStuff )
	{
	CContactItemField*  itemFieldPtr = NULL;
	CContactStoreField* binStoragePtr = NULL;

	itemFieldPtr = CContactItemField::NewLC( KStorageTypeStore, aID );
	binStoragePtr = itemFieldPtr->StoreStorage(); // we don't have ownership here, hence no stack.

	binStoragePtr->SetThingL(aBufOfStuff);
	binStoragePtr = NULL; // we've finished with this ptr now.

	iContactItem->AddFieldL( *itemFieldPtr ); // hand ownership over here
	CleanupStack::Pop( itemFieldPtr ); // and pop,
	}	
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:15,代码来源:t_perfdbcreator.cpp

示例3: SetFieldL

/*sets a specific contact field to a value as determined by its type.
field at aPos in aFields is set to aText*/
void CContactsRamTest::SetFieldL(const CContactItemField &aField, const TDesC& aText)
	{
	if( aField.IsTemplateLabelField() )
		{
		return;
		}
		
	if( 0 == aText.Size() )
		{
		return;
		}
	
	switch(aField.StorageType())
		{
		case KStorageTypeText:
			aField.TextStorage()->SetTextL(aText);
		break;
		case KStorageTypeStore:
			{
			HBufC8 *buf = HBufC8::NewLC(aText.Size());
			TPtr8 tptr8 = buf->Des();
			tptr8.Copy(aText);
			aField.StoreStorage()->SetThingL(*buf);
			CleanupStack::PopAndDestroy(buf);
			}
		break;
		case KStorageTypeContactItemId:
			{
			aField.AgentStorage()->SetAgentId( KAgentId );
			}
		break;
		case KStorageTypeDateTime:
			{
			if( aText.Size() > 0 ) 
				{
				aField.DateTimeStorage()->SetTime( TTime(KTime) );
				}
			else
				{
				aField.DateTimeStorage()->SetTime( TTime(0) );
				}
			}
		break;
		default:
			User::Panic(aText,EInvariantFalse);
		break;
		}
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:50,代码来源:t_contactsramtest.cpp

示例4: CreateContactFieldL

void CntThumbnailCreator::CreateContactFieldL()
{
    __ASSERT_DEBUG(m_imageData, User::Panic(KPanicCategory, KPanicUnitialized));

    initializeThumbnailFieldL();
    CContactItemField *thumbnailField = CContactItemField::NewLC(*m_thumbnailFieldFromTemplate);

    thumbnailField->StoreStorage()->SetThingL(*m_imageData);
    QT_TRYCATCH_LEAVING(m_fieldList->append(thumbnailField));
    CleanupStack::Pop(thumbnailField);

    // Complete request to proceed to the final state
    TRequestStatus *status = &iStatus;
    User::RequestComplete(status, KErrNone);
    SetActive();
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:16,代码来源:cntthumbnailcreator.cpp


注:本文中的CContactItemField::StoreStorage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。