LibreOffice Module dbaccess (master) 1
opendoccontrols.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/weld.hxx>
23#include <rtl/ustring.hxx>
24
25namespace dbaui
26{
27
28 // OpenDocumentButton
35 {
36 private:
37 OUString m_sModule;
38
39 std::unique_ptr<weld::Button> m_xControl;
40 public:
41 OpenDocumentButton(std::unique_ptr<weld::Button> xControl, const char* _pAsciiModuleName);
42
43 void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
44 void connect_clicked(const Link<weld::Button&, void>& rLink) { m_xControl->connect_clicked(rLink); }
45
46 private:
47 void impl_init( const char* _pAsciiModuleName );
48 };
49
50 // OpenDocumentListBox
52 {
53 private:
54 typedef std::pair< OUString, OUString > StringPair;
55
56 std::vector<StringPair> m_aURLs;
57
58 std::unique_ptr<weld::ComboBox> m_xControl;
59
60 public:
61 OpenDocumentListBox(std::unique_ptr<weld::ComboBox> xControl, const char* _pAsciiModuleName);
62
63 OUString GetSelectedDocumentURL() const;
64
65 void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
66 int get_count() const { return m_xControl->get_count(); }
67 void set_active(int nPos) { m_xControl->set_active(nPos); }
68 void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
69
70 private:
71 const StringPair & impl_getDocumentAtIndex( sal_uInt16 _nListIndex ) const;
72
73 void impl_init( const char* _pAsciiModuleName );
74 };
75
76} // namespace dbaui
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
a button which can be used to open a document
std::unique_ptr< weld::Button > m_xControl
void connect_clicked(const Link< weld::Button &, void > &rLink)
OpenDocumentButton(std::unique_ptr< weld::Button > xControl, const char *_pAsciiModuleName)
void impl_init(const char *_pAsciiModuleName)
void set_sensitive(bool bSensitive)
std::pair< OUString, OUString > StringPair
const StringPair & impl_getDocumentAtIndex(sal_uInt16 _nListIndex) const
std::vector< StringPair > m_aURLs
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
void impl_init(const char *_pAsciiModuleName)
void set_sensitive(bool bSensitive)
OUString GetSelectedDocumentURL() const
std::unique_ptr< weld::ComboBox > m_xControl
OpenDocumentListBox(std::unique_ptr< weld::ComboBox > xControl, const char *_pAsciiModuleName)
sal_uInt16 nPos