Revert "Revert "Revert "stronger typing for SwClient::GetRegisteredIn"" and fix SwIte...
[LibreOffice.git] / vcl / workben / win / dnd / atlwindow.hxx
blob047acf6769b12e3d5042702a5f3d26a03074e144
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 #pragma once
20 #include <atlbase.h>
21 extern CComModule _Module;
22 #include <atlcom.h>
23 #include <atlctl.h>
24 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
25 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
26 #include <com/sun/star/datatransfer/XTransferable.hpp>
27 #include <com/sun/star/uno/Reference.h>
28 #include "../../source/inc/DtObjFactory.hxx"
30 using namespace com::sun::star::uno;
31 using namespace com::sun::star::datatransfer::dnd;
32 using namespace com::sun::star::datatransfer;
34 struct ThreadData
36 Reference<XDragSource> source;
37 Reference<XTransferable> transferable;
38 HANDLE evtThreadReady;
41 class AWindow: public CWindowImpl<AWindow, CWindow,
42 CWinTraits<WS_CAPTION |WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0> >
44 TCHAR m_strName[80];
45 Reference<XDropTarget> m_xDropTarget;
46 Reference<XDragSource> m_xDragSource;
47 BOOL m_isMTA;
49 HWND m_hwndEdit;
51 public:
52 explicit AWindow(LPCTSTR strName)
54 RECT rcPos= {0,0,200,200};
55 Create(0, rcPos, strName);
57 AWindow(LPCTSTR strName, RECT pos, BOOL mta=FALSE): m_isMTA( mta)
59 Create(0, pos, strName);
62 ~AWindow()
64 if(m_hWnd)
65 DestroyWindow();
68 BEGIN_MSG_MAP(AWindow)
69 MESSAGE_HANDLER( WM_CLOSE, OnClose)
70 MESSAGE_HANDLER( WM_CREATE, OnCreate)
71 MESSAGE_RANGE_HANDLER( WM_MOUSEFIRST, WM_MOUSELAST, OnMouseAction)
72 MESSAGE_HANDLER( WM_TIMER, OnTimer)
73 MESSAGE_HANDLER( WM_SIZE, OnSize)
74 MESSAGE_HANDLER( WM_SETFOCUS, OnFocus)
76 END_MSG_MAP()
78 LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
79 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
80 LRESULT OnMouseAction(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
81 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
82 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
83 LRESULT OnFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */