Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
27 #include "WNGMODEL.H" // only #included for Model() inline
30 #include "WPTESTPICTURE.H"
35 #if !defined KUidWordAppValue
37 #define KUidWordAppValue KUidWordAppValue16
39 #define KUidWordAppValue KUidWordAppValue8
46 const TUid KUidWordAppValue8={0x1000007F};
47 const TUid KUidWordAppValue16={0x10003A64};
53 class CWordDocument : public CEikDocument, public MRichTextStoreResolver, public MFieldFileNameInfo, public MFieldNumPagesInfo
59 static CWordDocument* NewL(CEikApplication& aApp);
62 // CApaDocument implementation
63 virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const;
64 virtual void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
65 virtual void DetachFromStoreL(CPicture::TDetach aDegree);
66 void StoreUiDataL(CStreamStore& aStore,CStreamDictionary& aStreamDic)const;
67 void RestoreUiDataL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
68 virtual void NewDocumentL();
70 virtual const CStreamStore& StreamStoreL(TInt aPos)const; // MRichTextStoreResolver
71 virtual TInt UpdateFieldFileName(TPtr& aValueText)const; // MFieldFileNameInfo
72 virtual TInt UpdateFieldNumPages()const; // MFieldNumPagesInfo
75 void DoFileNewL(const TFileName& aFileName, const TFileName& aTemplateFileName);
76 void DoFileOpenL(const TFileName& aFileName,TUint aFileMode=EFileWrite);
77 void GetFileOpenModeL(TUint& aFileMode,const TDesC& aFilename,RFs& aSession);
78 void DoFileSaveToCurrentL();
79 void DoFileSaveToNewL(const TFileName& aFileName);
80 void DoFileSaveToNewNoSwitchL(const TFileName& aNewFileName);
84 inline TWordUiData& UiData();
85 inline CWordModel* Model()const;
86 inline CWordAppUi& WordAppUi();
87 inline const CWordAppUi& WordAppUi()const;
88 inline CTextPageRegionPrinter& PageRegionPrinter()const;
91 inline TBool FileNameExists(const TFileName& aFileName) const;
99 inline CWordDocument(CEikApplication& aApp);
102 void ConstructPrintL();
103 void LocateTemplateL(const TDes& aFullFileName)const;
104 void VerifyDocumentTypeL(const TFileName& aFileName)const;
105 CFileStore* DoNewDocumentL(const TDesC& aStandardDocument,TKeepStoreOpen aKeepStoreOpen=EKeepFalse);
106 void SetMainStoreAndMainDocFileName(CFileStore* aMainStore,const TDesC& aMainDocFileName);
108 // CApaDocument implementation
109 CEikAppUi* CreateAppUiL();
112 CTextPageRegionPrinter* iPrint;
113 TWordUiData* iUiData;
115 TWordTestPictureFactory iPictureFactory;