1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: atlwindow.hxx,v $
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 ************************************************************************/
33 extern CComModule _Module
;
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
;
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> >
58 Reference
<XDropTarget
> m_xDropTarget
;
59 Reference
<XDragSource
> m_xDragSource
;
64 CDTransObjFactory m_aDataConverter
;
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
);
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
)
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
);