summaryrefslogtreecommitdiffstats
path: root/private/oleutest/simpdnd/doc.h
blob: 7af85275020bfbe965fe9e47efbae7d570311189 (plain) (blame)
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
//**********************************************************************
// File name: doc.h
//
//      Definition of CSimpleDoc
//
// Copyright (c) 1992 - 1993 Microsoft Corporation. All rights reserved.
//**********************************************************************

#if !defined( _DOC_H_ )
#define _DOC_H_

#include "idt.h"        
#include "ids.h"        

class CSimpleSite;
class CSimpleApp;

class CSimpleDoc : public IUnknown 
{   
public:                  
    int             m_nCount;           // reference count
    LPSTORAGE       m_lpStorage;        // IStorage* pointer for Doc
    BOOL            m_fModifiedMenu;    // is object's verb menu on menu

    // Drag/Drop related fields
    BOOL            m_fRegDragDrop;     // is doc registered as drop target?
    BOOL            m_fLocalDrag;       // is doc source of the drag
    BOOL            m_fLocalDrop;       // was doc target of the drop
    BOOL            m_fCanDropCopy;     // is Drag/Drop copy/move possible?
    BOOL            m_fCanDropLink;     // is Drag/Drop link possible?
    BOOL            m_fDragLeave;       // has drag left
    BOOL            m_fPendingDrag;     // LButtonDown--possible drag pending
    POINT           m_ptButDown;        // LButtonDown coordinates
    
    CSimpleSite FAR * m_lpSite;
    CSimpleApp FAR * m_lpApp;
    
    HWND m_hDocWnd;
                        
    CDropTarget m_DropTarget;
    CDropSource m_DropSource;

    static CSimpleDoc FAR* Create(CSimpleApp FAR *lpApp, LPRECT lpRect, 
            HWND hWnd);

    void Close(void);

    CSimpleDoc();          
    CSimpleDoc(CSimpleApp FAR *lpApp, HWND hWnd);
    ~CSimpleDoc();        
    
    // IUnknown Interface    
    STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj); 
    STDMETHODIMP_(ULONG) AddRef();
    STDMETHODIMP_(ULONG) Release(); 
    
    void InsertObject(void);
    void DisableInsertObject(void);
    long lResizeDoc(LPRECT lpRect);
    long lAddVerbs(void);
    void PaintDoc(HDC hDC);
    
    // Drag/Drop and clipboard support methods
    void CopyObjectToClip(void);
    BOOL QueryDrag(POINT pt);
    DWORD DoDragDrop(void);
    void Scroll(DWORD dwScrollDir) { /*...scroll Doc here...*/ }

private:

    void FailureNotifyHelper(TCHAR *pszMsg, DWORD dwData);

};
    
#endif  // _DOC_H_