00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PERSISTSTORAGE_H__
00024 #define __PERSISTSTORAGE_H__
00025
00026 #include <ocidl.h>
00027
00028 class VLCPersistStorage : public IPersistStorage
00029 {
00030
00031 public:
00032
00033 VLCPersistStorage(VLCPlugin *p_instance) : _p_instance(p_instance) {};
00034 virtual ~VLCPersistStorage() {};
00035
00036
00037 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
00038 {
00039 if( (NULL != ppv)
00040 && (IID_IUnknown == riid)
00041 && (IID_IPersist == riid)
00042 && (IID_IPersistStorage == riid) ) {
00043 AddRef();
00044 *ppv = reinterpret_cast<LPVOID>(this);
00045 return NOERROR;
00046 }
00047 return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
00048 };
00049
00050 STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
00051 STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
00052
00053
00054 STDMETHODIMP GetClassID(LPCLSID);
00055
00056
00057 STDMETHODIMP IsDirty(void);
00058 STDMETHODIMP InitNew(IStorage *);
00059 STDMETHODIMP Load(IStorage *);
00060 STDMETHODIMP Save(IStorage *, BOOL);
00061 STDMETHODIMP SaveCompleted(IStorage *);
00062 STDMETHODIMP HandsOffStorage(void);
00063
00064 private:
00065
00066 VLCPlugin *_p_instance;
00067 };
00068
00069 #endif
00070