Update ooo320-m1
[ooovba.git] / dtrans / test / win32 / dnd / atlwindow.hxx
blobd74cf5f1d08911f544735c21c7ec5d5583cee3c4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: atlwindow.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _WINDOW_HXX_
31 #define _WINDOW_HXX_
32 #include <atlbase.h>
33 extern CComModule _Module;
34 #include<atlcom.h>
35 #include<atlctl.h>
36 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
37 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
38 #include <com/sun/star/datatransfer/XTransferable.hpp>
39 #include <com/sun/star/uno/Reference.h>
40 #include "../../source/inc/DtObjFactory.hxx"
43 using namespace com::sun::star::uno;
44 using namespace com::sun::star::datatransfer::dnd;
45 using namespace com::sun::star::datatransfer;
47 struct ThreadData
49 Reference<XDragSource> source;
50 Reference<XTransferable> transferable;
51 HANDLE evtThreadReady;
54 class AWindow: public CWindowImpl<AWindow, CWindow,
55 CWinTraits<WS_CAPTION |WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0> >
57 TCHAR m_strName[80];
58 Reference<XDropTarget> m_xDropTarget;
59 Reference<XDragSource> m_xDragSource;
60 BOOL m_isMTA;
62 HWND m_hwndEdit;
64 CDTransObjFactory m_aDataConverter;
66 public:
67 AWindow(LPCTSTR strName)
69 RECT rcPos= {0,0,200,200};
70 Create(0, rcPos, strName);
72 AWindow(LPCTSTR strName, RECT pos, BOOL mta=FALSE): m_isMTA( mta)
74 Create(0, pos, strName);
77 ~AWindow()
79 if(m_hWnd)
80 DestroyWindow();
84 BEGIN_MSG_MAP(AWindow)
85 MESSAGE_HANDLER( WM_CLOSE, OnClose)
86 MESSAGE_HANDLER( WM_CREATE, OnCreate)
87 MESSAGE_RANGE_HANDLER( WM_MOUSEFIRST, WM_MOUSELAST, OnMouseAction)
88 MESSAGE_HANDLER( WM_TIMER, OnTimer)
89 MESSAGE_HANDLER( WM_SIZE, OnSize)
90 MESSAGE_HANDLER( WM_SETFOCUS, OnFocus)
92 END_MSG_MAP()
94 LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
95 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
96 LRESULT OnMouseAction(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
97 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
98 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
99 LRESULT OnFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
103 #endif