| 1 | /* |
| 2 | * libqtxdg - An Qt implementation of freedesktop.org xdg specs |
| 3 | * Copyright (C) 2014 Luís Pereira <[email protected]> |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef QTXDG_MIMETYPE_H |
| 22 | #define QTXDG_MIMETYPE_Hcxx . . $ `src/qtxdg/xdgmimetype.h:22:9`! |
| 23 | |
| 24 | #include "xdgmacros.h"cxx . . $ `<file>/src/qtxdg/xdgmacros.h`/ |
| 25 | #include <QMimeType> |
| 26 | #include <QIcon> |
| 27 | #include <QString> |
| 28 | #include <QSharedData> |
| 29 | |
| 30 | #include <QDebug> |
| 31 | |
| 32 | class XdgMimeTypePrivatecxx . . $ XdgMimeTypePrivate#; |
| 33 | |
| 34 | //! Describes types of file or data, represented by a MIME type string. |
| 35 | /*! This class is an QMimeType descendent. The differences are the icon() and |
| 36 | * iconName() methods. @see icon() @see iconName() |
| 37 | * |
| 38 | * Some parts of the documentation are based on QMimeType documentation. |
| 39 | * @see http://qt-project.org/doc/qt-5/qmimetype.html |
| 40 | * |
| 41 | * @author Luís Pereira ([email protected]) |
| 42 | */ |
| 43 | |
| 44 | class QTXDG_APIcxx . . $ `src/qtxdg/xdgmacros.h:32:13`! XdgMimeTypecxx . . $ XdgMimeType# : public QMimeTypecxx . . $ QMimeType# { |
| 45 | public: |
| 46 | |
| 47 | /*! Constructs an XdgMimeType object initialized with default property |
| 48 | values that indicate an invalid MIME type. |
| 49 | @see QMimeType::QMimeType() |
| 50 | */ |
| 51 | XdgMimeTypecxx . . $ XdgMimeType#XdgMimeType(49f6e7a06ebc5aa8).(); |
| 52 | |
| 53 | /*! Constructs an XdgMimeType object from an QMimeType object |
| 54 | * @see QMimeType |
| 55 | */ |
| 56 | XdgMimeTypecxx . . $ XdgMimeType#XdgMimeType(3ceb988a86ffd6c4).(const QMimeTypecxx . . $ QMimeType#& mime); |
| 57 | |
| 58 | //! Constructs an XdgMimeType object from another XdgMimeType object |
| 59 | XdgMimeTypecxx . . $ XdgMimeType#XdgMimeType(17ad72577fffbe18).(const XdgMimeTypecxx . . $ XdgMimeType#& mime); |
| 60 | |
| 61 | /*! Assigns the data of other to this XdgMimeType object. |
| 62 | * @return a reference to this object. |
| 63 | */ |
| 64 | XdgMimeTypecxx . . $ XdgMimeType# &operatorcxx . . $ XdgMimeType#`operator=`(b79ae9e4c7fa0a39).=(const XdgMimeTypecxx . . $ XdgMimeType# &other); |
| 65 | |
| 66 | |
| 67 | /*! Compares the other XdgMimeType object to this XdgMimeType object. |
| 68 | * @return true if other equals this XdgMimeType object, otherwise returns |
| 69 | * false. The name is the unique identifier for a mimetype, so two mimetypes |
| 70 | * with the same name, are equal. |
| 71 | * @see QMimeType::operator==() |
| 72 | */ |
| 73 | bool operatorcxx . . $ XdgMimeType#`operator==`(172b7beb1f1f8b1e).==(const XdgMimeTypecxx . . $ XdgMimeType# &other) const |
| 74 | { |
| 75 | return namecxx . . $ QMimeType#name(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). other.namecxx . . $ QMimeType#name(6ef7b6c27b00b43d).(); |
| 76 | } |
| 77 | |
| 78 | inline bool operatorcxx . . $ XdgMimeType#`operator!=`(172b7beb1f1f8b1e).!=(const XdgMimeTypecxx . . $ XdgMimeType# &other) const |
| 79 | { |
| 80 | return !operator==(other); |
| 81 | } |
| 82 | |
| 83 | void swapcxx . . $ XdgMimeType#swap(12ac9dbc4de6f323).(XdgMimeTypecxx . . $ XdgMimeType# &other) noexcept; |
| 84 | |
| 85 | //! Destructs the mimetype |
| 86 | ~cxx . . $ XdgMimeType#`~XdgMimeType`(ced63f7c635d850d).XdgMimeTypecxx . . $ XdgMimeType#(); |
| 87 | |
| 88 | //! Returns the name of the MIME type. |
| 89 | /*! The same as QMimeType::name(). Provided for compatibilty with deprecated |
| 90 | * XdgMimeInfo::mimeType(). |
| 91 | * @see QMimeType::name() |
| 92 | */ |
| 93 | inline QStringcxx . . $ QString# mimeTypecxx . . $ XdgMimeType#mimeType(6ef7b6c27b00b43d).() const { return QMimeTypecxx . . $ QMimeType#::namecxx . . $ QMimeType#name(6ef7b6c27b00b43d).(); } |
| 94 | |
| 95 | //! Returns an icon associated with the mimetype. |
| 96 | /*! @return an icon from the current icon theme associated with the |
| 97 | * mimetype. If the icon theme doesn't provide one it returns QIcon(). |
| 98 | * It gets the icon name from iconName() and then gives it to |
| 99 | * XdgIcon::fromTheme(). |
| 100 | * @see iconName() @see XdgIcon::fromTheme() |
| 101 | */ |
| 102 | QIconcxx . . $ QIcon# iconcxx . . $ XdgMimeType#icon(952ef71f8967d9eb).() const; |
| 103 | |
| 104 | //! Returns an icon name associated with the mimetype. |
| 105 | /*! @return an icon name from the current icon theme associated with the |
| 106 | * mimetype. If the current icon theme doesn't provide one, it returns an |
| 107 | * empty QString. |
| 108 | * The returned icon name is suitable to be given to XdgIcon::fromTheme() |
| 109 | * to load the icon. |
| 110 | * @see XdgIcon::fromTheme() |
| 111 | */ |
| 112 | QStringcxx . . $ QString# iconNamecxx . . $ XdgMimeType#iconName(6ef7b6c27b00b43d).() const; |
| 113 | |
| 114 | protected: |
| 115 | friend class XdgMimeTypePrivatecxx . . $ XdgMimeTypePrivate#; |
| 116 | QExplicitlySharedDataPointercxx . . $ QExplicitlySharedDataPointer#<XdgMimeTypePrivatecxx . . $ XdgMimeTypePrivate#> dxcxx . . $ XdgMimeType#dx.; |
| 117 | |
| 118 | |
| 119 | }; |
| 120 | Q_DECLARE_SHAREDcxx . . $ `<external>/9561028201570787675/qtclasshelpermacros.h:207:9`!(XdgMimeType) |
| 121 | |
| 122 | #endif // QTXDG_MIMETYPE_H |