LibreOffice Module dbaccess (master) 1
|
#include <ConnectionHelper.hxx>
Public Member Functions | |
OConnectionHelper (weld::Container *pPage, weld::DialogController *pController, const OUString &_rUIXMLDescription, const OUString &_rId, const SfxItemSet &_rCoreAttrs) | |
virtual | ~OConnectionHelper () override |
virtual void | fillControls (std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override |
will be called inside <method>implInitControls</method> to save the value if necessary More... | |
virtual void | fillWindows (std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override |
will be called inside <method>implInitControls</method> to disable if necessary More... | |
virtual void | implInitControls (const SfxItemSet &_rSet, bool _bSaveValue) override |
called from within Reset and ActivatePage, use to initialize the controls with the items from the given set More... | |
OUString | getURLNoPrefix () const |
void | setURLNoPrefix (std::u16string_view _rURL) |
sal_Int32 | checkPathExistence (const OUString &_rURL) |
checks if the path is existence More... | |
IS_PATH_EXIST | pathExists (const OUString &_rURL, bool bIsFile) const |
bool | createDirectoryDeep (std::u16string_view _rPathNormalized) |
bool | commitURL () |
void | askForFileName (::sfx2::FileDialogHelper &_aFileOpen) |
opens the FileOpen dialog and asks for a FileName More... | |
Public Member Functions inherited from dbaui::OGenericAdministrationPage | |
OGenericAdministrationPage (weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OUString &rId, const SfxItemSet &rAttrSet) | |
void | SetModifiedHandler (const Link< OGenericAdministrationPage const *, void > &_rHandler) |
set a handler which gets called every time something on the page has been modified More... | |
void | SetAdminDialog (IDatabaseSettingsDialog *_pDialog, IItemSetHelper *_pItemSetHelper) |
Sets the ParentDialog. More... | |
void | SetServiceFactory (const css::uno::Reference< css::uno::XComponentContext > &rxORB) |
Sets the ServiceFactory. More... | |
bool | getSelectedDataSource (OUString &_sReturn, OUString const &_sCurr) |
opens a dialog filled with all data sources available for this type and returns the selected on. More... | |
virtual void | initializePage () override |
virtual bool | commitPage (::vcl::WizardTypes::CommitPageReason _eReason) override |
virtual bool | canAdvance () const override |
void | SetRoadmapStateValue (bool _bDoEnable) |
bool | GetRoadmapStateValue () const |
Public Member Functions inherited from SfxTabPage | |
void | SetDialogController (SfxOkDialogController *pDialog) |
virtual | ~SfxTabPage () override |
void | set_visible (bool bVisible) |
const SfxItemSet & | GetItemSet () const |
virtual bool | FillItemSet (SfxItemSet *) |
virtual void | Reset (const SfxItemSet *) |
virtual bool | DeferResetToFirstActivation () |
bool | HasExchangeSupport () const |
void | SetExchangeSupport () |
virtual void | ActivatePage (const SfxItemSet &) |
virtual DeactivateRC | DeactivatePage (SfxItemSet *pSet) |
void | SetUserData (const OUString &rString) |
const OUString & | GetUserData () const |
virtual void | FillUserData () |
virtual bool | IsReadOnly () const |
virtual void | PageCreated (const SfxAllItemSet &aSet) |
virtual void | ChangesApplied () |
void | SetFrame (const css::uno::Reference< css::frame::XFrame > &xFrame) |
css::uno::Reference< css::frame::XFrame > | GetFrame () const |
const SfxItemSet * | GetDialogExampleSet () const |
OUString | GetHelpId () const |
OUString | GetConfigId () const |
bool | IsVisible () const |
weld::Window * | GetFrameWeld () const |
std::unordered_map< OUString, css::uno::Any > & | getAdditionalProperties () |
Public Attributes | |
OUString | m_eType |
::dbaccess::ODsnTypeCollection * | m_pCollection |
std::unique_ptr< weld::Label > | m_xFT_Connection |
the DSN type collection instance More... | |
std::unique_ptr< weld::Button > | m_xPB_Connection |
std::unique_ptr< weld::Button > | m_xPB_CreateDB |
std::unique_ptr< OConnectionURLEdit > | m_xConnectionURL |
Protected Member Functions | |
void | setURL (std::u16string_view _rURL) |
virtual bool | checkTestConnection () |
Protected Member Functions inherited from dbaui::OGenericAdministrationPage | |
virtual DeactivateRC | DeactivatePage (SfxItemSet *pSet) override |
default implementation: call FillItemSet, call prepareLeave, More... | |
virtual void | Reset (const SfxItemSet *_rCoreAttrs) override |
default implementation: call implInitControls with the given item set and _bSaveValue = sal_False More... | |
virtual void | ActivatePage (const SfxItemSet &_rSet) override |
default implementation: call implInitControls with the given item set and _bSaveValue = sal_True More... | |
virtual void | Activate () override |
virtual void | callModifiedHdl (weld::Widget *=nullptr) |
virtual bool | prepareLeave () |
called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_True More... | |
virtual void | implInitControls (const SfxItemSet &_rSet, bool _bSaveValue) |
called from within Reset and ActivatePage, use to initialize the controls with the items from the given set More... | |
virtual void | fillControls (std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)=0 |
will be called inside <method>implInitControls</method> to save the value if necessary More... | |
virtual void | fillWindows (std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)=0 |
will be called inside <method>implInitControls</method> to disable if necessary More... | |
DECL_LINK (OnControlModified, weld::Widget *, void) | |
This link be used for controls where the tabpage does not need to take any special action when the control is modified. More... | |
DECL_LINK (OnControlEntryModifyHdl, weld::Entry &, void) | |
DECL_LINK (OnControlSpinButtonModifyHdl, weld::SpinButton &, void) | |
DECL_LINK (OnControlModifiedButtonClick, weld::Toggleable &, void) | |
DECL_LINK (OnTestConnectionButtonClickHdl, weld::Button &, void) | |
Protected Member Functions inherited from SfxTabPage | |
SfxTabPage (weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OUString &rID, const SfxItemSet *rAttrSet) | |
sal_uInt16 | GetWhich (sal_uInt16 nSlot, bool bDeep=true) const |
TypedWhichId< T > | GetWhich (TypedWhichId< T > nSlot, bool bDeep=true) const |
const SfxPoolItem * | GetOldItem (const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true) |
const T * | GetOldItem (const SfxItemSet &rSet, TypedWhichId< T > nSlot, bool bDeep=true) |
SfxOkDialogController * | GetDialogController () const |
Private Member Functions | |
DECL_LINK (OnBrowseConnections, weld::Button &, void) | |
DECL_LINK (OnCreateDatabase, weld::Button &, void) | |
DECL_LINK (GetFocusHdl, weld::Widget &, void) | |
DECL_LINK (LoseFocusHdl, weld::Widget &, void) | |
OUString | impl_getURL () const |
void | impl_setURL (std::u16string_view _rURL, bool _bPrefix) |
void | implUpdateURLDependentStates () const |
Private Attributes | |
bool | m_bUserGrabFocus |
Additional Inherited Members | |
Static Public Member Functions inherited from dbaui::OGenericAdministrationPage | |
static void | fillBool (SfxItemSet &_rSet, const weld::CheckButton *pCheckBox, sal_uInt16 _nID, bool bOptionalBool, bool &_bChangedSomething, bool _bRevertValue=false) |
fills the Boolean value into the item set when the value changed. More... | |
static void | fillInt32 (SfxItemSet &_rSet, const weld::SpinButton *pEdit, TypedWhichId< SfxInt32Item > _nID, bool &_bChangedSomething) |
fills the int value into the item set when the value changed. More... | |
static void | fillString (SfxItemSet &_rSet, const weld::Entry *pEdit, TypedWhichId< SfxStringItem > _nID, bool &_bChangedSomething) |
fills the String value into the item set when the value changed. More... | |
static void | fillString (SfxItemSet &_rSet, const dbaui::OConnectionURLEdit *pEdit, TypedWhichId< SfxStringItem > _nID, bool &_bChangedSomething) |
Static Public Member Functions inherited from SfxTabPage | |
static const SfxPoolItem * | GetItem (const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true) |
static const T * | GetItem (const SfxItemSet &rSet, TypedWhichId< T > nSlot, bool bDeep=true) |
Static Protected Member Functions inherited from dbaui::OGenericAdministrationPage | |
static void | getFlags (const SfxItemSet &_rSet, bool &_rValid, bool &_rReadonly) |
analyze the invalid and the readonly flag which may be present in the set More... | |
Protected Attributes inherited from dbaui::OGenericAdministrationPage | |
IDatabaseSettingsDialog * | m_pAdminDialog |
IItemSetHelper * | m_pItemSetHelper |
css::uno::Reference< css::uno::XComponentContext > | m_xORB |
Definition at line 36 of file ConnectionHelper.hxx.
dbaui::OConnectionHelper::OConnectionHelper | ( | weld::Container * | pPage, |
weld::DialogController * | pController, | ||
const OUString & | _rUIXMLDescription, | ||
const OUString & | _rId, | ||
const SfxItemSet & | _rCoreAttrs | ||
) |
Definition at line 75 of file ConnectionHelper.cxx.
References DSID_TYPECOLLECTION, dbaui::DbuTypeCollectionItem::getCollection(), SfxItemSet::GetItem(), LINK, m_pCollection, m_xConnectionURL, m_xPB_Connection, and m_xPB_CreateDB.
|
overridevirtual |
Definition at line 97 of file ConnectionHelper.cxx.
References m_xConnectionURL.
void dbaui::OConnectionHelper::askForFileName | ( | ::sfx2::FileDialogHelper & | _aFileOpen | ) |
opens the FileOpen dialog and asks for a FileName
_aFileOpen | Executes the file open dialog, which must be filled from caller. |
Definition at line 703 of file ConnectionHelper.cxx.
References dbaui::OGenericAdministrationPage::callModifiedHdl(), checkTestConnection(), ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), sfx2::FileDialogHelper::GetPath(), getURLNoPrefix(), sfx2::FileDialogHelper::SetDisplayDirectory(), dbaui::OGenericAdministrationPage::SetRoadmapStateValue(), and setURLNoPrefix().
sal_Int32 dbaui::OConnectionHelper::checkPathExistence | ( | const OUString & | _rURL | ) |
checks if the path is existence
_rURL | The URL to check. |
Definition at line 454 of file ConnectionHelper.cxx.
References dbaui::OGenericAdministrationPage::callModifiedHdl(), createDirectoryDeep(), Application::CreateMessageDialog(), DBA_RES, svt::OFileNotation::get(), SfxTabPage::GetFrameWeld(), GetStandardText(), m_bUserGrabFocus, m_eType, m_pCollection, svt::OFileNotation::N_SYSTEM, dbaui::PATH_NOT_EXIST, dbaui::PATH_NOT_KNOWN, pathExists(), RET_CANCEL, RET_NO, RET_OK, RET_RETRY, RET_YES, dbaui::OGenericAdministrationPage::SetRoadmapStateValue(), and dbaccess::ODsnTypeCollection::supportsDBCreation().
Referenced by commitURL().
|
protectedvirtual |
Reimplemented in dbaui::OConnectionTabPage, dbaui::OConnectionTabPageSetup, dbaui::OTextConnectionPageSetup, and dbaui::OJDBCConnectionPageSetup.
Definition at line 362 of file ConnectionHelper.cxx.
Referenced by askForFileName(), and implInitControls().
bool dbaui::OConnectionHelper::commitURL | ( | ) |
Definition at line 650 of file ConnectionHelper.cxx.
References dbaui::OGenericAdministrationPage::callModifiedHdl(), checkPathExistence(), DBA_RES, dbaccess::ODsnTypeCollection::determineType(), dbaccess::DST_CALC, dbaccess::DST_MSACCESS, dbaccess::DST_MSACCESS_2007, dbaccess::DST_WRITER, eType, svt::OFileNotation::get(), SfxTabPage::GetFrameWeld(), dbaccess::ODsnTypeCollection::isFileSystemBased(), m_bUserGrabFocus, m_eType, m_pCollection, m_xConnectionURL, svt::OFileNotation::N_SYSTEM, svt::OFileNotation::N_URL, dbaui::PATH_NOT_EXIST, pathExists(), RET_CANCEL, RET_RETRY, weld::DialogController::run(), dbaui::OGenericAdministrationPage::SetRoadmapStateValue(), and setURLNoPrefix().
Referenced by dbaui::OConnectionTabPageSetup::commitPage().
bool dbaui::OConnectionHelper::createDirectoryDeep | ( | std::u16string_view | _rPathNormalized | ) |
Definition at line 573 of file ConnectionHelper.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, INetURLObject::GetMainURL(), INetURLObject::getName(), comphelper::getProcessComponentContext(), ucbhelper::Content::getPropertyValue(), INetURLObject::GetProtocol(), INetURLObject::getSegmentCount(), ucbhelper::Content::insertNewContent(), INetURLObject::NONE, dbaui::PATH_NOT_EXIST, pathExists(), INetURLObject::removeSegment(), and INetURLObject::SetURL().
Referenced by checkPathExistence().
|
private |
|
private |
|
private |
|
private |
|
overridevirtual |
will be called inside <method>implInitControls</method> to save the value if necessary
_rControlList | The list must be filled with the controls. It is not allowed to clear the list before pushing data into it. |
Implements dbaui::OGenericAdministrationPage.
Reimplemented in dbaui::OSpreadSheetConnectionPageSetup, dbaui::OTextConnectionPageSetup, and dbaui::OJDBCConnectionPageSetup.
Definition at line 645 of file ConnectionHelper.cxx.
References m_xConnectionURL.
Referenced by dbaui::OSpreadSheetConnectionPageSetup::fillControls(), and dbaui::OTextConnectionPageSetup::fillControls().
|
overridevirtual |
will be called inside <method>implInitControls</method> to disable if necessary
_rControlList | The list must be filled with the controls. It is not allowed to clear the list before pushing data into it. |
Implements dbaui::OGenericAdministrationPage.
Reimplemented in dbaui::OSpreadSheetConnectionPageSetup, dbaui::OTextConnectionPageSetup, and dbaui::OJDBCConnectionPageSetup.
Definition at line 638 of file ConnectionHelper.cxx.
References m_xFT_Connection, m_xPB_Connection, and m_xPB_CreateDB.
Referenced by dbaui::OTextConnectionPageSetup::fillWindows().
OUString dbaui::OConnectionHelper::getURLNoPrefix | ( | ) | const |
Definition at line 444 of file ConnectionHelper.cxx.
References impl_getURL().
Referenced by askForFileName(), and implUpdateURLDependentStates().
|
private |
Definition at line 410 of file ConnectionHelper.cxx.
References INetURLObject::All, svt::OFileNotation::get(), INetURLObject::GetMainURL(), dbaccess::ODsnTypeCollection::isFileSystemBased(), m_eType, m_pCollection, m_xConnectionURL, svt::OFileNotation::N_SYSTEM, svt::OFileNotation::N_URL, and INetURLObject::NONE.
Referenced by getURLNoPrefix().
|
private |
Definition at line 367 of file ConnectionHelper.cxx.
References dbaccess::ODsnTypeCollection::cutPrefix(), svt::OFileNotation::get(), dbaccess::ODsnTypeCollection::getPrefix(), implUpdateURLDependentStates(), dbaccess::ODsnTypeCollection::isFileSystemBased(), m_eType, m_pCollection, m_xConnectionURL, svt::OFileNotation::N_SYSTEM, comphelper::string::stripEnd(), and SvtPathOptions::SubstituteVariable().
Referenced by setURL(), and setURLNoPrefix().
|
overridevirtual |
called from within Reset and ActivatePage, use to initialize the controls with the items from the given set
_bSaveValue | if set to sal_True, the implementation should call SaveValue on all relevant controls |
Reimplemented from dbaui::OGenericAdministrationPage.
Reimplemented in dbaui::OConnectionTabPage, dbaui::OConnectionTabPageSetup, dbaui::OTextConnectionPageSetup, and dbaui::OJDBCConnectionPageSetup.
Definition at line 102 of file ConnectionHelper.cxx.
References checkTestConnection(), dbaccess::ODsnTypeCollection::determineType(), DSID_CONNECTURL, dbaccess::DST_JDBC, dbaui::OGenericAdministrationPage::getFlags(), SfxItemSet::GetItem(), CntUnencodedStringItem::GetValue(), dbaui::OGenericAdministrationPage::implInitControls(), m_eType, m_pCollection, m_xConnectionURL, m_xFT_Connection, m_xPB_Connection, m_xPB_CreateDB, setURL(), dbaccess::ODsnTypeCollection::supportsBrowsing(), and dbaccess::ODsnTypeCollection::supportsDBCreation().
Referenced by dbaui::OConnectionTabPage::implInitControls(), and dbaui::OConnectionTabPageSetup::implInitControls().
|
private |
Definition at line 133 of file ConnectionHelper.cxx.
References dbaui::IDatabaseSettingsDialog::enableConfirmSettings(), getURLNoPrefix(), dbaccess::ODsnTypeCollection::isFileSystemBased(), m_eType, dbaui::OGenericAdministrationPage::m_pAdminDialog, and m_pCollection.
Referenced by impl_setURL().
IS_PATH_EXIST dbaui::OConnectionHelper::pathExists | ( | const OUString & | _rURL, |
bool | bIsFile | ||
) | const |
Definition at line 530 of file ConnectionHelper.cxx.
References Exception, comphelper::getProcessComponentContext(), ucbhelper::Content::isDocument(), ucbhelper::Content::isFolder(), dbaui::OGenericAdministrationPage::m_xORB, dbaui::PATH_EXIST, dbaui::PATH_NOT_EXIST, and dbaui::PATH_NOT_KNOWN.
Referenced by checkPathExistence(), commitURL(), and createDirectoryDeep().
|
protected |
Definition at line 439 of file ConnectionHelper.cxx.
References impl_setURL().
Referenced by implInitControls(), and dbaui::OConnectionTabPage::implInitControls().
void dbaui::OConnectionHelper::setURLNoPrefix | ( | std::u16string_view | _rURL | ) |
Definition at line 449 of file ConnectionHelper.cxx.
References impl_setURL().
Referenced by askForFileName(), and commitURL().
|
private |
Definition at line 38 of file ConnectionHelper.hxx.
Referenced by checkPathExistence(), and commitURL().
OUString dbaui::OConnectionHelper::m_eType |
Definition at line 44 of file ConnectionHelper.hxx.
Referenced by checkPathExistence(), dbaui::OConnectionTabPage::checkTestConnection(), dbaui::OConnectionTabPageSetup::checkTestConnection(), commitURL(), dbaui::OConnectionTabPage::FillItemSet(), impl_getURL(), impl_setURL(), implInitControls(), dbaui::OConnectionTabPage::implInitControls(), dbaui::OConnectionTabPageSetup::implInitControls(), dbaui::OJDBCConnectionPageSetup::implInitControls(), and implUpdateURLDependentStates().
::dbaccess::ODsnTypeCollection* dbaui::OConnectionHelper::m_pCollection |
Definition at line 47 of file ConnectionHelper.hxx.
Referenced by checkPathExistence(), dbaui::OConnectionTabPage::checkTestConnection(), dbaui::OConnectionTabPageSetup::checkTestConnection(), commitURL(), dbaui::OConnectionTabPage::FillItemSet(), impl_getURL(), impl_setURL(), implInitControls(), dbaui::OConnectionTabPage::implInitControls(), dbaui::OConnectionTabPageSetup::implInitControls(), dbaui::OJDBCConnectionPageSetup::implInitControls(), implUpdateURLDependentStates(), and OConnectionHelper().
std::unique_ptr<OConnectionURLEdit> dbaui::OConnectionHelper::m_xConnectionURL |
Definition at line 52 of file ConnectionHelper.hxx.
Referenced by dbaui::OConnectionTabPage::checkTestConnection(), dbaui::OConnectionTabPageSetup::checkTestConnection(), dbaui::OJDBCConnectionPageSetup::checkTestConnection(), commitURL(), fillControls(), dbaui::OConnectionTabPage::FillItemSet(), dbaui::OConnectionTabPageSetup::FillItemSet(), impl_getURL(), impl_setURL(), implInitControls(), dbaui::OConnectionTabPage::implInitControls(), OConnectionHelper(), dbaui::OConnectionTabPage::OConnectionTabPage(), dbaui::OConnectionTabPageSetup::OConnectionTabPageSetup(), and ~OConnectionHelper().
std::unique_ptr<weld::Label> dbaui::OConnectionHelper::m_xFT_Connection |
the DSN type collection instance
Definition at line 49 of file ConnectionHelper.hxx.
Referenced by fillWindows(), implInitControls(), dbaui::OConnectionTabPage::implInitControls(), and dbaui::OConnectionTabPageSetup::OConnectionTabPageSetup().
std::unique_ptr<weld::Button> dbaui::OConnectionHelper::m_xPB_Connection |
Definition at line 50 of file ConnectionHelper.hxx.
Referenced by fillWindows(), implInitControls(), dbaui::OConnectionTabPage::implInitControls(), and OConnectionHelper().
std::unique_ptr<weld::Button> dbaui::OConnectionHelper::m_xPB_CreateDB |
Definition at line 51 of file ConnectionHelper.hxx.
Referenced by fillWindows(), implInitControls(), and OConnectionHelper().