1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_DLG_CONNECTIONHELPER_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_DLG_CONNECTIONHELPER_HXX
23 #include "adminpages.hxx"
24 #include <ucbhelper/content.hxx>
25 #include "curledit.hxx"
26 #include <sfx2/filedlghelper.hxx>
38 class OConnectionHelper
: public OGenericAdministrationPage
40 bool m_bUserGrabFocus
: 1;
43 OConnectionHelper( vcl::Window
* pParent
, const OString
& _rId
, const OUString
& _rUIXMLDescription
, const SfxItemSet
& _rCoreAttrs
);
44 virtual ~OConnectionHelper();
45 virtual void dispose() SAL_OVERRIDE
;
46 VclPtr
<FixedText
> m_pFT_Connection
;
47 VclPtr
<OConnectionURLEdit
> m_pConnectionURL
;
48 VclPtr
<PushButton
> m_pPB_Connection
;
49 VclPtr
<PushButton
> m_pPB_CreateDB
;
50 OUString m_eType
; // the type can't be changed in this class, so we hold it as member.
54 // setting/retrieving the current connection URL
55 // necessary because for some types, the URL must be decoded for display purposes
56 ::dbaccess::ODsnTypeCollection
* m_pCollection
; /// the DSN type collection instance
57 virtual bool PreNotify( NotifyEvent
& _rNEvt
) SAL_OVERRIDE
;
59 // <method>OGenericAdministrationPage::fillControls</method>
60 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
61 // <method>OGenericAdministrationPage::fillWindows</method>
62 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
63 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
65 // setting/retrieving the current connection URL
66 // necessary because for some types, the URL must be decoded for display purposes
67 //String getURL( OConnectionURLEdit* _m_pConnection ) const;
68 //void setURL( const OUString& _rURL, OConnectionURLEdit* _m_pConnection );
70 OUString
getURLNoPrefix( ) const;
71 void setURLNoPrefix( const OUString
& _rURL
);
73 /** checks if the path is existence
77 sal_Int32
checkPathExistence(const OUString
& _rURL
);
79 IS_PATH_EXIST
pathExists(const OUString
& _rURL
, bool bIsFile
) const;
80 bool createDirectoryDeep(const OUString
& _rPathNormalized
);
83 /** opens the FileOpen dialog and asks for a FileName
85 Executes the file open dialog, which must be filled from caller.
87 void askForFileName(::sfx2::FileDialogHelper
& _aFileOpen
);
90 void setURL( const OUString
& _rURL
);
91 virtual bool checkTestConnection();
94 DECL_LINK(OnBrowseConnections
, PushButton
*);
95 DECL_LINK(OnCreateDatabase
, PushButton
*);
96 OUString
impl_getURL( bool _bPrefix
) const;
97 void impl_setURL( const OUString
& _rURL
, bool _bPrefix
);
98 void implUpdateURLDependentStates() const;
103 #endif // INCLUDED_DBACCESS_SOURCE_UI_DLG_CONNECTIONHELPER_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */