epoc32/include/wngmodel.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 wngmodel.h
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__WNGMODEL_H__)
       
    17 #define __WNGMODEL_H__
       
    18 
       
    19 #if !defined(__E32STD_H__)
       
    20 #include <e32std.h>
       
    21 #endif
       
    22 #if !defined(__E32BASE_H__)
       
    23 #include <e32base.h>
       
    24 #endif
       
    25 
       
    26 #if !defined(__F32FILE_H__)
       
    27 #include <f32file.h>
       
    28 #endif
       
    29 
       
    30 #if !defined(__S32STD_H__)
       
    31 #include <s32std.h>
       
    32 #endif
       
    33 
       
    34 #include <gdi.h>
       
    35 
       
    36 //
       
    37 // Classed decalred in this file
       
    38 class CWordModel;
       
    39 class CWordProfileModel;
       
    40 //
       
    41 // Classes referenced
       
    42 class RReadStream;
       
    43 class RWriteStream;
       
    44 class CSecureStore;
       
    45 class CParaFormatLayer;
       
    46 class CCharFormatLayer;
       
    47 class CRichText;
       
    48 class CStyleList;
       
    49 class CPrintSetup;
       
    50 class MFieldFileNameInfo;
       
    51 class MFieldNumPagesInfo;
       
    52 class CStreamStore;
       
    53 class CStreamDictionary;
       
    54 
       
    55 /** Type for an array of style short cuts.
       
    56 
       
    57 @see CWordModel::StyleShortCutList() 
       
    58 @publishedAll
       
    59 @deprecated
       
    60 */
       
    61 typedef CArrayFixFlat<TChar> CStyleShortCutList;
       
    62 
       
    63 
       
    64 
       
    65 class CWordModel : public CBase 
       
    66 /** Word processor engine interface.
       
    67 
       
    68 This is essentially a thin layer over the rich text support (CRichText etc.) 
       
    69 provided by the Application Framework's ETEXT component. 
       
    70 @publishedAll
       
    71 @deprecated
       
    72 */
       
    73 	{
       
    74 public:
       
    75 	IMPORT_C static CWordModel* NewL(const MFieldFileNameInfo* aFileNameInfo,const MFieldNumPagesInfo* aFieldNumPagesInfo,const TDesC& aDriverPath);
       
    76 	IMPORT_C static CWordModel* NewL(const MFieldFileNameInfo* aFileNameInfo,const MFieldNumPagesInfo* aFieldNumPagesInfo);
       
    77 	// Performs no initialisation at all.
       
    78 	//
       
    79 	IMPORT_C ~CWordModel();
       
    80 	//
       
    81 	// Save/Load
       
    82 #ifndef __SECURE_API__
       
    83 	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic,const CSecurityBase* aSecurity)const;
       
    84 	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic,const CSecurityBase* aSecurity,
       
    85 						   const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,
       
    86 						   MPictureFactory* aPictureFactory=NULL);
       
    87 	IMPORT_C void RestoreMinimalL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic,const CSecurityBase* aSecurity,
       
    88 						   const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,
       
    89 						   MPictureFactory* aPictureFactory=NULL);
       
    90 #else						   
       
    91 	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic,const TAny* aSecurity)const;
       
    92 	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic,const TAny* aSecurity,
       
    93 						   const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,
       
    94 						   MPictureFactory* aPictureFactory=NULL);
       
    95 	IMPORT_C void RestoreMinimalL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic,const TAny* aSecurity,
       
    96 						   const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,
       
    97 						   MPictureFactory* aPictureFactory=NULL);
       
    98 #endif
       
    99 
       
   100 	//
       
   101 	// Handles
       
   102 	inline CRichText* Text();
       
   103 	inline CStyleList* StyleList();
       
   104 	inline CPrintSetup* PrintSetup();
       
   105 	inline CArrayFix<TInt>* PageTable();
       
   106 	inline CStyleShortCutList* StyleShortCutList();
       
   107 	inline TChar& NormalStyleShortCut();
       
   108 protected:
       
   109 	IMPORT_C CWordModel();
       
   110 	IMPORT_C void ConstructL(const MFieldFileNameInfo* aFileNameInfo,const MFieldNumPagesInfo* aNumPagesInfo);
       
   111 	IMPORT_C void ConstructMinimalL(const MFieldFileNameInfo* aFileNameInfo,const MFieldNumPagesInfo* aFieldNumPagesInfo,const TDesC& aDriverPath);
       
   112 	void ConstructGlobalLayersL();
       
   113 	//
       
   114 	TStreamId StoreStylesL(CStreamStore& aStore)const;
       
   115 	void RestoreStylesL(const CStreamStore& aStore,TStreamId aId);
       
   116 	//
       
   117 	TStreamId StoreFieldDataL(CStreamStore& aStore)const;
       
   118 	void RestoreFieldDataL(const CStreamStore& aStore,TStreamId aId);
       
   119 #ifndef __SECURE_API__
       
   120 	TStreamId StoreTextDataL(CStreamStore& aStore,const CSecurityBase* aSecurity)const;
       
   121 	void RestoreTextDataL(const CStreamStore& aStore,TStreamId aId,const CSecurityBase* aSecurity);
       
   122 #else
       
   123 	TStreamId StoreTextDataL(CStreamStore& aStore,const TAny* aSecurity)const;
       
   124 	void RestoreTextDataL(const CStreamStore& aStore,TStreamId aId,const TAny* aSecurity);
       
   125 #endif
       
   126 
       
   127 	TStreamId StoreMarkupDataL(CStreamStore& aStore)const;
       
   128 	void RestoreMarkupDataL(const CStreamStore& aStore,TStreamId aId);
       
   129 private:
       
   130 	void InitPrintSetupL(const MFieldFileNameInfo* aFileNameInfo,const MFieldNumPagesInfo* aNumPagesInfo,const TDesC& aDriverPath);
       
   131 private:
       
   132 	CParaFormatLayer* iParaFormatLayer;
       
   133 	CCharFormatLayer* iCharFormatLayer;
       
   134 	CRichText* iText;
       
   135 	CStyleList* iStyleList;
       
   136 	CPrintSetup* iPrintSetup;
       
   137 	CStyleShortCutList* iStyleShortCutList;
       
   138 	TChar iNormalStyleShortCut;
       
   139 	CArrayFix<TInt>* iPageTable;
       
   140 	};
       
   141 
       
   142 
       
   143 #include <wngmodel.inl>
       
   144 
       
   145 
       
   146 #endif