Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef DBAUI_TEXTCONNECTIONHELPER_HXX
21 : : #define DBAUI_TEXTCONNECTIONHELPER_HXX
22 : :
23 : : #include "ConnectionPageSetup.hxx"
24 : : #include "adminpages.hxx"
25 : : #include "charsetlistbox.hxx"
26 : : #include <ucbhelper/content.hxx>
27 : : #include "curledit.hxx"
28 : : #include <svtools/roadmapwizard.hxx>
29 : : #include <vcl/field.hxx>
30 : : #include <rtl/ustring.hxx>
31 : : #include <vcl/lstbox.hxx>
32 : :
33 : :
34 : : //.........................................................................
35 : : namespace dbaui
36 : :
37 : : {
38 : : //.........................................................................
39 : :
40 : : #define TC_EXTENSION ((short)0x01) // a section specifying the extension of the files to connect to
41 : : #define TC_SEPARATORS ((short)0x02) // a section specifying the various separators
42 : : #define TC_HEADER ((short)0x04) // a section containing the "Text contains header" check box only
43 : : #define TC_CHARSET ((short)0x08) // not yet implemented
44 : :
45 : : //========================================================================
46 : : //= OTextConnectionPage
47 : : //========================================================================
48 : : class OTextConnectionHelper : public Control
49 : : {
50 : : OTextConnectionHelper();
51 : :
52 : : Link m_aModifiedHandler; /// to be called if something on the page has been modified
53 : :
54 : : public:
55 : : OTextConnectionHelper( Window* pParent, const short _nAvailableSections );
56 : : virtual ~OTextConnectionHelper();
57 : :
58 : : private:
59 : : FixedText m_aFTExtensionHeader;
60 : : RadioButton m_aRBAccessTextFiles;
61 : : RadioButton m_aRBAccessCSVFiles;
62 : : RadioButton m_aRBAccessOtherFiles;
63 : : Edit m_aETOwnExtension;
64 : : FixedText m_aFTExtensionExample;
65 : : FixedLine m_aLineFormat;
66 : : FixedText m_aFieldSeparatorLabel;
67 : : ComboBox m_aFieldSeparator;
68 : : FixedText m_aTextSeparatorLabel;
69 : : ComboBox m_aTextSeparator;
70 : : FixedText m_aDecimalSeparatorLabel;
71 : : ComboBox m_aDecimalSeparator;
72 : : FixedText m_aThousandsSeparatorLabel;
73 : : ComboBox m_aThousandsSeparator;
74 : : CheckBox m_aRowHeader;
75 : : FixedLine m_aCharSetHeader;
76 : : FixedText m_aCharSetLabel;
77 : : CharSetListBox m_aCharSet;
78 : : String m_aFieldSeparatorList;
79 : : String m_aTextSeparatorList;
80 : : String m_aTextNone;
81 : : String m_aOldExtension;
82 : : Link m_aGetExtensionHandler; /// to be called if a new type is selected
83 : :
84 : : short m_nAvailableSections;
85 : :
86 : : protected:
87 [ # # ]: 0 : void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); }
88 : 0 : Link getControlModifiedLink() { return LINK(this, OTextConnectionHelper, OnControlModified); }
89 : : DECL_LINK(OnSetExtensionHdl,RadioButton*);
90 : : DECL_LINK(OnControlModified,Control*);
91 : : DECL_LINK(OnEditModified,Edit*);
92 : :
93 : : private:
94 : : String GetSeparator( const ComboBox& rBox, const String& rList );
95 : : void SetSeparator( ComboBox& rBox, const String& rList, const String& rVal );
96 : : void SetExtension(const String& _rVal);
97 : :
98 : :
99 : : public:
100 : : void implInitControls(const SfxItemSet& _rSet, sal_Bool _bValid);
101 : : void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
102 : : void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
103 : 0 : void SetClickHandler(const Link& _rHandler) { m_aGetExtensionHandler = _rHandler; }
104 : : String GetExtension();
105 : : sal_Bool FillItemSet( SfxItemSet& rSet, const sal_Bool bChangedSomething );
106 : : sal_Bool prepareLeave();
107 : : };
108 : :
109 : : //.........................................................................
110 : : } // namespace dbaui
111 : : //.........................................................................
112 : :
113 : : #endif // DBAUI_DBWIZ2_HXX
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|