update dev300-m58
[ooovba.git] / sw / inc / swevent.hxx
blob6020633ea064a369cc25b1bba0a7762fc019f549
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: swevent.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
31 #ifndef _SWEVENT_HXX
32 #define _SWEVENT_HXX
34 // #include *****************************************************************
36 #include <tools/solar.h>
37 #include <sfx2/sfx.hrc>
39 #define SW_EVENT_OBJECT_SELECT ( EVENT_APP_START + 0 )
40 #define SW_EVENT_START_INS_GLOSSARY ( EVENT_APP_START + 1 )
41 #define SW_EVENT_END_INS_GLOSSARY ( EVENT_APP_START + 2 )
42 #define SW_EVENT_MAIL_MERGE ( EVENT_APP_START + 3 )
43 #define SW_EVENT_FRM_KEYINPUT_ALPHA ( EVENT_APP_START + 4 )
44 #define SW_EVENT_FRM_KEYINPUT_NOALPHA ( EVENT_APP_START + 5 )
45 #define SW_EVENT_FRM_RESIZE ( EVENT_APP_START + 6 )
46 #define SW_EVENT_FRM_MOVE ( EVENT_APP_START + 7 )
47 #define SW_EVENT_PAGE_COUNT ( EVENT_APP_START + 8 )
48 #define SW_EVENT_MAIL_MERGE_END ( EVENT_APP_START + 9 )
49 #define SW_EVENT_FIELD_MERGE ( EVENT_APP_START + 10 )
50 #define SW_EVENT_FIELD_MERGE_FINISHED ( EVENT_APP_START + 11 )
51 #define SW_EVENT_LAYOUT_FINISHED ( EVENT_APP_START + 12 )
53 class SwFrmFmt;
54 class SwFmtINetFmt;
55 class IMapObject;
57 // enum fuer Objecte die Events ins Basic oder in JavaScript Callen
58 enum SwCallEventObjectType
60 EVENT_OBJECT_NONE = 0, // Null ist garnichts
61 EVENT_OBJECT_IMAGE,
62 EVENT_OBJECT_INETATTR,
63 EVENT_OBJECT_URLITEM,
64 EVENT_OBJECT_IMAGEMAP
67 // structur fuer den Austausch zwischen UI/CORE
69 struct SwCallMouseEvent
71 SwCallEventObjectType eType;
72 union
74 // EVENT_OBJECT_IMAGE/EVENT_OBJECT_URLITEM
75 const SwFrmFmt* pFmt;
77 // EVENT_OBJECT_INETATTR
78 const SwFmtINetFmt* pINetAttr;
80 // EVENT_OBJECT_IMAGEMAP
81 struct
83 const SwFrmFmt* pFmt;
84 const IMapObject* pIMapObj;
85 } IMAP;
86 } PTR;
88 SwCallMouseEvent()
89 : eType( EVENT_OBJECT_NONE )
90 { PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
92 void Set( SwCallEventObjectType eTyp, const SwFrmFmt* pFmt )
93 { eType = eTyp; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = 0; }
95 void Set( const SwFrmFmt* pFmt, const IMapObject* pIMapObj )
96 { eType = EVENT_OBJECT_IMAGEMAP; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = pIMapObj; }
98 void Set( const SwFmtINetFmt* pINetAttr )
99 { eType = EVENT_OBJECT_INETATTR; PTR.pINetAttr = pINetAttr; PTR.IMAP.pIMapObj = 0; }
101 int operator==( const SwCallMouseEvent& rEvent ) const
103 return eType == rEvent.eType &&
104 PTR.pFmt == rEvent.PTR.pFmt &&
105 PTR.IMAP.pIMapObj == rEvent.PTR.IMAP.pIMapObj;
107 int operator!=( const SwCallMouseEvent& rEvent ) const
108 { return !( *this == rEvent ); }
110 void Clear()
111 { eType = EVENT_OBJECT_NONE; PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
113 BOOL HasEvent() const { return EVENT_OBJECT_NONE != eType; }
117 #endif