00001 // $Id: webop.cpp 1282 2006-06-09 09:46:49Z alex $ 00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00003 ================================XARAHEADERSTART=========================== 00004 00005 Xara LX, a vector drawing and manipulation program. 00006 Copyright (C) 1993-2006 Xara Group Ltd. 00007 Copyright on certain contributions may be held in joint with their 00008 respective authors. See AUTHORS file for details. 00009 00010 LICENSE TO USE AND MODIFY SOFTWARE 00011 ---------------------------------- 00012 00013 This file is part of Xara LX. 00014 00015 Xara LX is free software; you can redistribute it and/or modify it 00016 under the terms of the GNU General Public License version 2 as published 00017 by the Free Software Foundation. 00018 00019 Xara LX and its component source files are distributed in the hope 00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00022 See the GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with Xara LX (see the file GPL in the root directory of the 00026 distribution); if not, write to the Free Software Foundation, Inc., 51 00027 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00028 00029 00030 ADDITIONAL RIGHTS 00031 ----------------- 00032 00033 Conditional upon your continuing compliance with the GNU General Public 00034 License described above, Xara Group Ltd grants to you certain additional 00035 rights. 00036 00037 The additional rights are to use, modify, and distribute the software 00038 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00039 library and any other such library that any version of Xara LX relased 00040 by Xara Group Ltd requires in order to compile and execute, including 00041 the static linking of that library to XaraLX. In the case of the 00042 "CDraw" library, you may satisfy obligation under the GNU General Public 00043 License to provide source code by providing a binary copy of the library 00044 concerned and a copy of the license accompanying it. 00045 00046 Nothing in this section restricts any of the rights you have under 00047 the GNU General Public License. 00048 00049 00050 SCOPE OF LICENSE 00051 ---------------- 00052 00053 This license applies to this program (XaraLX) and its constituent source 00054 files only, and does not necessarily apply to other Xara products which may 00055 in part share the same code base, and are subject to their own licensing 00056 terms. 00057 00058 This license does not apply to files in the wxXtra directory, which 00059 are built into a separate library, and are subject to the wxWindows 00060 license contained within that directory in the file "WXXTRA-LICENSE". 00061 00062 This license does not apply to the binary libraries (if any) within 00063 the "libs" directory, which are subject to a separate license contained 00064 within that directory in the file "LIBS-LICENSE". 00065 00066 00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00068 ---------------------------------------------- 00069 00070 Subject to the terms of the GNU Public License (see above), you are 00071 free to do whatever you like with your modifications. However, you may 00072 (at your option) wish contribute them to Xara's source tree. You can 00073 find details of how to do this at: 00074 http://www.xaraxtreme.org/developers/ 00075 00076 Prior to contributing your modifications, you will need to complete our 00077 contributor agreement. This can be found at: 00078 http://www.xaraxtreme.org/developers/contribute/ 00079 00080 Please note that Xara will not accept modifications which modify any of 00081 the text between the start and end of this header (marked 00082 XARAHEADERSTART and XARAHEADEREND). 00083 00084 00085 MARKS 00086 ----- 00087 00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00089 designs are registered or unregistered trademarks, design-marks, and/or 00090 service marks of Xara Group Ltd. All rights in these marks are reserved. 00091 00092 00093 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00094 http://www.xara.com/ 00095 00096 =================================XARAHEADEREND============================ 00097 */ 00098 00099 // Operations to save in the version 2 Native/Web format. 00100 // Loading ops are not required as the general open operation will open any format file. 00101 00102 /* 00103 */ 00104 00105 #include "camtypes.h" 00106 00107 #include "webop.h" 00108 #include "nativeop.h" 00109 //#include "filters.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00110 //#include "oilfltrs.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00111 //#include "filtrres.h" 00112 00113 //#include "barsdlgs.h" 00114 00115 // An implement to match the Declare in the .h file. 00116 CC_IMPLEMENT_DYNCREATE(OpSaveAsWeb, Operation) 00117 CC_IMPLEMENT_DYNCREATE(OpSaveAsNativeV2, Operation) 00118 00119 // This will get Camelot to display the filename and linenumber of any memory allocations 00120 // that are not released at program exit 00121 #define new CAM_DEBUG_NEW 00122 00123 /******************************************************************************************** 00124 00125 > virtual UINT32 OpSaveAsWeb::GetSearchFilterId() 00126 00127 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00128 Created: 16/7/96 00129 Inputs: - 00130 Returns: The id of the filter to search for. 00131 Purpose: To allow different ops to just specify different filters and reuse 00132 the same operation code to save out the file in different file 00133 formats. 00134 00135 ********************************************************************************************/ 00136 00137 UINT32 OpSaveAsWeb::GetSearchFilterId() 00138 { 00139 return FILTERID_WEB; 00140 } 00141 00142 /******************************************************************************************** 00143 00144 > virtual BOOL OpSaveAsWeb::FixFileType() 00145 00146 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00147 Created: 1/8/96 00148 Inputs: - 00149 Outputs: - 00150 Returns: TRUE if fixing is required, FALSE otherwise 00151 Purpose: To determine whether this operation requires the file type or extension on 00152 the specified file path to be correct and match the filter we are about to use. 00153 This baseclass version says no as the old native save operation did not do 00154 it. 00155 00156 ********************************************************************************************/ 00157 00158 BOOL OpSaveAsWeb::FixFileType() 00159 { 00160 // Say we do not want it in this baseclass version 00161 return TRUE; 00162 } 00163 00164 /******************************************************************************************** 00165 00166 > BOOL OpSaveAsWeb::Init() 00167 00168 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00169 Created: 16/7/96 00170 Returns: TRUE if it worked, FALSE if not 00171 Purpose: Registers the OpDescriptor for the Save Operation. 00172 00173 ********************************************************************************************/ 00174 00175 BOOL OpSaveAsWeb::Init() 00176 { 00177 BOOL InitOK = TRUE; 00178 00179 // Register the save as web op desciptor 00180 InitOK = RegisterOpDescriptor( 00181 0, // Tool ID 00182 _R(IDS_SAVEASWEB), // String resource ID 00183 CC_RUNTIME_CLASS(OpSaveAsWeb), // Runtime class 00184 OPTOKEN_SAVEASWEB, // Token string 00185 GetState, // GetState function 00186 0, // help ID 00187 _R(IDBBL_SAVEASWEB), // bubble help 00188 0, //_R(IDD_BARCONTROLSTORE), // resource ID 00189 0, //_R(IDC_FILESAVETEMPLATE), // control ID 00190 SYSTEMBAR_ILLEGAL, // Bar ID 00191 TRUE, // Recieve system messages 00192 FALSE, // Smart duplicate operation 00193 TRUE, // Clean operation 00194 0, // No vertical counterpart 00195 0, // String for one copy only error 00196 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags 00197 ); 00198 if (!InitOK) return FALSE; 00199 00200 // All worked 00201 return TRUE; 00202 } 00203 00204 /******************************************************************************************** 00205 00206 > OpState OpSaveAsWeb::GetState(String_256*, OpDescriptor*) 00207 00208 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00209 Created: 16/7/96 00210 Purpose: The OpState function 00211 00212 ********************************************************************************************/ 00213 00214 OpState OpSaveAsWeb::GetState(String_256*, OpDescriptor*) 00215 { 00216 OpState Blobby; 00217 return Blobby; 00218 } 00219 00220 00221 00222 /******************************************************************************************** 00223 / ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/ 00224 ********************************************************************************************/ 00225 00226 00227 /******************************************************************************************** 00228 00229 > virtual UINT32 OpSaveAsNativeV2::GetSearchFilterId() 00230 00231 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00232 Created: 16/7/96 00233 Inputs: - 00234 Returns: The id of the filter to search for. 00235 Purpose: To allow different ops to just specify different filters and reuse 00236 the same operation code to save out the file in different file 00237 formats. 00238 00239 ********************************************************************************************/ 00240 00241 UINT32 OpSaveAsNativeV2::GetSearchFilterId() 00242 { 00243 return FILTERID_NATIVE; 00244 } 00245 00246 /******************************************************************************************** 00247 00248 > virtual BOOL OpSaveAsNativeV2::FixFileType() 00249 00250 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00251 Created: 1/8/96 00252 Inputs: - 00253 Outputs: - 00254 Returns: TRUE if fixing is required, FALSE otherwise 00255 Purpose: To determine whether this operation requires the file type or extension on 00256 the specified file path to be correct and match the filter we are about to use. 00257 This baseclass version says no as the old native save operation did not do 00258 it. 00259 00260 ********************************************************************************************/ 00261 00262 BOOL OpSaveAsNativeV2::FixFileType() 00263 { 00264 // Say we do not want it in this baseclass version 00265 return TRUE; 00266 } 00267 00268 /******************************************************************************************** 00269 00270 > BOOL OpSaveAsNativeV2::Init() 00271 00272 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00273 Created: 16/7/96 00274 Returns: TRUE if it worked, FALSE if not 00275 Purpose: Registers the OpDescriptor for the Save Operation. 00276 00277 ********************************************************************************************/ 00278 00279 BOOL OpSaveAsNativeV2::Init() 00280 { 00281 BOOL InitOK = TRUE; 00282 00283 // Register the save as web op desciptor 00284 InitOK = RegisterOpDescriptor( 00285 0, // Tool ID 00286 _R(IDS_SAVEASNATIVEV2), // String resource ID 00287 CC_RUNTIME_CLASS(OpSaveAsNativeV2), // Runtime class 00288 OPTOKEN_SAVEASNATIVEV2, // Token string 00289 GetState, // GetState function 00290 0, // help ID 00291 _R(IDBBL_SAVEASNATIVEV2), // bubble help 00292 0, //_R(IDD_BARCONTROLSTORE), // resource ID 00293 0, //_R(IDC_FILESAVETEMPLATE), // control ID 00294 SYSTEMBAR_ILLEGAL, // Bar ID 00295 TRUE, // Recieve system messages 00296 FALSE, // Smart duplicate operation 00297 TRUE, // Clean operation 00298 0, // No vertical counterpart 00299 0, // String for one copy only error 00300 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags 00301 ); 00302 if (!InitOK) return FALSE; 00303 00304 // All worked 00305 return TRUE; 00306 } 00307 00308 /******************************************************************************************** 00309 00310 > OpState OpSaveAsNativeV2::GetState(String_256*, OpDescriptor*) 00311 00312 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00313 Created: 16/7/96 00314 Purpose: The OpState function 00315 00316 ********************************************************************************************/ 00317 00318 OpState OpSaveAsNativeV2::GetState(String_256*, OpDescriptor*) 00319 { 00320 OpState Blobby; 00321 return Blobby; 00322 } 00323 00324