File indexing completed on 2025-01-18 10:12:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGMimeTypes
0013 #define ROOT_TGMimeTypes
0014
0015
0016 #include "TGClient.h"
0017 #include "TGPicture.h"
0018
0019 class TOrdCollection;
0020 class TRegexp;
0021
0022
0023
0024
0025
0026
0027
0028
0029 class TGMime : public TObject {
0030
0031 friend class TGMimeTypes;
0032
0033 private:
0034 TString fType;
0035 TString fPattern;
0036 TString fAction;
0037 TString fIcon;
0038 TString fSIcon;
0039 TRegexp *fReg;
0040
0041 public:
0042 TGMime() : fReg(nullptr) {}
0043 ~TGMime() override;
0044 };
0045
0046
0047 class TGMimeTypes : public TObject {
0048
0049 protected:
0050 TGClient *fClient;
0051 TString fFilename;
0052 Bool_t fChanged;
0053 TOrdCollection *fList;
0054
0055 TGMimeTypes(const TGMimeTypes& gmt);
0056 TGMimeTypes& operator=(const TGMimeTypes& gmt);
0057 TGMime *Find(const char *filename);
0058
0059 public:
0060 TGMimeTypes(TGClient *client, const char *file);
0061 ~TGMimeTypes() override;
0062
0063 void SaveMimes();
0064 Bool_t HasChanged() const { return fChanged; }
0065 void AddType(const char *type, const char *pat, const char *icon, const char *sicon, const char *action);
0066 void Print(Option_t *option="") const override;
0067 Bool_t GetAction(const char *filename, char *action);
0068 Bool_t GetType(const char *filename, char *type);
0069 const TGPicture *GetIcon(const char *filename, Bool_t small_icon);
0070
0071 ClassDefOverride(TGMimeTypes,0)
0072 };
0073
0074 #endif