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: gridwizard.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 _EXTENSIONS_DBP_GRIDWIZARD_HXX_
32 #define _EXTENSIONS_DBP_GRIDWIZARD_HXX_
34 #include "controlwizard.hxx"
35 #include "commonpagesdbp.hxx"
37 //.........................................................................
40 //.........................................................................
42 //=====================================================================
44 //=====================================================================
45 struct OGridSettings
: public OControlWizardSettings
47 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> aSelectedFields
;
50 //=====================================================================
52 //=====================================================================
53 class OGridWizard
: public OControlWizard
56 OGridSettings m_aSettings
;
57 sal_Bool m_bHadDataSelection
: 1;
62 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxObjectModel
,
63 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
66 OGridSettings
& getSettings() { return m_aSettings
; }
69 // OWizardMachine overridables
70 virtual ::svt::OWizardPage
* createPage( WizardState _nState
);
71 virtual WizardState
determineNextState( WizardState _nCurrentState
) const;
72 virtual void enterState( WizardState _nState
);
73 virtual sal_Bool
leaveState( WizardState _nState
);
75 virtual sal_Bool
onFinish(sal_Int32 _nResult
);
77 virtual sal_Bool
approveControl(sal_Int16 _nClassId
);
80 void implApplySettings();
83 //=====================================================================
85 //=====================================================================
86 class OGridPage
: public OControlWizardPage
89 OGridPage( OGridWizard
* _pParent
, const ResId
& _rId
) : OControlWizardPage(_pParent
, _rId
) { }
92 OGridSettings
& getSettings() { return static_cast<OGridWizard
*>(getDialog())->getSettings(); }
95 //=====================================================================
96 //= OGridFieldsSelection
97 //=====================================================================
98 class OGridFieldsSelection
: public OGridPage
102 FixedText m_aExistFieldsLabel
;
103 ListBox m_aExistFields
;
104 PushButton m_aSelectOne
;
105 PushButton m_aSelectAll
;
106 PushButton m_aDeselectOne
;
107 PushButton m_aDeselectAll
;
108 FixedText m_aSelFieldsLabel
;
109 ListBox m_aSelFields
;
112 OGridFieldsSelection( OGridWizard
* _pParent
);
115 // TabPage overridables
116 virtual void ActivatePage();
118 // OWizardPage overridables
119 virtual void initializePage();
120 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
121 virtual bool canAdvance() const;
124 DECL_LINK(OnMoveOneEntry
, PushButton
*);
125 DECL_LINK(OnMoveAllEntries
, PushButton
*);
126 DECL_LINK(OnEntrySelected
, ListBox
*);
127 DECL_LINK(OnEntryDoubleClicked
, ListBox
*);
129 void implCheckButtons();
130 void implApplySettings();
132 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> implGetColumns(sal_Bool _bShowError
= sal_True
);
135 //.........................................................................
137 //.........................................................................
139 #endif // _EXTENSIONS_DBP_GRIDWIZARD_HXX_