CamelotNativeFilter Class Reference

This filter is for the new Native file format which comes after the version 1.1 ready for version 2. The BaseCamelotFilter provides common functionality for both this and the web file filter as they are essentially the same thing. More...

#include <native.h>

Inheritance diagram for CamelotNativeFilter:

BaseCamelotFilter VectorFilter Filter ListItem CCObject SimpleCCObject CamelotNULLNativeFilter FlareTemplateFilter PluginNativeFilter List of all members.

Public Member Functions

 CamelotNativeFilter ()
 Constructor for the Native save/load filter.
 ~CamelotNativeFilter ()
 Tidies up when the filter is destroyed.
BOOL Init ()
 Initalises the Filter ready for use. Will fail if it can not get enough memory to work with.
virtual BOOL IsWebFilter ()
virtual BOOL IsCompactNativeFilter ()
virtual INT32 GetBitmapCompression ()
 Public access to the current bitmap compression which the user has requested to use when saving bitmaps in the web format. 0 means maximum compression e.g. use JPEG filter at 0% lossy compression 100 means minimum compression e.g. use JPEG filter at 100% lossy compression 101 - 200 means lossless compression e.g. us PNG filter. Could use the no bitmap compression at all e.g. use BMP filter. Unused at present. (Very much like the JPEG compression percentage). Note: This overrides the baseclass version to save in the proper native state.
virtual BOOL GetPreviewBitmapExport ()
 Public access to the current export preview bitmap which the user has requested to use when saving bitmaps in the web format. True means export a preview bitmap, False means do not. Note: This overrides the baseclass version to save in the proper native state.
virtual BOOL GetConvertTextToOutlines ()
 Public access to the current convert text to outlines which the user has requested to use when saving in the web format. True means convert text to outlines, False means do not. Note: This overrides the baseclass version to save in the proper native state.
virtual BOOL GetRemoveInvisibleLayers ()
 Public access to the current remove invisible layers which the user has requested to use when saving in the web format. True means remove invisible layers, False means do not. Note: This overrides the baseclass version to save in the proper native state.
virtual BOOL GetRemoveUnusedColours ()
 Public access to the current remove unused colours which the user has requested to use when saving in the web format. True means remove unused colours, False means do not. Note: This overrides the baseclass version to save in the proper native state.
virtual INT32 HowCompatibleIsFileType (char *pFileType)
virtual double GetSimilarPathTolerance (NodePath *pPath)
virtual INT32 GetMaxPathLookUp ()
 The max number pf paths that should be looked at by the function FindSimilarPath().
virtual WebPrefsDlgParamGetCachedExportOptions ()

Protected Member Functions

virtual BaseCamelotFilterCreateNULLFilter (Document *pDocument)
 Creates the relevant NULL filter Scope: Protected.
virtual char * GetExportFileType ()
virtual BOOL BeginDocumentExport ()
 This function is called just before document-related records are written out to the file.
virtual BOOL EndDocumentExport ()
 This function is called after document-related records have been are written out to the file. BeginDocumentExport() is called before the doc records are saved.
virtual BOOL WriteCurrentAttributes ()
 Write out all current attributes.

Protected Attributes

UINT32 FilterNameID
UINT32 FilterInfoID
UINT32 ExportingMsgID

Private Member Functions

 CC_DECLARE_DYNAMIC (CamelotNativeFilter)

Detailed Description

This filter is for the new Native file format which comes after the version 1.1 ready for version 2. The BaseCamelotFilter provides common functionality for both this and the web file filter as they are essentially the same thing.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/96

Definition at line 121 of file native.h.


Constructor & Destructor Documentation

CamelotNativeFilter::CamelotNativeFilter  ) 
 

Constructor for the Native save/load filter.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/96

Definition at line 139 of file native.cpp.

