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
26 [uuid("03481710-D73E-4674-839F-03EDE2D60ED8")]
27 interface ISpecifyPropertyPages2
: public ISpecifyPropertyPages
29 STDMETHOD (CreatePage
) (const GUID
& guid
, IPropertyPage
** ppPage
) = 0;
32 class CInternalPropertyPageWnd
: public CWnd
35 CComPtr
<IPropertyPageSite
> m_pPageSite
;
38 CFont m_font
, m_monospacefont
;
41 virtual BOOL
OnWndMsg(UINT message
, WPARAM wParam
, LPARAM lParam
, LRESULT
* pResult
);
44 CInternalPropertyPageWnd();
46 void SetDirty(bool fDirty
= true) {m_fDirty
= fDirty
; if(fDirty
&& m_pPageSite
) m_pPageSite
->OnStatusChange(PROPPAGESTATUS_DIRTY
);}
47 bool GetDirty() {return m_fDirty
;}
49 virtual BOOL
Create(IPropertyPageSite
* pPageSite
, LPCRECT pRect
, CWnd
* pParentWnd
);
51 virtual bool OnConnect(const CInterfaceList
<IUnknown
, &IID_IUnknown
>& pUnks
) {return true;}
52 virtual void OnDisconnect() {}
53 virtual bool OnActivate() {return true;}
54 virtual void OnDeactivate() {}
55 virtual bool OnApply() {return true;}
60 class CInternalPropertyPage
62 , public IPropertyPage
65 CComPtr
<IPropertyPageSite
> m_pPageSite
;
66 CInterfaceList
<IUnknown
, &IID_IUnknown
> m_pUnks
;
67 CInternalPropertyPageWnd
* m_pWnd
;
70 virtual CInternalPropertyPageWnd
* GetWindow() = 0;
71 virtual LPCTSTR
GetWindowTitle() = 0;
72 virtual CSize
GetWindowSize() = 0;
75 CInternalPropertyPage(LPUNKNOWN lpunk
, HRESULT
* phr
);
76 virtual ~CInternalPropertyPage();
79 STDMETHODIMP
NonDelegatingQueryInterface(REFIID riid
, void** ppv
);
83 STDMETHODIMP
SetPageSite(IPropertyPageSite
* pPageSite
);
84 STDMETHODIMP
Activate(HWND hwndParent
, LPCRECT pRect
, BOOL fModal
);
85 STDMETHODIMP
Deactivate();
86 STDMETHODIMP
GetPageInfo(PROPPAGEINFO
* pPageInfo
);
87 STDMETHODIMP
SetObjects(ULONG cObjects
, LPUNKNOWN
* ppUnk
);
88 STDMETHODIMP
Show(UINT nCmdShow
);
89 STDMETHODIMP
Move(LPCRECT prect
);
90 STDMETHODIMP
IsPageDirty();
92 STDMETHODIMP
Help(LPCWSTR lpszHelpDir
);
93 STDMETHODIMP
TranslateAccelerator(LPMSG lpMsg
);
96 template<class WndClass
>
97 class CInternalPropertyPageTempl
: public CInternalPropertyPage
99 virtual CInternalPropertyPageWnd
* GetWindow()
101 return new WndClass();
104 virtual LPCTSTR
GetWindowTitle()
106 return WndClass::GetWindowTitle();
109 virtual CSize
GetWindowSize()
111 return WndClass::GetWindowSize();
115 CInternalPropertyPageTempl(LPUNKNOWN lpunk
, HRESULT
* phr
)
116 : CInternalPropertyPage(lpunk
, phr
)