xref: /aoo42x/main/sc/source/ui/inc/imoptdlg.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_IMOPTDLG_HXX
25 #define SC_IMOPTDLG_HXX
26 
27 #include <vcl/dialog.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/combobox.hxx>
30 #include <vcl/lstbox.hxx>
31 #include <vcl/button.hxx>
32 #include <svx/txencbox.hxx>
33 #include "scdllapi.h"
34 #include "global.hxx"
35 
36 //===================================================================
37 
38 class SC_DLLPUBLIC ScImportOptions
39 {
40 public:
ScImportOptions()41 		ScImportOptions()
42             : nFieldSepCode(0), nTextSepCode(0),
43             eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(sal_False),
44             bSaveAsShown(sal_False), bQuoteAllText(sal_False)
45 		{}
46 		ScImportOptions( const String& rStr );
47 
ScImportOptions(sal_Unicode nFieldSep,sal_Unicode nTextSep,const String & rStr)48 		ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, const String& rStr )
49             : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), aStrFont(rStr),
50             bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
51 		{ eCharSet = ScGlobal::GetCharsetValue(aStrFont); }
52 
ScImportOptions(sal_Unicode nFieldSep,sal_Unicode nTextSep,rtl_TextEncoding nEnc)53 		ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, rtl_TextEncoding nEnc )
54             : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep),
55             bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
56 		{ SetTextEncoding( nEnc ); }
57 
ScImportOptions(const ScImportOptions & rCpy)58 		ScImportOptions( const ScImportOptions& rCpy )
59 			: nFieldSepCode		(rCpy.nFieldSepCode),
60 			  nTextSepCode		(rCpy.nTextSepCode),
61 			  aStrFont			(rCpy.aStrFont),
62               eCharSet      	(rCpy.eCharSet),
63               bFixedWidth   	(rCpy.bFixedWidth),
64               bSaveAsShown	    (rCpy.bSaveAsShown),
65               bQuoteAllText     (rCpy.bQuoteAllText)
66 		{}
67 
operator =(const ScImportOptions & rCpy)68 	ScImportOptions& operator=( const ScImportOptions& rCpy )
69 						{
70 							nFieldSepCode 	= rCpy.nFieldSepCode;
71 							nTextSepCode  	= rCpy.nTextSepCode;
72 							aStrFont	  	= rCpy.aStrFont;
73 							eCharSet	  	= rCpy.eCharSet;
74                             bFixedWidth   	= rCpy.bFixedWidth;
75                             bSaveAsShown    = rCpy.bSaveAsShown;
76                             bQuoteAllText   = rCpy.bQuoteAllText;
77 							return *this;
78 						}
79 
operator ==(const ScImportOptions & rCmp)80 	sal_Bool			 operator==( const ScImportOptions& rCmp )
81 						{
82 							return
83 								   nFieldSepCode 	== rCmp.nFieldSepCode
84 								&& nTextSepCode  	== rCmp.nTextSepCode
85 								&& eCharSet		 	== rCmp.eCharSet
86                                 && aStrFont      	== rCmp.aStrFont
87                                 && bFixedWidth   	== rCmp.bFixedWidth
88                                 && bSaveAsShown     == rCmp.bSaveAsShown
89                                 && bQuoteAllText    == rCmp.bQuoteAllText;
90 						}
91 	String	BuildString() const;
92 
93 	void	SetTextEncoding( rtl_TextEncoding nEnc );
94 
95     sal_Unicode nFieldSepCode;
96     sal_Unicode nTextSepCode;
97     String      aStrFont;
98     CharSet     eCharSet;
99     sal_Bool    bFixedWidth;
100     sal_Bool    bSaveAsShown;
101     sal_Bool    bQuoteAllText;
102 };
103 
104 
105 #endif // SC_IMOPTDLG_HXX
106 
107 
108 
109