fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / ui / inc / dbwiz.hxx
blobce534eba107d3cd73d287ddab371c962c10344df
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include "dsntypes.hxx"
25 #include "IItemSetHelper.hxx"
26 #include <comphelper/uno3.hxx>
27 #include <svtools/wizardmachine.hxx>
28 #include "moduledbu.hxx"
29 #include <memory>
31 namespace com { namespace sun { namespace star {
32 namespace beans {
33 class XPropertySet;
35 namespace sdbc {
36 class XConnection;
38 namespace lang {
39 class XMultiServiceFactory;
41 }}}
43 namespace dbaccess
45 class ODsnTypeCollection;
47 namespace dbaui
50 // ODbTypeWizDialog
51 class OGeneralPage;
52 class ODbDataSourceAdministrationHelper;
53 /** tab dialog for administrating the office wide registered data sources
55 class ODbTypeWizDialog : public svt::OWizardMachine , public IItemSetHelper, public IDatabaseSettingsDialog,public dbaui::OModuleClient
57 private:
58 OModuleClient m_aModuleClient;
59 ::std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
60 SfxItemSet* m_pOutSet;
61 ::dbaccess::ODsnTypeCollection*
62 m_pCollection; /// the DSN type collection instance
63 OUString m_eType;
65 bool m_bResetting : 1; /// sal_True while we're resetting the pages
66 bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing
67 bool m_bUIEnabled : 1; /// <TRUE/> if the UI is enabled, false otherwise. Cannot be switched back to <TRUE/>, once it is <FALSE/>
69 public:
70 /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed
71 after the dialog has been destroyed
73 ODbTypeWizDialog(vcl::Window* pParent
74 ,SfxItemSet* _pItems
75 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB
76 ,const ::com::sun::star::uno::Any& _aDataSourceName
78 virtual ~ODbTypeWizDialog();
79 virtual void dispose() SAL_OVERRIDE;
81 virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE;
82 virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE;
84 // forwards to ODbDataSourceAdministrationHelper
85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getORB() const SAL_OVERRIDE;
86 virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection() SAL_OVERRIDE;
87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver() SAL_OVERRIDE;
88 virtual OUString getDatasourceType(const SfxItemSet& _rSet) const SAL_OVERRIDE;
89 virtual void clearPassword() SAL_OVERRIDE;
90 virtual bool saveDatasource() SAL_OVERRIDE;
91 virtual void setTitle(const OUString& _sTitle) SAL_OVERRIDE;
92 virtual void enableConfirmSettings( bool _bEnable ) SAL_OVERRIDE;
94 protected:
95 /// to override to create new pages
96 virtual VclPtr<TabPage> createPage(WizardState _nState) SAL_OVERRIDE;
97 virtual WizardState determineNextState(WizardState _nCurrentState) const SAL_OVERRIDE;
98 virtual bool leaveState(WizardState _nState) SAL_OVERRIDE;
99 virtual ::svt::IWizardPageController*
100 getPageController( TabPage* _pCurrentPage ) const SAL_OVERRIDE;
101 virtual bool onFinish() SAL_OVERRIDE;
103 protected:
104 inline bool isUIEnabled() const { return m_bUIEnabled; }
105 inline void disabledUI() { m_bUIEnabled = false; }
107 /// select a datasource with a given name, adjust the item set accordingly, and everything like that ..
108 void implSelectDatasource(const OUString& _rRegisteredName);
109 void resetPages(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDatasource);
111 enum ApplyResult
113 AR_LEAVE_MODIFIED, // something was modified and has successfully been committed
114 AR_LEAVE_UNCHANGED, // no changes were made
115 AR_KEEP // don't leave the page (e.g. because an error occurred)
117 /** apply all changes made
119 ApplyResult implApplyChanges();
121 private:
122 DECL_LINK(OnTypeSelected, OGeneralPage*);
125 } // namespace dbaui
127 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */