- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# FakeFilterMapper2.h

    00001 /*
    00002  *      Copyright (C) 2003-2005 Gabest
    00003  *      http://www.gabest.org
    00004  *
    00005  *  This Program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2, or (at your option)
    00008  *  any later version.
    00009  *
    00010  *  This Program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00013  *  GNU General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU General Public License
    00016  *  along with GNU Make; see the file COPYING.  If not, write to
    00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00018  *  http://www.gnu.org/copyleft/gpl.html
    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         // REGISTERED
    00032         CStringW dispname;
    00033         // EXTERNAL
    00034         CString path, name;
    00035         CLSID clsid;
    00036         // props
    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 class CFilterMapper2 : protected CUnknown, protected IFilterMapper2
    00060 {
    00061         static bool fInitialized;
    00062
    00063         CComPtr<IFilterMapper2> m_pFM2;
    00064         CString m_path;
    00065
    00066 protected:
    00067         DECLARE_IUNKNOWN;
    00068         STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
    00069
    00070         // IFilterMapper2
    00071
    00072         STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description);
    00073         STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter);
    00074         STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2);
    00075         STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit,
    00076                 BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
    00077                 BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut);
    00078
    00079 public:
    00080         CFilterMapper2();
    00081         virtual ~CFilterMapper2();
    00082
    00083         static void Init();
    00084
    00085         static IFilterMapper2* m_pFilterMapper2;
    00086         CList<Filter*> m_filters;
    00087         void Register(CString path);
    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         // IFilterMapper2
    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 };