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: swevent.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 ************************************************************************/
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 )
57 // enum fuer Objecte die Events ins Basic oder in JavaScript Callen
58 enum SwCallEventObjectType
60 EVENT_OBJECT_NONE
= 0, // Null ist garnichts
62 EVENT_OBJECT_INETATTR
,
67 // structur fuer den Austausch zwischen UI/CORE
69 struct SwCallMouseEvent
71 SwCallEventObjectType eType
;
74 // EVENT_OBJECT_IMAGE/EVENT_OBJECT_URLITEM
77 // EVENT_OBJECT_INETATTR
78 const SwFmtINetFmt
* pINetAttr
;
80 // EVENT_OBJECT_IMAGEMAP
84 const IMapObject
* pIMapObj
;
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
); }
111 { eType
= EVENT_OBJECT_NONE
; PTR
.pFmt
= 0; PTR
.IMAP
.pIMapObj
= 0; }
113 BOOL
HasEvent() const { return EVENT_OBJECT_NONE
!= eType
; }