|
1 /* |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "FLDBASE.H" |
|
20 #include "FLDSTD.H" |
|
21 |
|
22 |
|
23 /////////////////////////////////////// |
|
24 // CTextField |
|
25 /////////////////////////////////////// |
|
26 |
|
27 |
|
28 EXPORT_C TStreamId CTextField::StoreL(CStreamStore& aStore) const |
|
29 // Assumes everything goes into the head stream. |
|
30 // (Must be replaced by concrete pictures that have components) |
|
31 /** Stores the field data to a stream store. Concrete field types with no persistent |
|
32 data should override this function to return KNullStreamId. |
|
33 |
|
34 @param aStore Stream store to which the field data is written. |
|
35 @return The ID of the stream store. */ |
|
36 { |
|
37 RStoreWriteStream stream; |
|
38 TStreamId id=stream.CreateLC(aStore); |
|
39 stream<< *this; // provided by the concrete field |
|
40 stream.CommitL(); |
|
41 CleanupStack::PopAndDestroy(); |
|
42 return id; |
|
43 } |
|
44 |
|
45 |
|
46 EXPORT_C void CTextField::RestoreL(const CStreamStore& aStore,TStreamId aStreamId) |
|
47 // Creates a read-stream over aStore, and opens it over the specified stream ID. |
|
48 // |
|
49 /** Restores the field data from a stream store. Concrete field types with no persistent |
|
50 data should override this function to do nothing. |
|
51 |
|
52 @param aStore Stream store containing the field data to restore. |
|
53 @param aId The ID of the stream store in which the field data was previously |
|
54 stored. */ |
|
55 { |
|
56 RStoreReadStream stream; |
|
57 stream.OpenLC(aStore,aStreamId); |
|
58 stream>> *this; |
|
59 CleanupStack::PopAndDestroy(); |
|
60 } |
|
61 |
|
62 |
|
63 |
|
64 EXPORT_C void CTextField::ExternalizeL(RWriteStream& /*aStream*/)const |
|
65 // |
|
66 /** Externalises the field data. Called by StoreL(). |
|
67 |
|
68 Calling this default implementation raises a panic. Concrete field classes |
|
69 with persistent data must provide their own implementation of this function. |
|
70 Concrete field classes with no persistent data must provide a StoreL() implementation |
|
71 that just returns KNullStreamId. |
|
72 |
|
73 @param aStream Not used. */ |
|
74 {Panic(EDefaultFieldExternalizeCalled);} |
|
75 |