summaryrefslogtreecommitdiff
path: root/print/SimplePipelineFilter/XpsFilter.hxx
blob: 003650a6325c6a5e692fc62b812baf94cb52a1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//+--------------------------------------------------------------------------
//
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
//  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//
//  Abstract:
//     WDK print filter sample.
//     This is the header file for the XPS sample.
//
//----------------------------------------------------------------------------

#ifndef _XPS_FILTER_SAMPLE_HXX_
#define _XPS_FILTER_SAMPLE_HXX_

class XpsFilter :
    public  IPrintPipelineFilter,
    private DllLockManager
{
public:

    XpsFilter();

    //
    // IUnknown methods
    //
    __override
    STDMETHODIMP
    QueryInterface(
        _In_       REFIID           riid,
        _Out_      void             **ppv
        );

    __override
    STDMETHODIMP_(ULONG)
    AddRef(
        void
        );

    __override
    STDMETHODIMP_(ULONG)
    Release(
        void
        );

    //
    // IPrintPipelineFilter
    //
    __override
    STDMETHODIMP
    ShutdownOperation(
        void
        );

    __override
    STDMETHODIMP
    InitializeFilter(
        _In_    IInterFilterCommunicator         *pINegotiation,
        _In_    IPrintPipelinePropertyBag        *pIPropertyBag,
        _In_    IPrintPipelineManagerControl     *pIPipelineControl
        );

    __override
    STDMETHODIMP
    StartOperation(
        void
        );

    //
    // Other methods
    //
    static
    const GUID&
    FilterClsid(
        void
        );

private:

    HRESULT
    ProcessFixedPage(
        _In_    void                    *pVoid
        );

    HRESULT
    ProcessXpsDoc(
        _In_    void                    *pVoid
        );

    HRESULT
    ProcessFixedDocSequence(
        _In_    void                    *pVoid
        );

    HRESULT
    ProcessFixedDoc(
        _In_    void                    *pVoid
        );

    HRESULT
    ProcessPart(
        _In_    IUnknown                *pUnk
        );

    static
    HRESULT
    ProcessImagePart(
        _In_    IPartImage              *pIPartImage
        );

    Tools::SmartPtr<IPrintPipelineManagerControl>   m_pIPipelineControl;
    Tools::SmartPtr<IXpsDocumentProvider>           m_pReachProvider;
    Tools::SmartPtr<IXpsDocumentConsumer>           m_pReachConsumer;
    bool                                            m_bShutdown;
    LONG                                            m_cRef;
    LONG                                            m_cIdCount;
};

#endif // _XPS_FILTER_SAMPLE_HXX_