00140 {
00141     // Set up filter descriptions.
00142     FilterNameID = _R(IDS_FILTERNAME_NATIVE);
00143     FilterInfoID = _R(IDS_NATIVE_FILTERINFO);
00144     ImportMsgID  = _R(IDS_IMPORTMSG_NATIVE);
00145     ExportMsgID  = _R(IDS_EXPORTMSG_NATIVE);
00146 
00147     FilterID = FILTERID_NATIVE;
00148 
00149 #ifndef STANDALONE
00150     Flags.CanImport = TRUE;
00151     //WEBSTER-Martin-27/01/97
00152 #ifdef WEBSTER
00153     Flags.CanExport = FALSE;
00154 #else
00155     Flags.CanExport = TRUE;
00156 #endif //WEBSTER
00157 #else
00158     Flags.CanImport = TRUE;
00159     Flags.CanExport = FALSE;
00160 #endif
00161 
00162     // Message to show when a problem file is encountered
00163     BadFileMsgID = _R(IDS_NOT_A_NATIVE_FILE);
00164 }

CamelotNativeFilter::~CamelotNativeFilter  ) 
 

Tidies up when the filter is destroyed.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/96

Definition at line 179 of file native.cpp.

00180 {
00181 
00182 }


Member Function Documentation

BOOL CamelotNativeFilter::BeginDocumentExport  )  [protected, virtual]
 

This function is called just before document-related records are written out to the file.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
- [INPUTS]
Returns:
TRUE if successful, FALSE otherwise
The native filter writes out a TAG_DOCUMENT record to signify the start of the document.

See also:
CamelotNativeFilter::EndDocumentExport() Scope: Protected

Reimplemented from BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 401 of file native.cpp.

00402 {
00403     BOOL ok = TRUE;
00404 
00405     // Writes out a document rec followed by a down rec
00406     // This will ensure that all doc-related records appear as a child of the doc record
00407     if (ok) ok = WriteZeroSizedRecord(TAG_DOCUMENT);
00408     if (ok) ok = WriteZeroSizedRecord(TAG_DOWN);
00409 
00410     return ok;
00411 }

CamelotNativeFilter::CC_DECLARE_DYNAMIC CamelotNativeFilter   )  [private]
 

BaseCamelotFilter * CamelotNativeFilter::CreateNULLFilter Document pDocument  )  [protected, virtual]
 

Creates the relevant NULL filter Scope: Protected.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/6/96
Parameters:
pDocument = ptr to the document [INPUTS]
Returns:
ptr to a filter that can be used to count the number of exported bytes NULL if there's an error

Implements BaseCamelotFilter.

Definition at line 375 of file native.cpp.

00376 {
00377     BaseCamelotFilter* pFilter = new CamelotNULLNativeFilter(this,pDocument);
00378 
00379     return pFilter;
00380 }

BOOL CamelotNativeFilter::EndDocumentExport  )  [protected, virtual]
 

This function is called after document-related records have been are written out to the file. BeginDocumentExport() is called before the doc records are saved.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
- [INPUTS]
Returns:
TRUE if successful, FALSE otherwise
This should be called for each document that is saved out to the file.

See also:
CamelotNativeFilter::BeginDocumentExport() Scope: Protected

Reimplemented from BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 431 of file native.cpp.

00432 {
00433     BOOL ok = TRUE;
00434 
00435     // Writes out an up rec
00436     // This will ensure that all doc-related records appear as a child of the doc record
00437     // by matching the down rec written out by BeginDocumentExport()
00438     if (ok) ok = WriteZeroSizedRecord(TAG_UP);
00439 
00440     return ok;
00441 }

INT32 CamelotNativeFilter::GetBitmapCompression  )  [virtual]
 

Public access to the current bitmap compression which the user has requested to use when saving bitmaps in the web format. 0 means maximum compression e.g. use JPEG filter at 0% lossy compression 100 means minimum compression e.g. use JPEG filter at 100% lossy compression 101 - 200 means lossless compression e.g. us PNG filter. Could use the no bitmap compression at all e.g. use BMP filter. Unused at present. (Very much like the JPEG compression percentage). Note: This overrides the baseclass version to save in the proper native state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Parameters:
- [INPUTS]
Returns:
The current state of the bitmap compression.

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 255 of file native.cpp.

