2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
29 bool fDisabled
, fTemporary
;
30 enum {REGISTERED
, EXTERNAL
} type
;
37 CAtlList
<GUID
> guids
, backup
;
38 enum {PREFERRED
, BLOCK
, MERIT
};
42 FilterOverride() {fTemporary
= false;}
43 FilterOverride(FilterOverride
* f
)
45 fDisabled
= f
->fDisabled
;
46 fTemporary
= f
->fTemporary
;
48 dispname
= f
->dispname
;
52 guids
.AddTailList(&f
->guids
);
53 backup
.AddTailList(&f
->backup
);
54 iLoadType
= f
->iLoadType
;
59 class CFilterMapper2 : protected CUnknown, protected IFilterMapper2
61 static bool fInitialized;
63 CComPtr<IFilterMapper2> m_pFM2;
68 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
72 STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description);
73 STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter);
74 STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2);
75 STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit,
76 BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
77 BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut);
81 virtual ~CFilterMapper2();
85 static IFilterMapper2* m_pFilterMapper2;
86 CList<Filter*> m_filters;
87 void Register(CString path);
91 class CFilterMapper2
: protected CUnknown
, public IFilterMapper2
93 static bool fInitialized
;
95 CComPtr
<IUnknown
> m_pFM2
;
98 bool m_fRefCounted
, m_fAllowUnreg
;
102 STDMETHODIMP
NonDelegatingQueryInterface(REFIID riid
, void** ppv
);
106 STDMETHODIMP
CreateCategory(REFCLSID clsidCategory
, DWORD dwCategoryMerit
, LPCWSTR Description
);
107 STDMETHODIMP
UnregisterFilter(const CLSID
* pclsidCategory
, const OLECHAR
* szInstance
, REFCLSID Filter
);
108 STDMETHODIMP
RegisterFilter(REFCLSID clsidFilter
, LPCWSTR Name
, IMoniker
** ppMoniker
, const CLSID
* pclsidCategory
, const OLECHAR
* szInstance
, const REGFILTER2
* prf2
);
109 STDMETHODIMP
EnumMatchingFilters(IEnumMoniker
** ppEnum
, DWORD dwFlags
, BOOL bExactMatch
, DWORD dwMerit
,
110 BOOL bInputNeeded
, DWORD cInputTypes
, const GUID
* pInputTypes
, const REGPINMEDIUM
* pMedIn
, const CLSID
* pPinCategoryIn
, BOOL bRender
,
111 BOOL bOutputNeeded
, DWORD cOutputTypes
, const GUID
* pOutputTypes
, const REGPINMEDIUM
* pMedOut
, const CLSID
* pPinCategoryOut
);
114 CFilterMapper2(bool fRefCounted
, bool fAllowUnreg
= false, LPUNKNOWN pUnkOuter
= NULL
);
115 virtual ~CFilterMapper2();
117 void SetInner(IUnknown
* pUnk
) {m_pFM2
= pUnk
;}
121 static IFilterMapper2
* m_pFilterMapper2
;
122 CList
<FilterOverride
*> m_filters
;
123 void Register(CString path
);