diff options
Diffstat (limited to 'include/svx/databaselocationinput.hxx')
-rw-r--r-- | include/svx/databaselocationinput.hxx | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/include/svx/databaselocationinput.hxx b/include/svx/databaselocationinput.hxx index 8b84c7fe7f59..3608bc03e766 100644 --- a/include/svx/databaselocationinput.hxx +++ b/include/svx/databaselocationinput.hxx @@ -27,15 +27,15 @@ class PushButton; namespace svt { class OFileURLControl; } + +class URLBox; +namespace weld { class Button; class Window; } namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::uno { template <typename > class Reference; } namespace svx { - - //= DatabaseLocationInputController - class DatabaseLocationInputController_Impl; /** helper class to control controls needed to input a database location @@ -50,8 +50,9 @@ namespace svx public: DatabaseLocationInputController( const css::uno::Reference<css::uno::XComponentContext>& _rContext, - ::svt::OFileURLControl& _rLocationInput, - PushButton& _rBrowseButton + URLBox& _rLocationInput, + weld::Button& _rBrowseButton, + weld::Window& _rDialog ); ~DatabaseLocationInputController(); @@ -78,6 +79,48 @@ namespace svx m_pImpl; }; + //= SvxDatabaseLocationInputController + class SvxDatabaseLocationInputController_Impl; + /** helper class to control controls needed to input a database location + + If you allow, in your dialog, to save a database document, then you usually + have a OFileURLControl for inputting the actual location, and a push button + to browse for a location. + + This helper class controls such two UI elements. + */ + class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxDatabaseLocationInputController + { + public: + SvxDatabaseLocationInputController( + const css::uno::Reference<css::uno::XComponentContext>& _rContext, + ::svt::OFileURLControl& _rLocationInput, + PushButton& _rBrowseButton + ); + ~SvxDatabaseLocationInputController(); + + /** sets the given URL at the input control, after translating it into a system path + */ + void setURL( const OUString& _rURL ); + + /** returns the current database location, in form of a URL (not a system path) + */ + OUString getURL() const; + + /** prepares committing the database location entered in the input field + + Effectively, this method checks whether the file in the location already + exists, and if so, it asks the user whether to overwrite it. + + If the method is called multiple times, this check only happens when the location + changed since the last call. + */ + bool prepareCommit(); + + private: + ::std::unique_ptr< SvxDatabaseLocationInputController_Impl > + m_pImpl; + }; } |