00256 {
00257     // Always use a lossless format such as PNG in native files
00258     return 200;
00259 }

virtual WebPrefsDlgParam* CamelotNativeFilter::GetCachedExportOptions  )  [inline, virtual]
 

Reimplemented from BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 156 of file native.h.

00156 { return NULL; }

BOOL CamelotNativeFilter::GetConvertTextToOutlines  )  [virtual]
 

Public access to the current convert text to outlines which the user has requested to use when saving in the web format. True means convert text to outlines, False means do not. Note: This overrides the baseclass version to save in the proper native state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Parameters:
- [INPUTS]
Returns:
The current state of the convert text to outlines.

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 313 of file native.cpp.

00314 {
00315     // In native files ensure text is not converted to outlines
00316     return FALSE;
00317 }

char * CamelotNativeFilter::GetExportFileType  )  [protected, virtual]
 

Implements BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 451 of file native.cpp.

00452 {
00453     return EXPORT_FILETYPE_NATIVE;
00454 }

INT32 CamelotNativeFilter::GetMaxPathLookUp  )  [virtual]
 

The max number pf paths that should be looked at by the function FindSimilarPath().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/9/96
Parameters:
- [INPUTS]
Returns:
100 always
See also:
BaseCamelotFilter::GetMaxPathLookUp; Scope: Protected

Reimplemented from BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 476 of file native.cpp.

00477 {
00478     return -1;//100;
00479 }

BOOL CamelotNativeFilter::GetPreviewBitmapExport  )  [virtual]
 

Public access to the current export preview bitmap which the user has requested to use when saving bitmaps in the web format. True means export a preview bitmap, False means do not. Note: This overrides the baseclass version to save in the proper native state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Parameters:
- [INPUTS]
Returns:
The current state of the export preview bitmap.

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 276 of file native.cpp.

00277 {
00278 #if (_OLE_VER >= 0x200)
00279     // Get some documents to check up on.
00280     ERROR2IF(!TheDocument, FALSE,
00281                 "Null Document* in CamelotNativeFilter::GetPreviewBitmapExport");
00282 
00283     if(TheDocument->IsAClipboard())
00284         return FALSE;           //   clipboard docs don't have previews
00285 
00286     CCamDoc* pDoc = TheDocument->GetOilDoc();
00287     ERROR2IF(!TheDocument->GetOilDoc(), FALSE,
00288                 "Null CCamDoc* in CamelotNativeFilter::GetPreviewBitmapExport");
00289 
00290     // We *don't* export a preview bitmap if the associated document is embedded in an
00291     // OLE container.  Basically, let the document decide.
00292     return pDoc->ShouldExportPreview();
00293 #else
00294     return TRUE;
00295 #endif
00296 }

BOOL CamelotNativeFilter::GetRemoveInvisibleLayers  )  [virtual]
 

Public access to the current remove invisible layers which the user has requested to use when saving in the web format. True means remove invisible layers, False means do not. Note: This overrides the baseclass version to save in the proper native state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Parameters:
- [INPUTS]
Returns:
The current state of the remove invisible layers.

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 334 of file native.cpp.

00335 {
00336     // In native files retain inivisible layers
00337     return FALSE;
00338 }

BOOL CamelotNativeFilter::GetRemoveUnusedColours  )  [virtual]
 

Public access to the current remove unused colours which the user has requested to use when saving in the web format. True means remove unused colours, False means do not. Note: This overrides the baseclass version to save in the proper native state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Parameters:
- [INPUTS]
Returns:
The current state of the remove unused colours.

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 355 of file native.cpp.

00356 {
00357     // In native files retain unused colours
00358     return FALSE;
00359 }

double CamelotNativeFilter::GetSimilarPathTolerance NodePath pPath  )  [virtual]
 

Implements BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 456 of file native.cpp.

00457 {
00458     return 0.0;
00459 }

