LibreOffice Module svx (master)  1
txencbox.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 #ifndef INCLUDED_SVX_TXENCBOX_HXX
20 #define INCLUDED_SVX_TXENCBOX_HXX
21 
22 #include <vcl/weld.hxx>
23 #include <rtl/textenc.h>
24 #include <svx/svxdllapi.h>
25 
27 {
28 private:
29  std::unique_ptr<weld::ComboBox> m_xControl;
30 
31 public:
32  SvxTextEncodingBox(std::unique_ptr<weld::ComboBox> pControl);
33 
35 
51  void FillFromTextEncodingTable(
52  bool bExcludeImportSubsets,
53  sal_uInt32 nExcludeInfoFlags = 0,
54  sal_uInt32 nButIncludeInfoFlags = 0
55  );
56 
72  void FillFromDbTextEncodingMap(
73  bool bExcludeImportSubsets,
74  sal_uInt32 nExcludeInfoFlags = 0);
75 
79  void FillWithMimeAndSelectBest();
80 
81  void InsertTextEncoding( const rtl_TextEncoding nEnc );
82 
83  void InsertTextEncoding( const rtl_TextEncoding nEnc,
84  const OUString& rEntry );
85 
86  void SelectTextEncoding( const rtl_TextEncoding nEnc );
87 
88  rtl_TextEncoding GetSelectTextEncoding() const;
89 
90  void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
91  void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
92  void grab_focus() { m_xControl->grab_focus(); }
93  int get_active() const { return m_xControl->get_active(); }
94  void set_active(int nActive) { m_xControl->set_active(nActive); }
95  void show() { m_xControl->show(); }
96  void hide() { m_xControl->hide(); }
97 };
98 
100 {
101 private:
102  std::unique_ptr<weld::TreeView> m_xControl;
103 
104 public:
105  SvxTextEncodingTreeView(std::unique_ptr<weld::TreeView> pControl);
106 
108 
119  void FillFromTextEncodingTable(
120  bool bExcludeImportSubsets,
121  sal_uInt32 nExcludeInfoFlags = 0);
122 
133  void FillFromDbTextEncodingMap(
134  bool bExcludeImportSubsets,
135  sal_uInt32 nExcludeInfoFlags = 0);
136 
137  void InsertTextEncoding( const rtl_TextEncoding nEnc );
138 
139  void InsertTextEncoding( const rtl_TextEncoding nEnc,
140  const OUString& rEntry );
141 
142  void SelectTextEncoding( const rtl_TextEncoding nEnc );
143 
144  rtl_TextEncoding GetSelectTextEncoding() const;
145 
146  void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xControl->connect_changed(rLink); }
147  void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { m_xControl->connect_row_activated(rLink); }
148  void grab_focus() { m_xControl->grab_focus(); }
149  void show() { m_xControl->show(); }
150  void hide() { m_xControl->hide(); }
151  int get_height_rows(int nRows) const
152  {
153  return m_xControl->get_height_rows(nRows);
154  }
155  void set_size_request(int nWidth, int nHeight)
156  {
157  m_xControl->set_size_request(nWidth, nHeight);
158  }
159 };
160 
161 #endif
162 
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xControl
Definition: txencbox.hxx:29
void connect_row_activated(const Link< weld::TreeView &, bool > &rLink)
Definition: txencbox.hxx:147
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
void set_sensitive(bool bSensitive)
Definition: txencbox.hxx:91
void set_size_request(int nWidth, int nHeight)
Definition: txencbox.hxx:155
int get_active() const
Definition: txencbox.hxx:93
void connect_changed(const Link< weld::TreeView &, void > &rLink)
Definition: txencbox.hxx:146
std::unique_ptr< weld::TreeView > m_xControl
Definition: txencbox.hxx:102
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
Definition: txencbox.hxx:90
int get_height_rows(int nRows) const
Definition: txencbox.hxx:151
void set_active(int nActive)
Definition: txencbox.hxx:94