os/textandloc/textrendering/word/SRC/WNGDOOR.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 #if !defined(__WNGDOOR_H__)
    20 #define __WNGDOOR_H__
    21 
    22 #if !defined(__E32STD_H__)
    23 #include <e32std.h>
    24 #endif
    25 
    26 #if !defined(__E32BASE_H__)
    27 #include <e32base.h>
    28 #endif
    29 
    30 #if !defined(__APAMDR_H__)
    31 #include <apamdr.h>
    32 #endif
    33 
    34 //
    35 // Classes defined
    36 class CWordModelHeader;
    37 class TWordModelHeaderFactory;
    38 class CWordModelHeaderV2;
    39 class TWordModelHeaderFactoryV2;
    40 //
    41 // Class referenced
    42 class CWordModel;
    43 class TWordModelStoreResolver;
    44 
    45 /** Application UID for word processor application. 
    46 @internalComponent
    47 @deprecated
    48 */
    49 const TUid KUidWordApp = {0x10003A64};
    50 
    51 
    52 //
    53 // Takes ownership of the referenced word model
    54 //
    55 class CWordModelHeaderV2 : public CApaModelHeader
    56 /** Wrapper for the word processor application engine.
    57 
    58 The class provides the knowledge for internalising and externalising an application 
    59 model's data. It enables word processor documents to be embedded within rich 
    60 text objects.
    61 
    62 Compared to CWordModelHeader, it also provides restoration support for objects 
    63 embedded within embedded word documents. 
    64 @internalComponent
    65 */
    66 	{
    67 	friend class TWordModelHeaderFactoryV2;
    68 public:
    69 	IMPORT_C ~CWordModelHeaderV2();
    70 public:	// from CApaModelHeader
    71 	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aDict)const;
    72 	IMPORT_C TApaAppIdentifier AppId()const;
    73 	IMPORT_C void DetachFromStoreL(CPicture::TDetach aDegree);
    74 public:
    75 	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aDict);
    76 	IMPORT_C CWordModel* Model();
    77 	void SetFactory(MApaModelHeaderFactory* aFactory); // takes ownership
    78 private:
    79 	CWordModelHeaderV2(CWordModel* aModel);
    80 private:
    81 	CWordModel*	iModel;
    82 	TWordModelStoreResolver* iResolver; // created during restore
    83 	MApaModelHeaderFactory* iHeaderFactory;
    84 	};
    85 
    86 
    87 //
    88 //
    89 
    90 class TWordModelHeaderFactoryV2 : public MApaModelHeaderFactory
    91 /** Factory to construct CWordModelHeaderV2 application wrapper objects.
    92 @internalComponent
    93 */
    94 	{
    95 public:
    96 	IMPORT_C TWordModelHeaderFactoryV2(const TFileName& aPrintDriverPath);
    97 	IMPORT_C CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,
    98 										const TApaAppIdentifier& aAppId)const;
    99 private:
   100 	TFileName iPrintDriverPath;
   101 	};
   102 
   103 
   104 
   105 class CWordModelHeaderV3 : public CApaModelHeader
   106 /** Wrapper for the word processor application engine.
   107 
   108 The class provides the knowledge for internalising and externalising an application 
   109 model's data. It enables word processor documents to be embedded within rich 
   110 text objects.
   111 
   112 Like CWordModelHeaderV2, it provides restoration support for objects embedded 
   113 within embedded word documents. Unlike that class, however, it does not restore 
   114 printer setup information, or process header and footer information. 
   115 @internalComponent
   116 */
   117 	{
   118 	friend class TWordModelHeaderFactoryV3;
   119 public:
   120 	IMPORT_C ~CWordModelHeaderV3();
   121 public:	// from CApaModelHeader
   122 	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aDict)const;
   123 	IMPORT_C TApaAppIdentifier AppId()const;
   124 	IMPORT_C void DetachFromStoreL(CPicture::TDetach aDegree);
   125 public:
   126 	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aDict);
   127 	IMPORT_C CWordModel* Model();
   128 	void SetFactory(MApaModelHeaderFactory* aFactory); // takes ownership
   129 private:
   130 	CWordModelHeaderV3(CWordModel* aModel);
   131 private:
   132 	CWordModel*	iModel;
   133 	TWordModelStoreResolver* iResolver; // created during restore
   134 	MApaModelHeaderFactory* iHeaderFactory;
   135 	};
   136 
   137 
   138 // Mimimal header factory for efficiency
   139 // Does not restore header or footer information from the document
   140 //
   141 class TWordModelHeaderFactoryV3 : public MApaModelHeaderFactory
   142 /** Factory to construct CWordModelHeaderV3 application wrapper objects. 
   143 @internalComponent
   144 */
   145 	{
   146 public:
   147 	IMPORT_C TWordModelHeaderFactoryV3();
   148 	IMPORT_C CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,
   149 										const TApaAppIdentifier& aAppId) const;
   150 	};
   151 
   152 
   153 #endif