00001
00033 #ifndef INC_MI32_FILETYPE_H
00034 #define INC_MI32_FILETYPE_H
00035
00036 #ifndef INC_MI32_DELEGATE_H
00037 #include <mi32/delegate.h>
00038 #endif
00039
00040 #ifndef INC_MI32_MILIST_H
00041 #include <mi32/milist.h>
00042 #endif
00043
00044 #ifndef INC_MI32_ICONID_H
00045 #include <mi32/iconid.h>
00046 #endif
00047
00048
00049 #ifdef RVCSYSDLL
00050 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00051 #else
00052 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00053 #endif
00054
00055
00056 #ifndef GENERATING_DOXYGEN_OUTPUT
00057 class MISTRING;
00058 class MISTRINGLIST;
00059 class FILE_RAW;
00060 class FILEPATH;
00061 #endif
00062
00063
00064
00067 class CLASSLIBEXPORT FILETYPE {
00068 public:
00070 typedef fastdelegate::FastDelegate<bool(FILE_RAW&)> DELEGATE_FORMAT;
00071
00073 typedef fastdelegate::FastDelegate<void(MISTRING&, const FILEPATH&)> PROPERTIES_DELEGATE;
00074
00076 FILETYPE (
00077 );
00078
00080 FILETYPE (
00081 const FILETYPE& rhs
00082 );
00083
00085 explicit FILETYPE (
00086 const char *extns,
00087 ICONID iconid = ICONID_DESKTOP_FILE,
00088 const TEXTID description = TEXTID__None
00089 );
00090
00092 FILETYPE (
00093 const char *extns,
00094 ICONID iconid,
00095 const TEXTID description,
00096 DELEGATE_FORMAT delegate
00097 );
00098
00100 FILETYPE (
00101 const char *extns,
00102 ICONID iconid,
00103 const TEXTID description,
00104 PROPERTIES_DELEGATE delegate
00105 );
00106
00108 FILETYPE (
00109 const char *extns,
00110 ICONID iconid,
00111 const TEXTID description,
00112 DELEGATE_FORMAT formatdelegate,
00113 PROPERTIES_DELEGATE propertiesdelegate
00114 );
00115
00117 explicit FILETYPE (
00118 const MISTRING& extn,
00119 ICONID iconid = ICONID_DESKTOP_FILE
00120 );
00121
00123 virtual ~FILETYPE (
00124 );
00125
00127 FILETYPE& operator= (
00128 const FILETYPE& rhs
00129 );
00130
00132 bool CanCheckIsFormat (
00133 ) const;
00134
00136 const MISTRING& GetDescription (
00137 ) const;
00138
00140 const MISTRINGLIST& GetExtnList (
00141 ) const;
00142
00144 ICONID GetIconID (
00145 ) const;
00146
00148 void GetProperties (
00149 MISTRING& properties,
00150 const FILEPATH& filepath
00151 ) const;
00152
00155 bool IsFormat (
00156 FILE_RAW& file
00157 ) const;
00158
00160 void RegisterInCommonSet (
00161 ) const;
00162
00164 void SetDelegateIsFormat (
00165 DELEGATE_FORMAT delegate
00166 );
00167
00169 void SetPropertiesDelegate (
00170 PROPERTIES_DELEGATE delegate
00171 );
00172
00173 private:
00174 #ifndef GENERATING_DOXYGEN_OUTPUT
00175 class PRIV;
00176 PRIV *m_pPriv;
00177 #endif
00178 };
00179
00180
00181
00182 #undef CLASSLIBEXPORT
00183 #endif // INC_MI32_FILETYPE_H