Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / swevent.hxx
blobc0c3cb51cb36b001e30290558f8890058784509f
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.4 $
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 #ifndef _SOLAR_H
37 #include <tools/solar.h>
38 #endif
40 #ifndef _SFX_HRC
41 #include <bf_sfx2/sfx.hrc>
42 #endif
43 namespace binfilter {
45 #define SW_EVENT_OBJECT_SELECT ( EVENT_APP_START + 0 )
46 #define SW_EVENT_START_INS_GLOSSARY ( EVENT_APP_START + 1 )
47 #define SW_EVENT_END_INS_GLOSSARY ( EVENT_APP_START + 2 )
48 #define SW_EVENT_MAIL_MERGE ( EVENT_APP_START + 3 )
49 #define SW_EVENT_FRM_KEYINPUT_ALPHA ( EVENT_APP_START + 4 )
50 #define SW_EVENT_FRM_KEYINPUT_NOALPHA ( EVENT_APP_START + 5 )
51 #define SW_EVENT_FRM_RESIZE ( EVENT_APP_START + 6 )
52 #define SW_EVENT_FRM_MOVE ( EVENT_APP_START + 7 )
53 #define SW_EVENT_PAGE_COUNT ( EVENT_APP_START + 8 )
54 #define SW_EVENT_MAIL_MERGE_END ( EVENT_APP_START + 9 )
57 class SwFrmFmt;
58 class SwFmtINetFmt;
59 class IMapObject;
61 // enum fuer Objecte die Events ins Basic oder in JavaScript Callen
62 enum SwCallEventObjectType
64 EVENT_OBJECT_NONE = 0, // Null ist garnichts
65 EVENT_OBJECT_IMAGE,
66 EVENT_OBJECT_INETATTR,
67 EVENT_OBJECT_URLITEM,
68 EVENT_OBJECT_IMAGEMAP
71 // structur fuer den Austausch zwischen UI/CORE
73 struct SwCallMouseEvent
75 SwCallEventObjectType eType;
76 union
78 // EVENT_OBJECT_IMAGE/EVENT_OBJECT_URLITEM
79 const SwFrmFmt* pFmt;
81 // EVENT_OBJECT_INETATTR
82 const SwFmtINetFmt* pINetAttr;
84 // EVENT_OBJECT_IMAGEMAP
85 struct
87 const SwFrmFmt* pFmt;
88 const IMapObject* pIMapObj;
89 } IMAP;
90 } PTR;
92 SwCallMouseEvent()
93 : eType( EVENT_OBJECT_NONE )
94 { PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
96 void Set( SwCallEventObjectType eTyp, const SwFrmFmt* pFmt )
97 { eType = eTyp; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = 0; }
99 void Set( const SwFrmFmt* pFmt, const IMapObject* pIMapObj )
100 { eType = EVENT_OBJECT_IMAGEMAP; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = pIMapObj; }
102 void Set( const SwFmtINetFmt* pINetAttr )
103 { eType = EVENT_OBJECT_INETATTR; PTR.pINetAttr = pINetAttr; PTR.IMAP.pIMapObj = 0; }
105 int operator==( const SwCallMouseEvent& rEvent ) const
107 return eType == rEvent.eType &&
108 PTR.pFmt == rEvent.PTR.pFmt &&
109 PTR.IMAP.pIMapObj == rEvent.PTR.IMAP.pIMapObj;
111 int operator!=( const SwCallMouseEvent& rEvent ) const
112 { return !( *this == rEvent ); }
114 void Clear()
115 { eType = EVENT_OBJECT_NONE; PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
117 BOOL HasEvent() const { return EVENT_OBJECT_NONE != eType; }
121 } //namespace binfilter
122 #endif