Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / dtrans / test / win32 / dnd / atlwindow.hxx
blob378407274b564d0915a70a101b6e07481a2f20c3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_DTRANS_TEST_WIN32_DND_ATLWINDOW_HXX
20 #define INCLUDED_DTRANS_TEST_WIN32_DND_ATLWINDOW_HXX
21 #include <atlbase.h>
22 extern CComModule _Module;
23 #include <atlcom.h>
24 #include <atlctl.h>
25 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
26 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
27 #include <com/sun/star/datatransfer/XTransferable.hpp>
28 #include <com/sun/star/uno/Reference.h>
29 #include "../../source/inc/DtObjFactory.hxx"
31 using namespace com::sun::star::uno;
32 using namespace com::sun::star::datatransfer::dnd;
33 using namespace com::sun::star::datatransfer;
35 struct ThreadData
37 Reference<XDragSource> source;
38 Reference<XTransferable> transferable;
39 HANDLE evtThreadReady;
42 class AWindow: public CWindowImpl<AWindow, CWindow,
43 CWinTraits<WS_CAPTION |WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0> >
45 TCHAR m_strName[80];
46 Reference<XDropTarget> m_xDropTarget;
47 Reference<XDragSource> m_xDragSource;
48 BOOL m_isMTA;
50 HWND m_hwndEdit;
52 public:
53 explicit AWindow(LPCTSTR strName)
55 RECT rcPos= {0,0,200,200};
56 Create(0, rcPos, strName);
58 AWindow(LPCTSTR strName, RECT pos, BOOL mta=FALSE): m_isMTA( mta)
60 Create(0, pos, strName);
63 ~AWindow()
65 if(m_hWnd)
66 DestroyWindow();
69 BEGIN_MSG_MAP(AWindow)
70 MESSAGE_HANDLER( WM_CLOSE, OnClose)
71 MESSAGE_HANDLER( WM_CREATE, OnCreate)
72 MESSAGE_RANGE_HANDLER( WM_MOUSEFIRST, WM_MOUSELAST, OnMouseAction)
73 MESSAGE_HANDLER( WM_TIMER, OnTimer)
74 MESSAGE_HANDLER( WM_SIZE, OnSize)
75 MESSAGE_HANDLER( WM_SETFOCUS, OnFocus)
77 END_MSG_MAP()
79 LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
80 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
81 LRESULT OnMouseAction(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
82 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
83 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
84 LRESULT OnFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
88 #endif
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */