bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / databaselocationinput.hxx
blob6acb2194a81089d380ecb5cc92756d587201ec12
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 SVX_DATABASELOCATIONINPUT_HXX
21 #define SVX_DATABASELOCATIONINPUT_HXX
23 #include "svx/svxdllapi.h"
25 class PushButton;
26 class String;
27 namespace svt { class OFileURLControl; }
28 namespace comphelper { class ComponentContext; }
30 #include <memory>
32 //........................................................................
33 namespace svx
35 //........................................................................
37 //====================================================================
38 //= DatabaseLocationInputController
39 //====================================================================
40 class DatabaseLocationInputController_Impl;
41 /** helper class to control controls needed to input a database location
43 If you allow, in your dialog, to save a database document, then you usually
44 have a OFileURLControl for inputting the actual location, and a push button
45 to browse for a location.
47 This helper class controls such two UI elements.
49 class SVX_DLLPUBLIC DatabaseLocationInputController
51 public:
52 DatabaseLocationInputController(
53 const ::comphelper::ComponentContext& _rContext,
54 ::svt::OFileURLControl& _rLocationInput,
55 PushButton& _rBrowseButton
57 ~DatabaseLocationInputController();
59 /** sets the given URL at the input control, after translating it into a system path
61 void setURL( const String& _rURL );
63 /** returns the current database location, in form of an URL (not a system path)
65 String getURL() const;
67 /** prepares committing the database location entered in the input field
69 Effectively, this method checks whether the file in the location already
70 exists, and if so, it asks the user whether to overwrite it.
72 If the method is called multiple times, this check only happens when the location
73 changed since the last call.
75 bool prepareCommit();
77 private:
78 ::std::auto_ptr< DatabaseLocationInputController_Impl >
79 m_pImpl;
82 //........................................................................
83 } // namespace svx
84 //........................................................................
86 #endif // SVX_DATABASELOCATIONINPUT_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */