1 
2 #pragma once
3 #include "uiautomation.h"
4 class resource_view_provider : public IRawElementProviderSimple,
5     public IRawElementProviderFragment,
6     public IRawElementProviderFragmentRoot,
7     public ISelectionProvider
8 {
9 public:
10 
11     // Constructor/destructor.
12     resource_view_provider(resource_view* pControl);
13 
14     // IUnknown methods
15     IFACEMETHODIMP_(ULONG) AddRef();
16     IFACEMETHODIMP_(ULONG) Release();
17     IFACEMETHODIMP QueryInterface(REFIID riid, void** ppInterface);
18 
19     // IRawElementProviderSimple methods
20     IFACEMETHODIMP get_ProviderOptions(ProviderOptions* pRetVal);
21     IFACEMETHODIMP GetPatternProvider(PATTERNID iid, IUnknown** pRetVal);
22     IFACEMETHODIMP GetPropertyValue(PROPERTYID idProp, VARIANT* pRetVal);
23     IFACEMETHODIMP get_HostRawElementProvider(IRawElementProviderSimple** pRetVal);
24 
25     // IRawElementProviderFragment methods
26     IFACEMETHODIMP Navigate(NavigateDirection direction, IRawElementProviderFragment** pRetVal);
27     IFACEMETHODIMP GetRuntimeId(SAFEARRAY** pRetVal);
28     IFACEMETHODIMP get_BoundingRectangle(UiaRect* pRetVal);
29     IFACEMETHODIMP GetEmbeddedFragmentRoots(SAFEARRAY** pRetVal);
30     IFACEMETHODIMP SetFocus();
31     IFACEMETHODIMP get_FragmentRoot(IRawElementProviderFragmentRoot** pRetVal);
32 
33     // IRawElementProviderFragmenRoot methods
34     IFACEMETHODIMP ElementProviderFromPoint(double x, double y, IRawElementProviderFragment** pRetVal);
35     IFACEMETHODIMP GetFocus(IRawElementProviderFragment** pRetVal);
36 
37     // ISelectionProvider methods
38     IFACEMETHODIMP GetSelection(SAFEARRAY** pRetVal);
39     IFACEMETHODIMP get_CanSelectMultiple(BOOL* pRetVal);
40     IFACEMETHODIMP get_IsSelectionRequired(BOOL* pRetVal);
41 
42 private:
43     virtual ~resource_view_provider();
44 
45     // Ref counter for this COM object.
46     ULONG m_refCount;
47 
48     // Parent control.
49     HWND m_resViewControlHwnd;
50     resource_view* m_pResViewControl;
51 };