Add office types to Mimer
This commit is contained in:
parent
9efbb6d6f0
commit
d16562900f
2 changed files with 20 additions and 1 deletions
|
@ -12,6 +12,11 @@ const QString Mimer::GIF = "image/gif";
|
||||||
const QString Mimer::JPEG = "image/jpeg";
|
const QString Mimer::JPEG = "image/jpeg";
|
||||||
const QString Mimer::TIFF = "image/tiff";
|
const QString Mimer::TIFF = "image/tiff";
|
||||||
|
|
||||||
|
const QString Mimer::DOC = "application/msword";
|
||||||
|
const QString Mimer::DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||||
|
const QString Mimer::RTF = "text/rtf";
|
||||||
|
const QString Mimer::ODT = "application/vnd.oasis.opendocument.text";
|
||||||
|
|
||||||
|
|
||||||
Mimer::Mimer()
|
Mimer::Mimer()
|
||||||
{
|
{
|
||||||
|
|
16
src/mimer.h
16
src/mimer.h
|
@ -37,7 +37,21 @@ public:
|
||||||
static const QString JPEG;
|
static const QString JPEG;
|
||||||
static const QString TIFF;
|
static const QString TIFF;
|
||||||
|
|
||||||
Q_INVOKABLE static bool isImage(QString mimeType) {return mimeType.startsWith("image/");}
|
static const QString DOC;
|
||||||
|
static const QString DOCX;
|
||||||
|
static const QString RTF;
|
||||||
|
static const QString ODT;
|
||||||
|
|
||||||
|
Q_INVOKABLE static bool isImage(QString mimeType)
|
||||||
|
{
|
||||||
|
return mimeType.startsWith("image/");
|
||||||
|
}
|
||||||
|
Q_INVOKABLE static bool isOffice(QString mimeType)
|
||||||
|
{
|
||||||
|
static QStringList OfficeForamts {DOC, DOCX, RTF, ODT};
|
||||||
|
return OfficeForamts.contains(mimeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue