update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / UIImageDropTarget.h
1 //*******************************************************************************
2 // COPYRIGHT NOTES
3 // ---------------
4 // You may use this source code, compile or redistribute it as part of your application 
5 // for free. You cannot redistribute it as a part of a software development 
6 // library without the agreement of the author. If the sources are 
7 // distributed along with the application, you should leave the original 
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
10 // 
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com 
13 // after Sept 2000
14 // 
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
17
18 #if !defined(AFX_IM_OLEIMAGEDROPTARGET_H__BC21D3A1_332C_11D1_ADE9_0000E81B9EF1__INCLUDED_)
19 #define AFX_IM_OLEIMAGEDROPTARGET_H__BC21D3A1_332C_11D1_ADE9_0000E81B9EF1__INCLUDED_
20
21 #if _MSC_VER >= 1000
22 #pragma once
23 #endif // _MSC_VER >= 1000
24 // IM_OleImageDropTarget.h : header file
25 //
26
27 /////////////////////////////////////////////////////////////////////////////
28 /////////////////////////////////////////////////////////////////////////////
29
30
31 /////////////////////////////////////////////////////////////////////////////
32 // CUI_ImageDropTarget window
33 #include "UIDragDropCtrl.h"
34
35 class CDragDropImage;
36
37 class CUI_ImageDropTarget : public COleDropTarget
38 {
39 // Construction
40 public:
41         CUI_ImageDropTarget();
42
43 // Attributes
44 public:
45         inline UINT GetClipboardFormat() const;
46         inline BOOL ImageSetup() const;
47
48 // Operations
49 public:
50
51 // Overrides
52         virtual DROPEFFECT OnDragEnter( CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point );
53         virtual DROPEFFECT OnDragOver( CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point );
54         virtual BOOL OnDrop( CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point );
55         virtual void OnDragLeave( CWnd* pWnd);
56 // Implementation
57 public:
58         virtual ~CUI_ImageDropTarget();
59         void EraseOldImage();
60         void SetImageWin(CWnd *pWnd);
61
62 protected:
63         const CDragDropImage *GetDropImage();
64         CWnd *GetImageWin(CWnd *pWnd);
65 private:
66     int m_nImage;
67         CRect m_rcTotalItem;
68         CPoint m_ptItem;
69     CPoint m_ptPrevPos;
70     CPoint m_ptOldImage;
71     CSize m_sizeDelta;
72     CDragDropImage *m_pImage;
73         UINT m_nCFFormat;
74         CWnd *m_pWnd;
75 };
76
77 inline UINT CUI_ImageDropTarget::GetClipboardFormat() const
78 {
79         return m_nCFFormat;
80 }
81
82 inline const CDragDropImage *CUI_ImageDropTarget::GetDropImage()
83 {
84         return m_pImage;
85 }
86
87 inline void CUI_ImageDropTarget::SetImageWin(CWnd *pWnd)
88 {
89         m_pWnd = pWnd;
90 }
91
92 inline CWnd *CUI_ImageDropTarget::GetImageWin(CWnd *pWnd) 
93 {
94         // use main frame window as default
95         if (m_pWnd == NULL)
96                 m_pWnd = pWnd;
97         ASSERT(m_pWnd);
98         return m_pWnd;
99 }
100
101 /////////////////////////////////////////////////////////////////////////////
102
103 //{{AFX_INSERT_LOCATION}}
104 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
105
106 #endif // !defined(AFX_IM_OLEIMAGEDROPTARGET_H__BC21D3A1_332C_11D1_ADE9_0000E81B9EF1__INCLUDED_)