xref: /aoo41x/main/sc/source/ui/inc/imoptdlg.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_IMOPTDLG_HXX
29 #define SC_IMOPTDLG_HXX
30 
31 #include <vcl/dialog.hxx>
32 #include <vcl/fixed.hxx>
33 #include <vcl/combobox.hxx>
34 #include <vcl/lstbox.hxx>
35 #include <vcl/button.hxx>
36 #include <svx/txencbox.hxx>
37 #include "scdllapi.h"
38 #include "global.hxx"
39 
40 //===================================================================
41 
42 class SC_DLLPUBLIC ScImportOptions
43 {
44 public:
45 		ScImportOptions()
46             : nFieldSepCode(0), nTextSepCode(0),
47             eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(sal_False),
48             bSaveAsShown(sal_False), bQuoteAllText(sal_False)
49 		{}
50 		ScImportOptions( const String& rStr );
51 
52 		ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, const String& rStr )
53             : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), aStrFont(rStr),
54             bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
55 		{ eCharSet = ScGlobal::GetCharsetValue(aStrFont); }
56 
57 		ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, rtl_TextEncoding nEnc )
58             : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep),
59             bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
60 		{ SetTextEncoding( nEnc ); }
61 
62 		ScImportOptions( const ScImportOptions& rCpy )
63 			: nFieldSepCode		(rCpy.nFieldSepCode),
64 			  nTextSepCode		(rCpy.nTextSepCode),
65 			  aStrFont			(rCpy.aStrFont),
66               eCharSet      	(rCpy.eCharSet),
67               bFixedWidth   	(rCpy.bFixedWidth),
68               bSaveAsShown	    (rCpy.bSaveAsShown),
69               bQuoteAllText     (rCpy.bQuoteAllText)
70 		{}
71 
72 	ScImportOptions& operator=( const ScImportOptions& rCpy )
73 						{
74 							nFieldSepCode 	= rCpy.nFieldSepCode;
75 							nTextSepCode  	= rCpy.nTextSepCode;
76 							aStrFont	  	= rCpy.aStrFont;
77 							eCharSet	  	= rCpy.eCharSet;
78                             bFixedWidth   	= rCpy.bFixedWidth;
79                             bSaveAsShown    = rCpy.bSaveAsShown;
80                             bQuoteAllText   = rCpy.bQuoteAllText;
81 							return *this;
82 						}
83 
84 	sal_Bool			 operator==( const ScImportOptions& rCmp )
85 						{
86 							return
87 								   nFieldSepCode 	== rCmp.nFieldSepCode
88 								&& nTextSepCode  	== rCmp.nTextSepCode
89 								&& eCharSet		 	== rCmp.eCharSet
90                                 && aStrFont      	== rCmp.aStrFont
91                                 && bFixedWidth   	== rCmp.bFixedWidth
92                                 && bSaveAsShown     == rCmp.bSaveAsShown
93                                 && bQuoteAllText    == rCmp.bQuoteAllText;
94 						}
95 	String	BuildString() const;
96 
97 	void	SetTextEncoding( rtl_TextEncoding nEnc );
98 
99     sal_Unicode nFieldSepCode;
100     sal_Unicode nTextSepCode;
101     String      aStrFont;
102     CharSet     eCharSet;
103     sal_Bool    bFixedWidth;
104     sal_Bool    bSaveAsShown;
105     sal_Bool    bQuoteAllText;
106 };
107 
108 
109 #endif // SC_IMOPTDLG_HXX
110 
111 
112 
113