Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / unx / gtk3_kde5 / gtk3_kde5_folderpicker.cxx
blobfa0b562cc81cac3945e44825468399707d1f08e4
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 #include "gtk3_kde5_folderpicker.hxx"
22 #include <vcl/svapp.hxx>
24 #include <strings.hrc>
26 using namespace ::com::sun::star;
27 using namespace ::com::sun::star::ui::dialogs;
28 using namespace ::com::sun::star::lang;
29 using namespace ::com::sun::star::uno;
31 // constructor
33 Gtk3KDE5FolderPicker::Gtk3KDE5FolderPicker(
34 const uno::Reference<uno::XComponentContext>& /*xContext*/)
36 m_ipc.sendCommand(Commands::EnablePickFolderMode);
37 setTitle(getResString(STR_FPICKER_FOLDER_DEFAULT_TITLE));
40 Gtk3KDE5FolderPicker::~Gtk3KDE5FolderPicker() = default;
42 void SAL_CALL Gtk3KDE5FolderPicker::setDisplayDirectory(const OUString& aDirectory)
44 m_ipc.sendCommand(Commands::SetDisplayDirectory, aDirectory);
47 OUString SAL_CALL Gtk3KDE5FolderPicker::getDisplayDirectory()
49 auto id = m_ipc.sendCommand(Commands::GetDisplayDirectory);
50 OUString ret;
51 m_ipc.readResponse(id, ret);
52 return ret;
55 OUString SAL_CALL Gtk3KDE5FolderPicker::getDirectory()
57 auto id = m_ipc.sendCommand(Commands::GetSelectedFiles);
58 uno::Sequence<OUString> seq;
59 m_ipc.readResponse(id, seq);
60 return seq.hasElements() ? seq[0] : OUString();
63 void SAL_CALL Gtk3KDE5FolderPicker::setDescription(const OUString& /*rDescription*/) {}
65 // XExecutableDialog functions
67 void SAL_CALL Gtk3KDE5FolderPicker::setTitle(const OUString& aTitle)
69 m_ipc.sendCommand(Commands::SetTitle, aTitle);
72 sal_Int16 SAL_CALL Gtk3KDE5FolderPicker::execute()
74 SolarMutexGuard g;
75 return m_ipc.execute();
78 // XCancellable
80 void SAL_CALL Gtk3KDE5FolderPicker::cancel()
82 // TODO
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */