KWidgetsAddons

kmimetypechooser.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2001-2004 Anders Lund <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-only
6 */
7 
8 #ifndef KMIMETYPE_CHOOSER_H
9 #define KMIMETYPE_CHOOSER_H
10 
11 #include <kwidgetsaddons_export.h>
12 #include <QDialog>
13 #include <QWidget>
14 
29 class KWIDGETSADDONS_EXPORT KMimeTypeChooser : public QWidget
30 {
31  Q_OBJECT
32 
33 public:
37  enum Visuals {
38  Comments = 1,
39  Patterns = 2,
40  EditButton = 4
41  };
58  explicit
59  KMimeTypeChooser(const QString &text = QString(),
60  const QStringList &selectedMimeTypes = QStringList(),
61  const QString &defaultGroup = QString(),
62  const QStringList &groupsToShow = QStringList(),
63  int visuals = Comments | Patterns | EditButton,
64  QWidget *parent = nullptr);
66 
70  QStringList mimeTypes() const;
74  QStringList patterns() const;
75 
76 private:
77  class KMimeTypeChooserPrivate *d;
78 
79  Q_PRIVATE_SLOT(d, void _k_slotCurrentChanged(const QModelIndex &index))
80  Q_PRIVATE_SLOT(d, void _k_slotSycocaDatabaseChanged(QStringList))
81 };
82 
114 class KWIDGETSADDONS_EXPORT KMimeTypeChooserDialog : public QDialog
115 {
116  Q_OBJECT
117 public:
135  explicit
136  KMimeTypeChooserDialog(const QString &title = QString(),
137  const QString &text = QString(),
138  const QStringList &selectedMimeTypes = QStringList(),
139  const QString &defaultGroup = QString(),
140  const QStringList &groupsToShow = QStringList(),
142  QWidget *parent = nullptr);
143 
147  KMimeTypeChooserDialog(const QString &title,
148  const QString &text,
149  const QStringList &selectedMimeTypes,
150  const QString &defaultGroup,
151  QWidget *parent = nullptr);
152 
154 
158  KMimeTypeChooser *chooser();
159 
160  QSize sizeHint() const override;
161 
162 private:
163  class Private;
164  Private *const d;
165 };
166 #endif // _KMIMETYPE_CHOOSER_H_
Visuals
Buttons and data for display.
Show the MIME type comment (e.g. "HTML Document") in a column.
Show the MIME types glob patterns (e.g. "*.html;*.htm") in a column.
virtual QSize sizeHint() const const override
A dialog to select MIME types from the list of available ones on the system.
Show the "Edit" button, allowing to edit the selected type.
This widget provides a checkable list of all available MIME types, presented as a treeview...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:44:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.