LibEngsas
emimetype.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2012 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef EMIMETYPE_H
21 #define EMIMETYPE_H
22 
23 #include "emimemodelitem.h"
24 
25 class EMimeProgram;
26 
27 #include <QString>
28 #include <QList>
29 #include <QFileInfo>
30 
35 class EMimeType : public EMimeModelItem
36 {
37  public:
38  EMimeType ( QString newName = "" );
39  ~EMimeType();
40 
41  inline static QString group(){ return "MimeTypes"; };
42 
43  void setName ( QString newName );
47  QString name() const;
52  void setSuffix ( QString suffix );
53  QString suffix() const;
58  void setPrefix ( QString prefix );
59  QString prefix() const;
60 
65  void setDefaultProgram ( EMimeProgram *newProgram );
66  void setDefaultProgram ( QString newProgram );
68  void setPossibleProgram ( QString possibleProgram );
69  void setPossibleProgram ( QFileInfo possibleProgram );
70  void setPossibleProgram ( EMimeProgram *possibleProgram );
71  QList<EMimeProgram*> possiblePrograms() const;
72 
73  int rowCount() const;
74 
75  bool saveMimeType();
76  bool loadMimeType ( QString newName = "" );
77 
78  bool operator== ( const EMimeType &compareType ) const;
79  bool operator!= ( const EMimeType &compareType ) const;
80 
81  private:
82  QString myName;
83  QString mySuffix, myPrefix;
85  QList<EMimeProgram*> myPossiblePrograms;
86 };
87 
88 #endif // EMIMETYPE_H
void setPrefix(QString prefix)
Definition: emimetype.cpp:63
Base calls for all items in the EMimeTypeModel.
Definition: emimemodelitem.h:27
QString prefix() const
Definition: emimetype.cpp:70
void setName(QString newName)
Definition: emimetype.cpp:41
QString suffix() const
Definition: emimetype.cpp:58
EMimeType(QString newName="")
Definition: emimetype.cpp:29
bool loadMimeType(QString newName="")
Definition: emimetype.cpp:171
QList< EMimeProgram * > possiblePrograms() const
Definition: emimetype.cpp:124
EMimeProgram * myDefaultProgram
Definition: emimetype.h:84
bool saveMimeType()
Definition: emimetype.cpp:134
bool operator!=(const EMimeType &compareType) const
Definition: emimetype.cpp:224
void setPossibleProgram(QString possibleProgram)
Definition: emimetype.cpp:104
An application, used by EMimeType.
Definition: emimeprogram.h:35
int rowCount() const
Definition: emimetype.cpp:129
static QString group()
Definition: emimetype.h:41
bool operator==(const EMimeType &compareType) const
Definition: emimetype.cpp:216
QString myName
Definition: emimetype.h:82
~EMimeType()
Definition: emimetype.cpp:36
void setSuffix(QString suffix)
Definition: emimetype.cpp:51
QString myPrefix
Definition: emimetype.h:83
The representation of an MimeType, related applications and settings.
Definition: emimetype.h:35
void setDefaultProgram(EMimeProgram *newProgram)
Definition: emimetype.cpp:75
QList< EMimeProgram * > myPossiblePrograms
Definition: emimetype.h:85
QString name() const
Definition: emimetype.cpp:46
QString mySuffix
Definition: emimetype.h:83
EMimeProgram * defaultProgram() const
Definition: emimetype.cpp:99