/*************************************************************** * Name: defaultmimehandler.h * Purpose: Code::Blocks plugin * Author: Yiannis An. Mandravellos * Created: 03/13/05 14:08:51 * Copyright: (c) Yiannis An. Mandravellos * License: GPL **************************************************************/ #ifndef DEFAULTMIMEHANDLER_H #define DEFAULTMIMEHANDLER_H #ifdef __WXMSW__ #if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "defaultmimehandler.h" #endif #endif // For compilers that support precompilation, includes #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif #include // the base class we 're inheriting #include // needed to use the Code::Blocks SDK #include "mimetypesarray.h" class DefaultMimeHandler : public cbMimePlugin { public: DefaultMimeHandler(); ~DefaultMimeHandler(); int Configure(); bool HandlesEverything() const { return true; } bool CanHandleFile(const wxString& filename) const; int OpenFile(const wxString& filename); void OnAttach(); // fires when the plugin is attached to the application void OnRelease(bool appShutDown); // fires when the plugin is released from the application protected: cbMimeType* FindMimeTypeFor(const wxString& filename); wxString ChooseExternalProgram(); int DoOpenFile(cbMimeType* mt, const wxString& filename); MimeTypesArray m_MimeTypes; private: }; CB_DECLARE_PLUGIN(); #endif // DEFAULTMIMEHANDLER_H