00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <atlbase.h>
00025
00026 class Filter
00027 {
00028 public:
00029 bool fDisabled, fTemporary;
00030 enum {REGISTERED, EXTERNAL} type;
00031
00032 CStringW dispname;
00033
00034 CString path, name;
00035 CLSID clsid;
00036
00037 CList<GUID> guids, backup;
00038 enum {PREFERRED, BLOCK, MERIT};
00039 int iLoadType;
00040 DWORD dwMerit;
00041
00042 Filter() {fTemporary = false;}
00043 Filter(Filter* f)
00044 {
00045 fDisabled = f->fDisabled;
00046 fTemporary = f->fTemporary;
00047 type = f->type;
00048 dispname = f->dispname;
00049 path = f->path;
00050 name = f->name;
00051 clsid = f->clsid;
00052 guids.AddTail(&f->guids);
00053 backup.AddTail(&f->backup);
00054 iLoadType = f->iLoadType;
00055 dwMerit = f->dwMerit;
00056 }
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 class CFilterMapper2 : protected CUnknown, public IFilterMapper2
00092 {
00093 static bool fInitialized;
00094
00095 CComPtr<IUnknown> m_pFM2;
00096 CString m_path;
00097
00098 bool m_fRefCounted, m_fAllowUnreg;
00099
00100 protected:
00101 DECLARE_IUNKNOWN;
00102 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00103
00104
00105
00106 STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description);
00107 STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter);
00108 STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2);
00109 STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit,
00110 BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
00111 BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut);
00112
00113 public:
00114 CFilterMapper2(bool fRefCounted, bool fAllowUnreg = false, LPUNKNOWN pUnkOuter = NULL);
00115 virtual ~CFilterMapper2();
00116
00117 void SetInner(IUnknown* pUnk) {m_pFM2 = pUnk;}
00118
00119 static void Init();
00120
00121 static IFilterMapper2* m_pFilterMapper2;
00122 CList<Filter*> m_filters;
00123 void Register(CString path);
00124 };