Update ooo320-m1
[ooovba.git] / sw / inc / swevent.hxx
blobad6bee69dd2033578dbcf43d31bfc87ae66c58aa
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 $
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 #define STR_SW_EVENT_PAGE_COUNT 0
54 #define STR_SW_EVENT_MAIL_MERGE 1
55 #define STR_SW_EVENT_MAIL_MERGE_END 2
56 #define STR_SW_EVENT_FIELD_MERGE 3
57 #define STR_SW_EVENT_FIELD_MERGE_FINISHED 4
58 #define STR_SW_EVENT_LAYOUT_FINISHED 5
59 #define STR_SW_EVENT_OBJECT_SELECT 6
60 #define STR_SW_EVENT_START_INS_GLOSSARY 7
61 #define STR_SW_EVENT_END_INS_GLOSSARY 8
62 #define STR_SW_EVENT_FRM_KEYINPUT_ALPHA 9
63 #define STR_SW_EVENT_FRM_KEYINPUT_NOALPHA 10
64 #define STR_SW_EVENT_FRM_RESIZE 11
65 #define STR_SW_EVENT_FRM_MOVE 12
67 class SwFrmFmt;
68 class SwFmtINetFmt;
69 class IMapObject;
71 // enum fuer Objecte die Events ins Basic oder in JavaScript Callen
72 enum SwCallEventObjectType
74 EVENT_OBJECT_NONE = 0, // Null ist garnichts
75 EVENT_OBJECT_IMAGE,
76 EVENT_OBJECT_INETATTR,
77 EVENT_OBJECT_URLITEM,
78 EVENT_OBJECT_IMAGEMAP
81 // structur fuer den Austausch zwischen UI/CORE
83 struct SwCallMouseEvent
85 SwCallEventObjectType eType;
86 union
88 // EVENT_OBJECT_IMAGE/EVENT_OBJECT_URLITEM
89 const SwFrmFmt* pFmt;
91 // EVENT_OBJECT_INETATTR
92 const SwFmtINetFmt* pINetAttr;
94 // EVENT_OBJECT_IMAGEMAP
95 struct
97 const SwFrmFmt* pFmt;
98 const IMapObject* pIMapObj;
99 } IMAP;
100 } PTR;
102 SwCallMouseEvent()
103 : eType( EVENT_OBJECT_NONE )
104 { PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
106 void Set( SwCallEventObjectType eTyp, const SwFrmFmt* pFmt )
107 { eType = eTyp; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = 0; }
109 void Set( const SwFrmFmt* pFmt, const IMapObject* pIMapObj )
110 { eType = EVENT_OBJECT_IMAGEMAP; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = pIMapObj; }
112 void Set( const SwFmtINetFmt* pINetAttr )
113 { eType = EVENT_OBJECT_INETATTR; PTR.pINetAttr = pINetAttr; PTR.IMAP.pIMapObj = 0; }
115 int operator==( const SwCallMouseEvent& rEvent ) const
117 return eType == rEvent.eType &&
118 PTR.pFmt == rEvent.PTR.pFmt &&
119 PTR.IMAP.pIMapObj == rEvent.PTR.IMAP.pIMapObj;
121 int operator!=( const SwCallMouseEvent& rEvent ) const
122 { return !( *this == rEvent ); }
124 void Clear()
125 { eType = EVENT_OBJECT_NONE; PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; }
127 BOOL HasEvent() const { return EVENT_OBJECT_NONE != eType; }
131 #endif