sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "FLDBASE.H" sl@0: #include "FLDSTD.H" sl@0: sl@0: sl@0: /////////////////////////////////////// sl@0: // CTextField sl@0: /////////////////////////////////////// sl@0: sl@0: sl@0: EXPORT_C TStreamId CTextField::StoreL(CStreamStore& aStore) const sl@0: // Assumes everything goes into the head stream. sl@0: // (Must be replaced by concrete pictures that have components) sl@0: /** Stores the field data to a stream store. Concrete field types with no persistent sl@0: data should override this function to return KNullStreamId. sl@0: sl@0: @param aStore Stream store to which the field data is written. sl@0: @return The ID of the stream store. */ sl@0: { sl@0: RStoreWriteStream stream; sl@0: TStreamId id=stream.CreateLC(aStore); sl@0: stream<< *this; // provided by the concrete field sl@0: stream.CommitL(); sl@0: CleanupStack::PopAndDestroy(); sl@0: return id; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CTextField::RestoreL(const CStreamStore& aStore,TStreamId aStreamId) sl@0: // Creates a read-stream over aStore, and opens it over the specified stream ID. sl@0: // sl@0: /** Restores the field data from a stream store. Concrete field types with no persistent sl@0: data should override this function to do nothing. sl@0: sl@0: @param aStore Stream store containing the field data to restore. sl@0: @param aId The ID of the stream store in which the field data was previously sl@0: stored. */ sl@0: { sl@0: RStoreReadStream stream; sl@0: stream.OpenLC(aStore,aStreamId); sl@0: stream>> *this; sl@0: CleanupStack::PopAndDestroy(); sl@0: } sl@0: sl@0: sl@0: sl@0: EXPORT_C void CTextField::ExternalizeL(RWriteStream& /*aStream*/)const sl@0: // sl@0: /** Externalises the field data. Called by StoreL(). sl@0: sl@0: Calling this default implementation raises a panic. Concrete field classes sl@0: with persistent data must provide their own implementation of this function. sl@0: Concrete field classes with no persistent data must provide a StoreL() implementation sl@0: that just returns KNullStreamId. sl@0: sl@0: @param aStream Not used. */ sl@0: {Panic(EDefaultFieldExternalizeCalled);} sl@0: