sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef __WPDOC_H__
|
sl@0
|
20 |
#define __WPDOC_H__
|
sl@0
|
21 |
|
sl@0
|
22 |
#include <gdi.h>
|
sl@0
|
23 |
#include <fldbltin.h>
|
sl@0
|
24 |
#include <txtmrtsr.h>
|
sl@0
|
25 |
#include <eikdoc.h>
|
sl@0
|
26 |
#include <eikapp.h>
|
sl@0
|
27 |
#include "WNGMODEL.H" // only #included for Model() inline
|
sl@0
|
28 |
#include <e32base.h>
|
sl@0
|
29 |
|
sl@0
|
30 |
#include "WPTESTPICTURE.H"
|
sl@0
|
31 |
|
sl@0
|
32 |
/**
|
sl@0
|
33 |
@internalComponent
|
sl@0
|
34 |
*/
|
sl@0
|
35 |
#if !defined KUidWordAppValue
|
sl@0
|
36 |
#ifdef _UNICODE
|
sl@0
|
37 |
#define KUidWordAppValue KUidWordAppValue16
|
sl@0
|
38 |
#else
|
sl@0
|
39 |
#define KUidWordAppValue KUidWordAppValue8
|
sl@0
|
40 |
#endif
|
sl@0
|
41 |
#endif
|
sl@0
|
42 |
|
sl@0
|
43 |
/**
|
sl@0
|
44 |
@internalComponent
|
sl@0
|
45 |
*/
|
sl@0
|
46 |
const TUid KUidWordAppValue8={0x1000007F};
|
sl@0
|
47 |
const TUid KUidWordAppValue16={0x10003A64};
|
sl@0
|
48 |
|
sl@0
|
49 |
class CFileStore;
|
sl@0
|
50 |
class CWordAppUi;
|
sl@0
|
51 |
class TWordUiData;
|
sl@0
|
52 |
|
sl@0
|
53 |
class CWordDocument : public CEikDocument, public MRichTextStoreResolver, public MFieldFileNameInfo, public MFieldNumPagesInfo
|
sl@0
|
54 |
/**
|
sl@0
|
55 |
@internalComponent
|
sl@0
|
56 |
*/
|
sl@0
|
57 |
{
|
sl@0
|
58 |
public:
|
sl@0
|
59 |
static CWordDocument* NewL(CEikApplication& aApp);
|
sl@0
|
60 |
~CWordDocument();
|
sl@0
|
61 |
//
|
sl@0
|
62 |
// CApaDocument implementation
|
sl@0
|
63 |
virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const;
|
sl@0
|
64 |
virtual void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
|
sl@0
|
65 |
virtual void DetachFromStoreL(CPicture::TDetach aDegree);
|
sl@0
|
66 |
void StoreUiDataL(CStreamStore& aStore,CStreamDictionary& aStreamDic)const;
|
sl@0
|
67 |
void RestoreUiDataL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
|
sl@0
|
68 |
virtual void NewDocumentL();
|
sl@0
|
69 |
//
|
sl@0
|
70 |
virtual const CStreamStore& StreamStoreL(TInt aPos)const; // MRichTextStoreResolver
|
sl@0
|
71 |
virtual TInt UpdateFieldFileName(TPtr& aValueText)const; // MFieldFileNameInfo
|
sl@0
|
72 |
virtual TInt UpdateFieldNumPages()const; // MFieldNumPagesInfo
|
sl@0
|
73 |
//
|
sl@0
|
74 |
// File
|
sl@0
|
75 |
void DoFileNewL(const TFileName& aFileName, const TFileName& aTemplateFileName);
|
sl@0
|
76 |
void DoFileOpenL(const TFileName& aFileName,TUint aFileMode=EFileWrite);
|
sl@0
|
77 |
void GetFileOpenModeL(TUint& aFileMode,const TDesC& aFilename,RFs& aSession);
|
sl@0
|
78 |
void DoFileSaveToCurrentL();
|
sl@0
|
79 |
void DoFileSaveToNewL(const TFileName& aFileName);
|
sl@0
|
80 |
void DoFileSaveToNewNoSwitchL(const TFileName& aNewFileName);
|
sl@0
|
81 |
void DoFileRevertL();
|
sl@0
|
82 |
//
|
sl@0
|
83 |
// Handles
|
sl@0
|
84 |
inline TWordUiData& UiData();
|
sl@0
|
85 |
inline CWordModel* Model()const;
|
sl@0
|
86 |
inline CWordAppUi& WordAppUi();
|
sl@0
|
87 |
inline const CWordAppUi& WordAppUi()const;
|
sl@0
|
88 |
inline CTextPageRegionPrinter& PageRegionPrinter()const;
|
sl@0
|
89 |
//
|
sl@0
|
90 |
// Utilities
|
sl@0
|
91 |
inline TBool FileNameExists(const TFileName& aFileName) const;
|
sl@0
|
92 |
private:
|
sl@0
|
93 |
enum TKeepStoreOpen
|
sl@0
|
94 |
{
|
sl@0
|
95 |
EKeepFalse,
|
sl@0
|
96 |
EKeepTrue
|
sl@0
|
97 |
};
|
sl@0
|
98 |
private:
|
sl@0
|
99 |
inline CWordDocument(CEikApplication& aApp);
|
sl@0
|
100 |
void ConstructL();
|
sl@0
|
101 |
void CreateModelL();
|
sl@0
|
102 |
void ConstructPrintL();
|
sl@0
|
103 |
void LocateTemplateL(const TDes& aFullFileName)const;
|
sl@0
|
104 |
void VerifyDocumentTypeL(const TFileName& aFileName)const;
|
sl@0
|
105 |
CFileStore* DoNewDocumentL(const TDesC& aStandardDocument,TKeepStoreOpen aKeepStoreOpen=EKeepFalse);
|
sl@0
|
106 |
void SetMainStoreAndMainDocFileName(CFileStore* aMainStore,const TDesC& aMainDocFileName);
|
sl@0
|
107 |
//
|
sl@0
|
108 |
// CApaDocument implementation
|
sl@0
|
109 |
CEikAppUi* CreateAppUiL();
|
sl@0
|
110 |
private:
|
sl@0
|
111 |
CWordModel* iModel;
|
sl@0
|
112 |
CTextPageRegionPrinter* iPrint;
|
sl@0
|
113 |
TWordUiData* iUiData;
|
sl@0
|
114 |
TBool iNewDocument;
|
sl@0
|
115 |
TWordTestPictureFactory iPictureFactory;
|
sl@0
|
116 |
};
|
sl@0
|
117 |
|
sl@0
|
118 |
|
sl@0
|
119 |
#include "WPDOC.INL"
|
sl@0
|
120 |
|
sl@0
|
121 |
|
sl@0
|
122 |
#endif
|