Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / source / ui / dlg / TextConnectionHelper.hxx
blob8c1d0aa0c0fd63a3d5455a9808c93c3fa181af6f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef DBAUI_TEXTCONNECTIONHELPER_HXX
30 #define DBAUI_TEXTCONNECTIONHELPER_HXX
32 #include "ConnectionPageSetup.hxx"
33 #include "adminpages.hxx"
34 #include "charsetlistbox.hxx"
35 #include <ucbhelper/content.hxx>
36 #include "curledit.hxx"
37 #include <svtools/roadmapwizard.hxx>
38 #include <vcl/field.hxx>
39 #include <rtl/ustring.hxx>
40 #include <vcl/lstbox.hxx>
43 //.........................................................................
44 namespace dbaui
47 //.........................................................................
49 #define TC_EXTENSION ((short)0x01) // a section specifying the extension of the files to connect to
50 #define TC_SEPARATORS ((short)0x02) // a section specifying the various separators
51 #define TC_HEADER ((short)0x04) // a section containing the "Text contains header" check box only
52 #define TC_CHARSET ((short)0x08) // not yet implemented
54 //========================================================================
55 //= OTextConnectionPage
56 //========================================================================
57 class OTextConnectionHelper : public Control
59 OTextConnectionHelper();
61 Link m_aModifiedHandler; /// to be called if something on the page has been modified
63 public:
64 OTextConnectionHelper( Window* pParent, const short _nAvailableSections );
65 virtual ~OTextConnectionHelper();
67 private:
68 FixedText m_aFTExtensionHeader;
69 RadioButton m_aRBAccessTextFiles;
70 RadioButton m_aRBAccessCSVFiles;
71 RadioButton m_aRBAccessOtherFiles;
72 Edit m_aETOwnExtension;
73 FixedText m_aFTExtensionExample;
74 FixedLine m_aLineFormat;
75 FixedText m_aFieldSeparatorLabel;
76 ComboBox m_aFieldSeparator;
77 FixedText m_aTextSeparatorLabel;
78 ComboBox m_aTextSeparator;
79 FixedText m_aDecimalSeparatorLabel;
80 ComboBox m_aDecimalSeparator;
81 FixedText m_aThousandsSeparatorLabel;
82 ComboBox m_aThousandsSeparator;
83 CheckBox m_aRowHeader;
84 FixedLine m_aCharSetHeader;
85 FixedText m_aCharSetLabel;
86 CharSetListBox m_aCharSet;
87 String m_aFieldSeparatorList;
88 String m_aTextSeparatorList;
89 String m_aTextNone;
90 String m_aOldExtension;
91 Link m_aGetExtensionHandler; /// to be called if a new type is selected
93 short m_nAvailableSections;
95 protected:
96 void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); }
97 Link getControlModifiedLink() { return LINK(this, OTextConnectionHelper, OnControlModified); }
98 DECL_LINK(OnSetExtensionHdl,RadioButton*);
99 DECL_LINK(OnControlModified,Control*);
100 DECL_LINK(OnEditModified,Edit*);
102 private:
103 String GetSeparator( const ComboBox& rBox, const String& rList );
104 void SetSeparator( ComboBox& rBox, const String& rList, const String& rVal );
105 void SetExtension(const String& _rVal);
108 public:
109 void implInitControls(const SfxItemSet& _rSet, sal_Bool _bValid);
110 void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
111 void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
112 void SetClickHandler(const Link& _rHandler) { m_aGetExtensionHandler = _rHandler; }
113 String GetExtension();
114 sal_Bool FillItemSet( SfxItemSet& rSet, const sal_Bool bChangedSomething );
115 sal_Bool prepareLeave();
118 //.........................................................................
119 } // namespace dbaui
120 //.........................................................................
122 #endif // DBAUI_DBWIZ2_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */