tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / dbaccess / source / ui / inc / opendoccontrols.hxx
blobd2cca52811111355c4f46c266b2d0e969550101f
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 #pragma once
22 #include <vcl/weld.hxx>
23 #include <rtl/ustring.hxx>
25 namespace dbaui
28 // OpenDocumentButton
29 /** a button which can be used to open a document
31 The text of the button is the same as for the "Open" command in the application
32 UI. Additionally, the icon for this command is also displayed on the button.
34 class OpenDocumentButton
36 private:
37 std::unique_ptr<weld::Button> m_xControl;
38 public:
39 OpenDocumentButton(std::unique_ptr<weld::Button> xControl, const OUString& _rAsciiModuleName);
41 void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
42 void connect_clicked(const Link<weld::Button&, void>& rLink) { m_xControl->connect_clicked(rLink); }
45 // OpenDocumentListBox
46 class OpenDocumentListBox
48 private:
49 typedef std::pair< OUString, OUString > StringPair;
51 std::vector<StringPair> m_aURLs;
53 std::unique_ptr<weld::ComboBox> m_xControl;
55 public:
56 OpenDocumentListBox(std::unique_ptr<weld::ComboBox> xControl, const char* _pAsciiModuleName);
58 OUString GetSelectedDocumentURL() const;
60 void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
61 int get_count() const { return m_xControl->get_count(); }
62 void set_active(int nPos) { m_xControl->set_active(nPos); }
63 void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
65 private:
66 const StringPair & impl_getDocumentAtIndex( sal_uInt16 _nListIndex ) const;
68 void impl_init( const char* _pAsciiModuleName );
71 } // namespace dbaui
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */