00001 // $Id: impexpop.h 1688 2006-08-10 12:05:20Z gerry $ 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 // The operations for importing and exporting using the filter system. 00100 00101 #ifndef INC_IMPORTEXPORTOP 00102 #define INC_IMPORTEXPORTOP 00103 00104 //#include "filters.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00105 //#include "selop.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 //#include "bmpsdlg.h" 00107 00108 // These used to be are OILy as they used to invoke common dialogs etc 00109 // and hence used to be in OilFltrs.h/cpp 00110 // Moved to new kernel based impexpop.h/cpp 4/1/96 as there is now a class, BaseFileDialog 00111 // and derived classes which handle all of the OILy based common dialog functionality 00112 00113 class BmpDlgParam; 00114 class PathName; 00115 00116 00117 /******************************************************************************************** 00118 00119 > class OpMenuImport : public SelOperation 00120 00121 Author: Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> 00122 Created: 08/03/94 00123 Purpose: Pops up a common dialog to allow the user to import a file into Camelot 00124 using any of the available import filters. 00125 SeeAlso: OpMenuExport; OpDroppedFile 00126 00127 ********************************************************************************************/ 00128 00129 // Operation token for the OpMenuImport class 00130 #define OPTOKEN_MENUIMPORT _T("Import") 00131 00132 class OpMenuImport : public SelOperation 00133 { 00134 CC_DECLARE_DYNCREATE(OpMenuImport) 00135 00136 public: 00137 OpMenuImport(); 00138 00139 void Do(OpDescriptor*); 00140 00141 static BOOL Init(); 00142 static OpState GetState(String_256*, OpDescriptor*); 00143 void DoImport(PathName Path, Filter* pFilter, String_256* URL, ImportPosition* pImportPosition=NULL); 00144 void EndImport(); 00145 00146 virtual BOOL OnDocChangingMsg(Document* pChangingDoc, DocChangingMsg::DocState State); 00147 00148 // Karim 21/01/2000 - see UndoableOperation base implementation. 00149 virtual BOOL MayChangeNodeBounds() const { return FALSE; } 00150 00151 private: 00152 TCHAR *FilterString; 00153 static UINT32 SelectedFilterID; 00154 static INT32 SelectedFilter; 00155 00156 00157 public: 00158 // The preference for the import path 00159 static String_256 DefaultImportFilterPath; 00160 }; 00161 00162 00163 00164 /******************************************************************************************** 00165 > class BitmapExportParam : public OpParam 00166 00167 Author: Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com> 00168 Created: 11/6/96 00169 Purpose: Passes infomation about bitmap(s) to export 00170 SeeAlso: OpParam 00171 ********************************************************************************************/ 00172 00173 class BitmapExportParam : public OpParam 00174 { 00175 CC_DECLARE_DYNAMIC(BitmapExportParam); 00176 00177 public: 00178 BitmapExportParam(); 00179 BitmapExportParam(UINT32 Count, KernelBitmap** pBitmap, BmpDlgParam* pParam); 00180 BmpDlgParam* GetBmpDlgParam() { return m_pBmpDlgParam; } 00181 BOOL SetBmpDlgParam (BmpDlgParam* pParam); 00182 00183 // Access functions with helpful checking 00184 virtual UINT32 GetBitmapCount(); 00185 virtual KernelBitmap* GetBitmap(UINT32 Index); 00186 00187 // We cannot store layers but this removes IS_KIND_OFs when using GIFAnimationExportParam 00188 virtual Layer * GetLayer(UINT32 Index) { return NULL; } 00189 virtual UINT32 GetLayerCount() { return 0; } 00190 00191 protected: 00192 BmpDlgParam* m_pBmpDlgParam; 00193 }; 00194 00195 00196 00197 /******************************************************************************************** 00198 00199 > class OpMenuExport : public Operation 00200 00201 Author: Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> 00202 Created: 08/03/94 00203 Purpose: Pops up a common dialog to allow theuser to export a file from Camelot 00204 using any of the available import filters. 00205 SeeAlso: OpMenuImport; OpDroppedFile 00206 00207 ********************************************************************************************/ 00208 00209 // Operation token for the OpMenuExport class 00210 #define OPTOKEN_MENUEXPORT _T("Export") 00211 00212 class OpMenuExport : public SelOperation 00213 { 00214 public: 00215 void Do(OpDescriptor*); 00216 void DoWithParam(OpDescriptor*, OpParam*); 00217 00218 static BOOL Init(); 00219 static OpState GetState(String_256*, OpDescriptor*); 00220 00221 static void SaveSelection(); 00222 static void NormaliseSelection(); 00223 static void RestoreSelection(); 00224 00225 protected: 00226 void CreateNamedSet(Filter* pFilter, const PathName& pthTarget); 00227 BOOL SetBitmapName(KernelBitmap* pTheBitmap, String_256* DefaultName, 00228 BitmapExportParam* pExportParam = 0); 00229 00230 public: 00231 // The preference for the export path 00232 static String_256 DefaultExportFilterPath; 00233 00234 private: 00235 TCHAR* FilterString; 00236 00237 static UINT32 SelectedFilterID; 00238 static INT32 SelectedFilter; 00239 static UINT32 DefaultBitmapFilterID; 00240 static INT32 SelectedBitmapFilter; 00241 static List* m_pSelNodeList; 00242 00243 CC_DECLARE_DYNCREATE(OpMenuExport); 00244 }; 00245 00246 00247 00248 class FileDropInfo 00249 { 00250 public: 00251 FileDropInfo() {} 00252 FileDropInfo(WinCoord Point) 00253 { 00254 m_DropPoint = Point; 00255 } 00256 00257 ~FileDropInfo() 00258 { 00259 m_FileList.DeleteAll(); 00260 } 00261 00262 WinCoord GetDropPoint() { return(m_DropPoint); } 00263 List* GetFileList() { return(&m_FileList); } 00264 00265 protected: 00266 List m_FileList; 00267 WinCoord m_DropPoint; 00268 }; 00269 00270 00271 00272 00273 /******************************************************************************************** 00274 00275 > class OpDroppedFile : public Operation 00276 00277 Author: Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> 00278 Created: 08/03/94 00279 Purpose: Responds to the user dragging and dropping a file onto Camelot - it 00280 attempts to deduce which import filter should be used to load the file. 00281 If for any reason it cannot work out which filter to use, a dialog is 00282 popped up to allow the user to select the filter they want to use. 00283 SeeAlso: OpMenuImport; OpMenuExport 00284 00285 ********************************************************************************************/ 00286 00287 // Operation token for the OpDroppedFile class 00288 #define OPTOKEN_DROPPEDFILE _T("DroppedFile") 00289 00290 class OpDroppedFile : public SelOperation 00291 { 00292 CC_DECLARE_DYNCREATE(OpDroppedFile) 00293 00294 public: 00295 void DoWithParam(OpDescriptor*, OpParam*); 00296 00297 static BOOL Init(); 00298 static OpState GetState(String_256*, OpDescriptor*); 00299 00300 // Karim 21/01/2000 - see UndoableOperation base implementation. 00301 virtual BOOL MayChangeNodeBounds() const { return FALSE; } 00302 }; 00303 00304 #endif // !INC_IMPORTEXPORTOP