2001-05-29 03:59:46 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* $RCSfile: generalpage.hxx,v $
|
2008-10-01 07:28:29 -05:00
|
|
|
* $Revision: 1.22.68.1 $
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
2008-04-10 08:55:04 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-05-29 03:59:46 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DBAUI_GENERALPAGE_HXX_
|
|
|
|
#define _DBAUI_GENERALPAGE_HXX_
|
|
|
|
|
|
|
|
#ifndef _DBAUI_ADMINPAGES_HXX_
|
|
|
|
#include "adminpages.hxx"
|
|
|
|
#endif
|
2005-06-30 10:33:40 -05:00
|
|
|
#ifndef DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX
|
|
|
|
#include "opendoccontrols.hxx"
|
|
|
|
#endif
|
2004-08-02 09:49:16 -05:00
|
|
|
#ifndef _SV_FIXED_HXX
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_LSTBOX_HXX
|
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_EDIT_HXX
|
|
|
|
#include <vcl/edit.hxx>
|
|
|
|
#endif
|
2007-11-21 08:58:12 -06:00
|
|
|
#include <svtools/dialogcontrolling.hxx>
|
2005-06-30 10:33:40 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2001-05-29 03:59:46 -05:00
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
2007-05-10 04:26:00 -05:00
|
|
|
class IDatabaseSettingsDialog;
|
2001-05-29 03:59:46 -05:00
|
|
|
//=========================================================================
|
|
|
|
//= OGeneralPage
|
|
|
|
//=========================================================================
|
|
|
|
class OGeneralPage : public OGenericAdministrationPage
|
|
|
|
{
|
2004-10-27 07:04:26 -05:00
|
|
|
OGeneralPage(Window* pParent, const SfxItemSet& _rItems, sal_Bool _bDBWizardMode = sal_False);
|
2005-06-30 10:33:40 -05:00
|
|
|
~OGeneralPage();
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum CreationMode
|
|
|
|
{
|
|
|
|
eCreateNew,
|
|
|
|
eConnectExternal,
|
|
|
|
eOpenExisting
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DocumentDescriptor
|
|
|
|
{
|
|
|
|
String sURL;
|
|
|
|
String sFilter;
|
|
|
|
};
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
// dialog controls
|
2004-10-29 07:16:53 -05:00
|
|
|
FixedText m_aFTHeaderText;
|
|
|
|
FixedText m_aFTHelpText;
|
|
|
|
FixedText m_aFT_DatasourceTypeHeader;
|
|
|
|
RadioButton m_aRB_CreateDatabase;
|
2005-06-30 10:33:40 -05:00
|
|
|
RadioButton m_aRB_OpenDocument;
|
2004-10-29 07:16:53 -05:00
|
|
|
RadioButton m_aRB_GetExistingDatabase;
|
2005-06-30 10:33:40 -05:00
|
|
|
FixedText m_aFT_DocListLabel;
|
|
|
|
::std::auto_ptr< OpenDocumentListBox >
|
|
|
|
m_pLB_DocumentList;
|
|
|
|
OpenDocumentButton m_aPB_OpenDocument;
|
2004-08-02 09:49:16 -05:00
|
|
|
FixedText m_aTypePreLabel;
|
2001-05-29 03:59:46 -05:00
|
|
|
FixedText m_aDatasourceTypeLabel;
|
2005-07-08 04:39:24 -05:00
|
|
|
::std::auto_ptr< ListBox >
|
|
|
|
m_pDatasourceType;
|
2004-10-29 07:16:53 -05:00
|
|
|
FixedText m_aFTDataSourceAppendix;
|
|
|
|
FixedText m_aTypePostLabel;
|
2001-05-29 03:59:46 -05:00
|
|
|
FixedText m_aSpecialMessage;
|
2004-10-27 07:04:26 -05:00
|
|
|
sal_Bool m_DBWizardMode;
|
|
|
|
String m_sMySQLEntry;
|
2005-06-30 10:33:40 -05:00
|
|
|
CreationMode m_eOriginalCreationMode;
|
|
|
|
DocumentDescriptor m_aBrowsedDocument;
|
|
|
|
|
2007-11-21 08:58:12 -06:00
|
|
|
::svt::ControlDependencyManager
|
|
|
|
m_aControlDependencies;
|
2009-07-03 07:24:35 -05:00
|
|
|
::std::vector< ::rtl::OUString> m_aURLPrefixes;
|
2004-10-27 07:04:26 -05:00
|
|
|
|
2001-05-29 03:59:46 -05:00
|
|
|
|
2008-10-01 07:28:29 -05:00
|
|
|
::dbaccess::ODsnTypeCollection*
|
|
|
|
m_pCollection; /// the DSN type collection instance
|
2009-07-03 07:24:35 -05:00
|
|
|
::rtl::OUString m_eCurrentSelection; /// currently selected type
|
2008-10-01 07:28:29 -05:00
|
|
|
::dbaccess::DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered ....
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
enum SPECIAL_MESSAGE
|
|
|
|
{
|
|
|
|
smNone,
|
2004-08-02 09:49:16 -05:00
|
|
|
smUnsupportedType
|
2001-05-29 03:59:46 -05:00
|
|
|
};
|
|
|
|
SPECIAL_MESSAGE m_eLastMessage;
|
|
|
|
|
|
|
|
Link m_aTypeSelectHandler; /// to be called if a new type is selected
|
2004-10-27 07:04:26 -05:00
|
|
|
Link m_aCreationModeHandler; /// to be called if a new type is selected
|
2005-06-30 10:33:40 -05:00
|
|
|
Link m_aDocumentSelectionHandler; /// to be called when a document in the RecentDoc list is selected
|
|
|
|
Link m_aChooseDocumentHandler; /// to be called when a recent document has been definately chosen
|
2001-05-29 03:59:46 -05:00
|
|
|
sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted
|
|
|
|
sal_Bool m_bUserGrabFocus : 1;
|
2009-07-03 07:24:35 -05:00
|
|
|
bool m_bInitTypeList : 1;
|
|
|
|
bool approveDataSourceType( const ::rtl::OUString& _sURLPrefix, String& _inout_rDisplayName );
|
|
|
|
void insertDatasourceTypeEntryData(const ::rtl::OUString& _sType, String sDisplayName);
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
public:
|
2004-10-27 07:04:26 -05:00
|
|
|
static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet, sal_Bool _bDBWizardMode = sal_False);
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
/// set a handler which gets called every time the user selects a new type
|
|
|
|
void SetTypeSelectHandler(const Link& _rHandler) { m_aTypeSelectHandler = _rHandler; }
|
2005-06-30 10:33:40 -05:00
|
|
|
void SetCreationModeHandler(const Link& _rHandler) { m_aCreationModeHandler = _rHandler; }
|
|
|
|
void SetDocumentSelectionHandler( const Link& _rHandler) { m_aDocumentSelectionHandler = _rHandler; }
|
|
|
|
void SetChooseDocumentHandler( const Link& _rHandler) { m_aChooseDocumentHandler = _rHandler; }
|
|
|
|
CreationMode GetDatabaseCreationMode() const;
|
|
|
|
|
|
|
|
DocumentDescriptor GetSelectedDocument() const;
|
2004-08-02 09:49:16 -05:00
|
|
|
|
2001-05-29 03:59:46 -05:00
|
|
|
/// get the currently selected datasource type
|
2009-07-03 07:24:35 -05:00
|
|
|
::rtl::OUString GetSelectedType() const { return m_eCurrentSelection; }
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// SfxTabPage overridables
|
|
|
|
virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs);
|
|
|
|
virtual void Reset(const SfxItemSet& _rCoreAttrs);
|
|
|
|
|
|
|
|
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
|
|
|
|
|
|
|
|
virtual void GetFocus();
|
2004-08-02 09:49:16 -05:00
|
|
|
|
|
|
|
// <method>OGenericAdministrationPage::fillControls</method>
|
|
|
|
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
|
|
|
|
// <method>OGenericAdministrationPage::fillWindows</method>
|
|
|
|
virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
|
2001-05-29 03:59:46 -05:00
|
|
|
|
|
|
|
protected:
|
2003-03-19 10:57:12 -06:00
|
|
|
|
2009-07-03 07:24:35 -05:00
|
|
|
void onTypeSelected(const ::rtl::OUString& _sURLPrefix);
|
2001-05-29 03:59:46 -05:00
|
|
|
void initializeTypeList();
|
|
|
|
|
2009-07-03 07:24:35 -05:00
|
|
|
void implSetCurrentType( const ::rtl::OUString& _eType );
|
2001-08-01 02:30:41 -05:00
|
|
|
|
2009-07-03 07:24:35 -05:00
|
|
|
void switchMessage(const ::rtl::OUString& _sURLPrefix);
|
2001-05-29 03:59:46 -05:00
|
|
|
|
2004-08-02 09:49:16 -05:00
|
|
|
/// sets the the title of the parent dialog
|
2009-07-03 07:24:35 -05:00
|
|
|
void setParentTitle(const ::rtl::OUString& _sURLPrefix);
|
2001-08-07 09:57:43 -05:00
|
|
|
|
2001-05-29 03:59:46 -05:00
|
|
|
DECL_LINK(OnDatasourceTypeSelected, ListBox*);
|
2004-10-27 07:04:26 -05:00
|
|
|
DECL_LINK(OnSetupModeSelected, RadioButton*);
|
2005-06-30 10:33:40 -05:00
|
|
|
DECL_LINK(OnDocumentSelected, ListBox*);
|
|
|
|
DECL_LINK(OnOpenDocument, PushButton*);
|
2001-05-29 03:59:46 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|
|
|
|
#endif // _DBAUI_GENERALPAGE_HXX_
|