INT32 CamelotNativeFilter::HowCompatibleIsFileType char *  pFileType  )  [virtual]
 

Implements BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 443 of file native.cpp.

00444 {
00445     if (strcmp(pFileType,GetExportFileType()) == 0)
00446         return 10;
00447     else
00448         return 9;
00449 }

BOOL CamelotNativeFilter::Init void   )  [virtual]
 

Initalises the Filter ready for use. Will fail if it can not get enough memory to work with.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/5/96
Returns:
TRUE if it worked, FALSE if it failed

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter.

Definition at line 196 of file native.cpp.

00197 {
00198     // Get the OILFilter object
00199     pOILFilter = new NativeOILFilter(this);
00200     if (pOILFilter == NULL)
00201         return FALSE;
00202 
00203     // Load the description strings
00204     FilterName.Load(FilterNameID);
00205     FilterInfo.Load(FilterInfoID);
00206 
00207     BOOL ok = CreateRecordHandlers();
00208 
00209     if (Camelot.DeclareSection( _T("Filters"), 10))
00210     {
00211         // Preference to turn native file compression on or off
00212         Camelot.DeclarePref( NULL, _T("CompressV2Format"), &BaseCamelotFilter::CompressNative, 0, 1 );
00213         // Preference to turn xpe bitmap saving on or off
00214         Camelot.DeclarePref( NULL, _T("SaveXPEBitmaps"), &BaseCamelotFilter::SaveXPEBitmaps, 0, 1 );
00215         // Preference to decide what bitmap format to use for preview bitmaps 
00216         Camelot.DeclarePref( NULL, _T("PreviewBitmapFilterType"), &BaseCamelotFilter::PreviewBitmapFilterType, 0, 4 );
00217         // Preference for the optional export as web pathname when native saving
00218         Camelot.DeclarePref( NULL, _T("DefaultWebExportFilterPath"), &BaseCamelotFilter::DefaultExportPath);
00219         // Preference to turn native file checking for similar paths on or off
00220         Camelot.DeclarePref( NULL, _T("NativeCheckSimilarPaths"), &BaseCamelotFilter::NativeCheckSimilarPaths, 0, 1 );
00221     }
00222 
00223 #ifdef DO_EXPORT
00224 
00225     // Initialise the native file export options dialog.
00226     if ( ok )
00227     {
00228         ok = NativePrefsDlg::Init ();
00229     }
00230 
00231 #endif
00232 
00233     return ok;
00234 }

virtual BOOL CamelotNativeFilter::IsCompactNativeFilter  )  [inline, virtual]
 

Implements BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 133 of file native.h.

00133 { return FALSE; }

virtual BOOL CamelotNativeFilter::IsWebFilter  )  [inline, virtual]
 

Implements BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 132 of file native.h.

00132 { return FALSE; }

BOOL CamelotNativeFilter::WriteCurrentAttributes  )  [protected, virtual]
 

Write out all current attributes.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/03/2004
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if worked, FALSE otherwise

Errors: -

See also:
-

Reimplemented from BaseCamelotFilter.

Reimplemented in PluginNativeFilter.

Definition at line 499 of file native.cpp.

00500 {
00501     BOOL ok = TRUE;
00502     
00503     if (ok && TheDocument)
00504     {
00505         AttributeManager* pAttrMgr = &(TheDocument->GetAttributeMgr());
00506         if (pAttrMgr)
00507             ok = pAttrMgr->WriteCurrentAttributes(this);
00508     }
00509 
00510     return (ok);
00511 }


Member Data Documentation

UINT32 CamelotNativeFilter::ExportingMsgID [protected]
 

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 174 of file native.h.

UINT32 CamelotNativeFilter::FilterInfoID [protected]
 

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 169 of file native.h.

UINT32 CamelotNativeFilter::FilterNameID [protected]
 

Reimplemented from BaseCamelotFilter.

Reimplemented in FlareTemplateFilter, and PluginNativeFilter.

Definition at line 168 of file native.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:47 2007 for Camelot by  doxygen 1.4.4