1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imoptdlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_IMOPTDLG_HXX
32 #define SC_IMOPTDLG_HXX
34 #include <vcl/dialog.hxx>
35 #include <vcl/fixed.hxx>
36 #include <vcl/combobox.hxx>
37 #include <vcl/lstbox.hxx>
38 #include <vcl/imagebtn.hxx>
39 #include <svx/txencbox.hxx>
43 //===================================================================
45 class SC_DLLPUBLIC ScImportOptions
49 : nFieldSepCode(0), nTextSepCode(0),
50 eCharSet(RTL_TEXTENCODING_DONTKNOW
), bFixedWidth(FALSE
),
53 ScImportOptions( const String
& rStr
);
55 ScImportOptions( sal_Unicode nFieldSep
, sal_Unicode nTextSep
, const String
& rStr
)
56 : nFieldSepCode(nFieldSep
), nTextSepCode(nTextSep
), aStrFont(rStr
),
57 bFixedWidth(FALSE
), bSaveAsShown(FALSE
)
58 { eCharSet
= ScGlobal::GetCharsetValue(aStrFont
); }
60 ScImportOptions( sal_Unicode nFieldSep
, sal_Unicode nTextSep
, rtl_TextEncoding nEnc
)
61 : nFieldSepCode(nFieldSep
), nTextSepCode(nTextSep
),
62 bFixedWidth(FALSE
), bSaveAsShown(FALSE
)
63 { SetTextEncoding( nEnc
); }
65 ScImportOptions( const ScImportOptions
& rCpy
)
66 : nFieldSepCode (rCpy
.nFieldSepCode
),
67 nTextSepCode (rCpy
.nTextSepCode
),
68 aStrFont (rCpy
.aStrFont
),
69 eCharSet (rCpy
.eCharSet
),
70 bFixedWidth (rCpy
.bFixedWidth
),
71 bSaveAsShown (rCpy
.bSaveAsShown
)
74 ScImportOptions
& operator=( const ScImportOptions
& rCpy
)
76 nFieldSepCode
= rCpy
.nFieldSepCode
;
77 nTextSepCode
= rCpy
.nTextSepCode
;
78 aStrFont
= rCpy
.aStrFont
;
79 eCharSet
= rCpy
.eCharSet
;
80 bFixedWidth
= rCpy
.bFixedWidth
;
81 bSaveAsShown
= rCpy
.bSaveAsShown
;
85 BOOL
operator==( const ScImportOptions
& rCmp
)
88 nFieldSepCode
== rCmp
.nFieldSepCode
89 && nTextSepCode
== rCmp
.nTextSepCode
90 && eCharSet
== rCmp
.eCharSet
91 && aStrFont
== rCmp
.aStrFont
92 && bFixedWidth
== rCmp
.bFixedWidth
93 && bSaveAsShown
== rCmp
.bSaveAsShown
;
95 String
BuildString() const;
97 void SetTextEncoding( rtl_TextEncoding nEnc
);
99 sal_Unicode nFieldSepCode
;
100 sal_Unicode nTextSepCode
;
108 #endif // SC_IMOPTDLG_HXX