split up the file

This commit is contained in:
Frank Schönheit 2001-01-26 15:12:12 +00:00
parent e8831c8b27
commit d4f55950df
2 changed files with 97 additions and 2358 deletions

File diff suppressed because it is too large Load diff

View file

@ -2,9 +2,9 @@
*
* $RCSfile: adminpages.hxx,v $
*
* $Revision: 1.18 $
* $Revision: 1.19 $
*
* last change: $Author: fs $ $Date: 2001-01-26 06:59:12 $
* last change: $Author: fs $ $Date: 2001-01-26 16:12:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -101,417 +101,60 @@
#ifndef _UCBHELPER_CONTENT_HXX
#include <ucbhelper/content.hxx>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
#endif
//.........................................................................
namespace dbaui
{
//.........................................................................
//=========================================================================
//= OGenericAdministrationPage
//=========================================================================
class OGenericAdministrationPage : public SfxTabPage
{
protected:
Link m_aModifiedHandler; /// to be called if something on the page has been modified
public:
OGenericAdministrationPage(Window* _pParent, const ResId& _rId, const SfxItemSet& _rAttrSet);
/// set a handler which gets called every time something on the page has been modified
void SetModifiedHandler(const Link& _rHandler) { m_aModifiedHandler = _rHandler; }
protected:
/// default implementation: call FillItemSet, call checkItems,
virtual int DeactivatePage(SfxItemSet* pSet);
/// default implementation: call implInitControls with the given item set and _bSaveValue = sal_False
virtual void Reset(const SfxItemSet& _rCoreAttrs);
/// default implementation: call implInitControls with the given item set and _bSaveValue = sal_True
virtual void ActivatePage(const SfxItemSet& _rSet);
protected:
void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); }
/// called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_True
virtual sal_Bool checkItems() { return sal_True; }
/** called from within Reset and ActivatePage, use to initialize the controls with the items from the given set
@param _bSaveValue if set to sal_True, the implementation should call SaveValue on all relevant controls
*/
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) { }
/// analyze the invalid and the readonly flag which may be present in the set
void getFlags(const SfxItemSet& _rSet, sal_Bool& _rValid, sal_Bool& _rReadonly);
protected:
/** This link be used for controls where the tabpage does not need to take any special action when the control
is modified. The implementation just calls callModifiedHdl.
*/
DECL_LINK(OnControlModified, Control*);
/// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); }
};
//=========================================================================
//= OGeneralPage
//=========================================================================
/**
*/
class OGeneralPage : public OGenericAdministrationPage
{
OGeneralPage(Window* pParent, const SfxItemSet& _rItems);
private:
// dialog controls
FixedText m_aNameLabel;
Edit m_aName;
GroupBox m_aTypeBox;
FixedText m_aDatasourceTypeLabel;
ListBox m_aDatasourceType;
FixedText m_aConnectionLabel;
OConnectionURLEdit m_aConnection;
PushButton m_aBrowseConnection;
// FixedText m_aTimeoutLabel;
// Edit m_aTimeoutNumber;
// ListBox m_aTimeoutUnit;
FixedText m_aSpecialMessage;
ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
DECLARE_STL_MAP(DATASOURCE_TYPE, String, ::std::less< DATASOURCE_TYPE >, SelectionHistory);
DATASOURCE_TYPE m_eCurrentSelection; /// currently selected type
SelectionHistory m_aSelectionHistory; /// last selected ConnectURLs for all types
Link m_aTypeSelectHandler; /// to be called if a new type is selected
Link m_aNameModifiedHandler; /// to be called whenever the name of the data source is changed by the user
sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted
public:
static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet);
/// set a handler which gets called every time the user selects a new type
void SetTypeSelectHandler(const Link& _rHandler) { m_aTypeSelectHandler = _rHandler; }
/// get the currently selected datasource type
DATASOURCE_TYPE GetSelectedType() const { return m_eCurrentSelection; }
/// set a handler which gets called every time the user changes the data source name
void SetNameModifyHandler(const Link& _rHandler) { m_aNameModifiedHandler = _rHandler; }
/// get the current name the user wants the data source to have
String GetCurrentName() const { return m_aName.GetText(); }
protected:
// SfxTabPage overridables
virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs);
virtual void Reset(const SfxItemSet& _rCoreAttrs);
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
virtual sal_Bool checkItems();
virtual void GetFocus();
protected:
void onTypeSelected(DATASOURCE_TYPE _eType);
void initializeHistory();
sal_Bool isBrowseable(DATASOURCE_TYPE _eType) const;
StringBag getInstalledAdabasDBDirs(const String &_rPath,const ::ucb::ResultSetInclude& _reResultSetInclude);
StringBag getInstalledAdabasDBs(const String &_rConfigDir,const String &_rWorkDir);
DECL_LINK(OnDatasourceTypeSelected, ListBox*);
DECL_LINK(OnBrowseConnections, PushButton*);
DECL_LINK(OnNameModified, Edit*);
};
//=========================================================================
//= OCommonBehaviourTabPage
//=========================================================================
#define CBTP_NONE 0x0000
#define CBTP_USE_UIDPWD 0x0001
#define CBTP_USE_CHARSET 0x0002
#define CBTP_USE_OPTIONS 0x0004
/** eases the implementation of tab pages handling user/password and/or character
set and/or generic options input
<BR>
The controls to be used habe to be defined within the resource, as usual, but
this class does all the handling necessary.
*/
class OCommonBehaviourTabPage : public OGenericAdministrationPage
{
protected:
FixedText* m_pUserNameLabel;
Edit* m_pUserName;
FixedText* m_pPasswordLabel;
Edit* m_pPassword;
CheckBox* m_pPasswordRequired;
FixedText* m_pOptionsLabel;
Edit* m_pOptions;
FixedText* m_pCharsetLabel;
ListBox* m_pCharset;
OCharsetDisplay m_aCharsets;
USHORT m_nControlFlags;
public:
virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs);
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
protected:
OCommonBehaviourTabPage(Window* pParent, USHORT nResId, const SfxItemSet& _rCoreAttrs, USHORT nControlFlags);
// nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
virtual ~OCommonBehaviourTabPage();
};
//========================================================================
//= ODbaseDetailsPage
//========================================================================
class ODbaseDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
GroupBox m_aFrame;
CheckBox m_aShowDeleted;
PushButton m_aIndexes;
String m_sDsn;
protected:
ODbaseDetailsPage(Window* pParent, const SfxItemSet& _rCoreAttrs);
~ODbaseDetailsPage();
protected:
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
private:
DECL_LINK( OnButtonClicked, Button * );
};
//========================================================================
//= OJdbcDetailsPage
//========================================================================
class OJdbcDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
FixedText m_aDriverLabel;
Edit m_aDriver;
FixedText m_aJdbcUrlLabel;
OConnectionURLEdit m_aJdbcUrl;
FixedLine m_aSeparator1;
OJdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
~OJdbcDetailsPage();
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
};
//========================================================================
//= OAdoDetailsPage
//========================================================================
class OAdoDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
FixedText m_aAdoUrlLabel;
OConnectionURLEdit m_aAdoUrl;
OAdoDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
~OAdoDetailsPage();
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
};
//========================================================================
//= OOdbcDetailsPage
//========================================================================
class OOdbcDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
FixedLine m_aSeparator1;
OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
};
//========================================================================
//= OAdabasDetailsPage
//========================================================================
class OAdabasDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
FixedLine m_aSeparator1;
OAdabasDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
};
//========================================================================
//= OTextDetailsPage
//========================================================================
class OTextDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
/// get the SfxPoolItem ids used by this tab page
static sal_Int32* getDetailIds();
private:
CheckBox m_aHeader;
FixedText m_aFieldSeparatorLabel;
ComboBox m_aFieldSeparator;
FixedText m_aTextSeparatorLabel;
ComboBox m_aTextSeparator;
FixedText m_aDecimalSeparatorLabel;
ComboBox m_aDecimalSeparator;
FixedText m_aThousandsSeparatorLabel;
ComboBox m_aThousandsSeparator;
FixedLine m_aSeparator1;
FixedText m_aExtensionLabel;
ComboBox m_aExtension;
String m_aFieldSeparatorList;
String m_aTextSeparatorList;
OTextDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
~OTextDetailsPage();
private:
String GetSeparator( const ComboBox& rBox, const String& rList );
void SetSeparator( ComboBox& rBox, const String& rList, const String& rVal );
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
virtual sal_Bool checkItems();
};
//========================================================================
//= OTableSubscriptionPage
//========================================================================
class ODbAdminDialog;
class OTableSubscriptionPage : public OGenericAdministrationPage
{
friend class ODbAdminDialog;
private:
GroupBox m_aTables;
RadioButton m_aIncludeAll;
RadioButton m_aIncludeNone;
RadioButton m_aIncludeSelected;
OTableTreeListBox m_aTablesList;
CheckBox m_aSuppressVersionColumns;
sal_Bool m_bCheckedAll : 1;
sal_Bool m_bCatalogAtStart : 1;
sal_Bool m_bInitializingControls : 1;
::rtl::OUString m_sCatalogSeparator;
ODbAdminDialog* m_pAdminDialog; /** needed for translating an SfxItemSet into Sequence< PropertyValue >
(for building an XConnection)
*/
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
m_xCurrentConnection; /// valid as long as the page is active
::com::sun::star::uno::Sequence< ::rtl::OUString >
m_aLastDetailedSelection;
RadioButton* m_pLastCheckedButton;
public:
static SfxTabPage* Create( Window* _pParent, const SfxItemSet& _rAttrSet);
virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs);
virtual void ActivatePage(const SfxItemSet& _rSet);
virtual int DeactivatePage(SfxItemSet* _pSet);
void setServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB)
{ m_aTablesList.setServiceFactory(_rxORB); }
protected:
void SetAdminDialog(ODbAdminDialog* _pDialog) { m_pAdminDialog = _pDialog; }
private:
OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
~OTableSubscriptionPage();
/** check the tables in <member>m_aTablesList</member> according to <arg>_rTables</arg>
*/
void implCheckTables(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rTables);
/** return the current selection in <member>m_aTablesList</member>
*/
::com::sun::star::uno::Sequence< ::rtl::OUString > collectDetailedSelection() const;
void CheckAll( BOOL bCheck=TRUE );
DECL_LINK( OnRadioButtonClicked, Button* );
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
};
//========================================================================
//= OQueryAdministrationPage
//========================================================================
class OQueryAdministrationPage : public OGenericAdministrationPage
{
private:
GroupBox m_aFrame;
ListBox m_aQueries;
PushButton m_aNew;
PushButton m_aEdit;
PushButton m_aDelete;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
m_xORB;
public:
static SfxTabPage* Create( Window* _pParent, const SfxItemSet& _rAttrSet);
void setServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB)
{ m_xORB = _rxORB; }
protected:
OQueryAdministrationPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
~OQueryAdministrationPage();
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs);
virtual void ActivatePage(const SfxItemSet& _rSet);
protected:
DECL_LINK(OnNewQuery, PushButton*);
DECL_LINK(OnEditQuery, PushButton*);
DECL_LINK(OnDeleteQuery, PushButton*);
};
//=========================================================================
//= OGenericAdministrationPage
//=========================================================================
class OGenericAdministrationPage : public SfxTabPage
{
protected:
Link m_aModifiedHandler; /// to be called if something on the page has been modified
public:
OGenericAdministrationPage(Window* _pParent, const ResId& _rId, const SfxItemSet& _rAttrSet);
/// set a handler which gets called every time something on the page has been modified
void SetModifiedHandler(const Link& _rHandler) { m_aModifiedHandler = _rHandler; }
protected:
/// default implementation: call FillItemSet, call checkItems,
virtual int DeactivatePage(SfxItemSet* pSet);
/// default implementation: call implInitControls with the given item set and _bSaveValue = sal_False
virtual void Reset(const SfxItemSet& _rCoreAttrs);
/// default implementation: call implInitControls with the given item set and _bSaveValue = sal_True
virtual void ActivatePage(const SfxItemSet& _rSet);
protected:
void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); }
/// called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_True
virtual sal_Bool checkItems() { return sal_True; }
/** called from within Reset and ActivatePage, use to initialize the controls with the items from the given set
@param _bSaveValue if set to sal_True, the implementation should call SaveValue on all relevant controls
*/
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) { }
/// analyze the invalid and the readonly flag which may be present in the set
void getFlags(const SfxItemSet& _rSet, sal_Bool& _rValid, sal_Bool& _rReadonly);
protected:
/** This link be used for controls where the tabpage does not need to take any special action when the control
is modified. The implementation just calls callModifiedHdl.
*/
DECL_LINK(OnControlModified, Control*);
/// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); }
};
//.........................................................................
} // namespace dbaui
@ -522,58 +165,15 @@ protected:
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.18 2001/01/26 06:59:12 fs
* some basics for the query administration page - not enabled yet
*
* Revision 1.17 2001/01/04 11:21:45 fs
* #81485# +OAdoDetailsPage
*
* Revision 1.16 2000/12/07 14:15:42 oj
* #81131# check installed adabas dbs
*
* Revision 1.15 2000/11/30 08:32:30 fs
* #80003# changed some sal_uInt16 to sal_Int32 (need some -1's)
*
* Revision 1.14 2000/11/29 22:29:40 fs
* #80003# implementation of the character set map changed
*
* Revision 1.13 2000/11/28 13:47:31 fs
* #80152# m_bDisplayingDeleted renamed in m_bDisplayingInvalid
*
* Revision 1.12 2000/11/28 11:41:42 oj
* #80827# check dbroot if dbconfig failed
*
* Revision 1.11 2000/11/22 15:44:05 oj
* #80269# remove property long names
*
* Revision 1.10 2000/11/10 17:35:28 fs
* no parameter in checkItems anymore - did not make sense in the context it is called / some small bug fixes
*
* Revision 1.9 2000/11/02 15:20:04 fs
* #79983# +isBrowseable / #79830# +checkItems
*
* Revision 1.8 2000/10/30 15:22:44 fs
* no password fields anymore - don't want to have them in and _data source aministration_ dialog
*
* Revision 1.7 2000/10/24 12:11:15 fs
* functionality added: browsing for system data sources (ODBC/Adabas/dbase/text)
*
* Revision 1.6 2000/10/20 09:53:17 fs
* handling for the SuppresVersionColumns property of a data source
*
* Revision 1.5 2000/10/13 16:03:34 fs
* Separator changed to string / getDetailIds
*
* Revision 1.4 2000/10/12 16:20:42 fs
* new implementations ... still under construction
*
* Revision 1.3 2000/10/11 11:31:03 fs
* new implementations - still under construction
*
* Revision 1.2 2000/10/09 12:39:29 fs
* some (a lot of) new imlpementations - still under development
*
* Revision 1.1 2000/10/05 10:04:22 fs
* initial checkin
*
*
* Revision 1.0 26.09.00 11:46:15 fs
************************************************************************/