1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 // ============================================================================
22 #ifndef SCUI_ASCIIOPT_HXX
23 #define SCUI_ASCIIOPT_HXX
26 #include "asciiopt.hxx"
27 #include "svx/langbox.hxx"
29 // ============================================================================
31 class ScImportAsciiDlg
: public ModalDialog
33 SvStream
* mpDatStream
;
34 sal_uLong mnStreamPos
;
35 sal_uLong
* mpRowPosArray
;
36 sal_uLong mnRowPosCount
;
38 OUString maPreviewLine
[ CSV_PREVIEW_LINES
];
40 FixedText
* pFtCharSet
;
42 SvxTextEncodingBox
* pLbCharSet
;
44 FixedText
* pFtCustomLang
;
46 SvxLanguageBox
* pLbCustomLang
;
51 RadioButton
* pRbFixed
;
52 RadioButton
* pRbSeparated
;
55 CheckBox
* pCkbSemicolon
;
62 FixedText
* pFtTextSep
;
65 CheckBox
* pCkbQuotedAsText
;
66 CheckBox
* pCkbDetectNumber
;
71 ScCsvTableBox
* mpTableBox
;
73 OUString aCharSetUser
;
75 OUString aTextSepList
;
76 OUString maFieldSeparators
; // selected field separators
77 sal_Unicode mcTextSep
;
79 rtl_TextEncoding meCharSet
; /// Selected char set.
80 bool mbCharSetSystem
; /// Is System char set selected?
81 ScImportAsciiCall meCall
; /// How the dialog is called (see asciiopt.hxx)
85 Window
* pParent
, OUString aDatName
,
86 SvStream
* pInStream
, ScImportAsciiCall eCall
);
89 void GetOptions( ScAsciiOptions
& rOpt
);
90 void SaveParameters();
93 /** Sets the selected char set data to meCharSet and mbCharSetSystem. */
94 void SetSelectedCharSet();
95 /** Set separators in ui from maFieldSeparators */
97 /** Returns all separator characters in a string. */
98 OUString
GetSeparators() const;
100 /** Enables or disables all separator checkboxes and edit fields. */
101 void SetupSeparatorCtrls();
104 bool GetLine( sal_uLong nLine
, OUString
&rText
);
105 void UpdateVertical();
106 inline bool Seek( sal_uLong nPos
); // synced to and from mnStreamPos
108 DECL_LINK( CharSetHdl
, SvxTextEncodingBox
* );
109 DECL_LINK( FirstRowHdl
, NumericField
* );
110 DECL_LINK( RbSepFixHdl
, RadioButton
* );
111 DECL_LINK( SeparatorHdl
, Control
* );
112 DECL_LINK( LbColTypeHdl
, ListBox
* );
113 DECL_LINK(UpdateTextHdl
, void *);
114 DECL_LINK( ColTypeHdl
, ScCsvTableBox
* );
118 inline bool ScImportAsciiDlg::Seek(sal_uLong nPos
)
120 bool bSuccess
= true;
121 if (nPos
!= mnStreamPos
&& mpDatStream
)
123 if (mpDatStream
->Seek( nPos
) != nPos
)
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */