00001
00026 #include "libnebular.hpp"
00027 #include "libnebular-plugin.hpp"
00028
00029 #ifndef LIBNEBULAR_PLUGIN_BASE_HPP_
00030 #define LIBNEBULAR_PLUGIN_BASE_HPP_
00031
00033 #define LIBNEBULAR_SET_PLUGIN_PIC_HANDLER_MGR(CurrPicHandlerMgr) \
00034 extern "C"{ \
00035 boost::shared_ptr<libnebular::PicHandlerMgr> getNewCurrPicHandlerMgr(){ \
00036 return boost::shared_ptr<libnebular::PicHandlerMgr>(new CurrPicHandlerMgr); \
00037 } \
00038 } \
00039
00040
00041 namespace libnebular{
00048 template <typename CurrPictureHandler>
00049 class MgrForPicHandler: public PicHandlerMgr{
00050 public:
00052 MgrForPicHandler(){}
00053
00054 virtual ~MgrForPicHandler() {}
00055
00056
00057 bool virtual isHandleableByFileExt(Picture &pictureFile) const;
00058
00059 bool virtual isHandleableByContentMagic(Picture &pictureFile) const;
00060
00061 bool virtual isWriteable(Picture &picture) const;
00062
00063
00064 boost::shared_ptr<PictureHandler> createPictureHandler() const{
00065 return boost::shared_ptr<PictureHandler>(
00066 new CurrPictureHandler
00067 );
00068 }
00069 };
00070 }
00071
00072 #endif // LIBNEBULAR_PLUGIN_BASE_HPP_
00073