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 #ifndef INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX
23 #include "controlwizard.hxx"
24 #include <vcl/fixed.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <com/sun/star/sdb/XDatabaseContext.hpp>
32 class OTableSelectionPage
: public OControlWizardPage
35 VclPtr
<FixedText
> m_pDatasourceLabel
;
36 VclPtr
<ListBox
> m_pDatasource
;
37 VclPtr
<PushButton
> m_pSearchDatabase
;
38 VclPtr
<ListBox
> m_pTable
;
40 ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::XDatabaseContext
>
44 OTableSelectionPage(OControlWizard
* _pParent
);
45 virtual ~OTableSelectionPage();
46 virtual void dispose() SAL_OVERRIDE
;
49 // TabPage overridables
50 void ActivatePage() SAL_OVERRIDE
;
52 // OWizardPage overridables
53 virtual void initializePage() SAL_OVERRIDE
;
54 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason
) SAL_OVERRIDE
;
57 DECL_LINK( OnListboxSelection
, ListBox
* );
58 DECL_LINK( OnListboxDoubleClicked
, ListBox
* );
59 DECL_LINK( OnSearchClicked
, PushButton
* );
61 void implCollectDatasource();
62 void implFillTables(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>&
63 _rxConn
= ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>());
65 // OControlWizardPage overridables
66 virtual bool canAdvance() const SAL_OVERRIDE
;
69 class OMaybeListSelectionPage
: public OControlWizardPage
72 VclPtr
<RadioButton
> m_pYes
;
73 VclPtr
<RadioButton
> m_pNo
;
74 VclPtr
<ListBox
> m_pList
;
77 OMaybeListSelectionPage( OControlWizard
* _pParent
, const OString
& _rID
, const OUString
& _rUIXMLDescription
);
78 virtual ~OMaybeListSelectionPage();
79 virtual void dispose() SAL_OVERRIDE
;
82 DECL_LINK( OnRadioSelected
, RadioButton
* );
84 // TabPage overridables
85 void ActivatePage() SAL_OVERRIDE
;
88 void announceControls(
89 RadioButton
& _rYesButton
,
90 RadioButton
& _rNoButton
,
91 ListBox
& _rSelection
);
93 void implEnableWindows();
95 void implInitialize(const OUString
& _rSelection
);
96 void implCommit(OUString
& _rSelection
);
99 class ODBFieldPage
: public OMaybeListSelectionPage
102 VclPtr
<FixedText
> m_pDescription
;
103 VclPtr
<RadioButton
> m_pStoreYes
;
104 VclPtr
<RadioButton
> m_pStoreNo
;
105 VclPtr
<ListBox
> m_pStoreWhere
;
108 ODBFieldPage( OControlWizard
* _pParent
);
109 virtual ~ODBFieldPage();
110 virtual void dispose() SAL_OVERRIDE
;
113 void setDescriptionText(const OUString
& _rDesc
) { m_pDescription
->SetText(_rDesc
); }
115 // OWizardPage overridables
116 virtual void initializePage() SAL_OVERRIDE
;
117 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason
) SAL_OVERRIDE
;
120 virtual OUString
& getDBFieldSetting() = 0;
128 #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */