| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | /*************************************************************************
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  $RCSfile: unoevent.cxx,v $ | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |  *  $Revision: 1.10 $ | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |  *  last change: $Author: dvo $ $Date: 2001-04-17 13:52:26 $ | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  The Contents of this file are made available subject to the terms of | 
					
						
							|  |  |  |  *  either of the following licenses | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *         - GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *         - Sun Industry Standards Source License Version 1.1 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Sun Microsystems Inc., October, 2000 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *  ============================================= | 
					
						
							|  |  |  |  *  Copyright 2000 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  *  901 San Antonio Road, Palo Alto, CA 94303, USA | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  *  modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  *  License version 2.1, as published by the Free Software Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  *  Lesser General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  *  License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 
					
						
							|  |  |  |  *  MA  02111-1307  USA | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Sun Industry Standards Source License Version 1.1 | 
					
						
							|  |  |  |  *  ================================================= | 
					
						
							|  |  |  |  *  The contents of this file are subject to the Sun Industry Standards | 
					
						
							|  |  |  |  *  Source License Version 1.1 (the "License"); You may not use this file | 
					
						
							|  |  |  |  *  except in compliance with the License. You may obtain a copy of the | 
					
						
							|  |  |  |  *  License at http://www.openoffice.org/license.html.
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Software provided under this License is provided on an "AS IS" basis, | 
					
						
							|  |  |  |  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, | 
					
						
							|  |  |  |  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, | 
					
						
							|  |  |  |  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. | 
					
						
							|  |  |  |  *  See the License for the specific provisions governing your rights and | 
					
						
							|  |  |  |  *  obligations concerning the Software. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  The Initial Developer of the Original Code is: Sun Microsystems, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Copyright: 2000 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Contributor(s): _______________________________________ | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  ************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-22 08:52:39 +00:00
										 |  |  | #ifdef PRECOMPILED
 | 
					
						
							|  |  |  | #include "core_pch.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma hdrstop
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | // HINTIDs must be on top; it is required for the macitem.hxx header
 | 
					
						
							|  |  |  | #ifndef _HINTIDS_HXX
 | 
					
						
							|  |  |  | #include "hintids.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _UNOEVENT_HXX
 | 
					
						
							|  |  |  | #include "unoevent.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _UNOFRAME_HXX
 | 
					
						
							|  |  |  | #include "unoframe.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _UNOSTYLE_HXX
 | 
					
						
							|  |  |  | #include "unostyle.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _SWEVENT_HXX
 | 
					
						
							|  |  |  | #include "swevent.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-20 14:16:41 +00:00
										 |  |  | #ifndef _DOCSTYLE_HXX
 | 
					
						
							|  |  |  | #include "docstyle.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | #ifndef _SFX_HRC
 | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | #include <sfx2/sfx.hrc>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-29 15:56:19 +00:00
										 |  |  | #ifndef _SVX_SVXIDS_HRC
 | 
					
						
							|  |  |  | #include <svx/svxids.hrc>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | #ifndef _FMTINFMT_HXX
 | 
					
						
							|  |  |  | #include "fmtinfmt.hxx"
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _SFXMACITEM_HXX
 | 
					
						
							|  |  |  | #include <svtools/macitem.hxx>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _RTL_USTRBUF_HXX_
 | 
					
						
							|  |  |  | #include <rtl/ustrbuf.hxx>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP
 | 
					
						
							|  |  |  | #include <com/sun/star/beans/PropertyValue.hpp>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace ::com::sun::star; | 
					
						
							|  |  |  | using namespace ::com::sun::star::uno; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using ::com::sun::star::container::NoSuchElementException; | 
					
						
							|  |  |  | using ::com::sun::star::container::XNameReplace; | 
					
						
							|  |  |  | using ::com::sun::star::lang::IllegalArgumentException; | 
					
						
							|  |  |  | using ::com::sun::star::lang::WrappedTargetException; | 
					
						
							|  |  |  | using ::com::sun::star::lang::XServiceInfo; | 
					
						
							|  |  |  | using ::com::sun::star::beans::PropertyValue; | 
					
						
							|  |  |  | using ::cppu::WeakImplHelper2; | 
					
						
							|  |  |  | using ::rtl::OUString; | 
					
						
							|  |  |  | using ::rtl::OUStringBuffer; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | const sal_Char sAPI_ServiceName[] = "com.sun.star.container.XNameReplace"; | 
					
						
							|  |  |  | const sal_Char sAPI_SwFrameEventDescriptor[] = "SwFrameEventDescriptor"; | 
					
						
							|  |  |  | const sal_Char sAPI_SwFrameStyleEventDescriptor[] = | 
					
						
							|  |  |  |                                     "SwFrameStyleEventDescriptor"; | 
					
						
							|  |  |  | const sal_Char sAPI_SwDetachedEventDescriptor[] = "SwDetachedEventDescriptor"; | 
					
						
							|  |  |  | const sal_Char sAPI_SwHyperlinkEventDescriptor[] = | 
					
						
							|  |  |  |                                     "SwHyperlinkEventDescriptor"; | 
					
						
							| 
									
										
										
										
											2001-02-14 12:11:14 +00:00
										 |  |  | const sal_Char sAPI_SwAutoTextEventDescriptor[] = | 
					
						
							|  |  |  |                                     "SwAutoTextEventDescriptor"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | // //
 | 
					
						
							|  |  |  | // // tables of all known events handled by this class
 | 
					
						
							|  |  |  | // //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // // careful: keep aKnownEventIDs and aKnownEventNames in sync!
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // const USHORT aKnownEventIDs[] =
 | 
					
						
							|  |  |  | // {
 | 
					
						
							|  |  |  | //  SW_EVENT_OBJECT_SELECT,
 | 
					
						
							|  |  |  | //  SW_EVENT_START_INS_GLOSSARY,
 | 
					
						
							|  |  |  | //  SW_EVENT_END_INS_GLOSSARY,
 | 
					
						
							|  |  |  | //  SW_EVENT_MAIL_MERGE,
 | 
					
						
							|  |  |  | //  SW_EVENT_FRM_KEYINPUT_ALPHA,
 | 
					
						
							|  |  |  | //  SW_EVENT_FRM_KEYINPUT_NOALPHA,
 | 
					
						
							|  |  |  | //  SW_EVENT_FRM_RESIZE,
 | 
					
						
							|  |  |  | //  SW_EVENT_FRM_MOVE,
 | 
					
						
							|  |  |  | //  SW_EVENT_PAGE_COUNT,
 | 
					
						
							|  |  |  | //  SFX_EVENT_MOUSEOVER_OBJECT,
 | 
					
						
							|  |  |  | //  SFX_EVENT_MOUSECLICK_OBJECT,
 | 
					
						
							|  |  |  | //  SFX_EVENT_MOUSEOUT_OBJECT,
 | 
					
						
							|  |  |  | //      SFX_EVENT_OPENDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_CLOSEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_STARTAPP,
 | 
					
						
							|  |  |  | //      SFX_EVENT_CLOSEAPP,
 | 
					
						
							|  |  |  | //      SFX_EVENT_CREATEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_SAVEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_SAVEASDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_ACTIVATEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_DEACTIVATEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_PRINTDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_ONERROR,
 | 
					
						
							|  |  |  | //      SFX_EVENT_LOADFINISHED,
 | 
					
						
							|  |  |  | //      SFX_EVENT_SAVEFINISHED,
 | 
					
						
							|  |  |  | //      SFX_EVENT_MODIFYCHANGED,
 | 
					
						
							|  |  |  | //      SFX_EVENT_PREPARECLOSEDOC,
 | 
					
						
							|  |  |  | //      SFX_EVENT_NEWMESSAGE,
 | 
					
						
							|  |  |  | //      SFX_EVENT_TOGGLEFULLSCREENMODE,
 | 
					
						
							|  |  |  | //      SFX_EVENT_SAVEDOCDONE,
 | 
					
						
							|  |  |  | //      SFX_EVENT_SAVEASDOCDONE,
 | 
					
						
							|  |  |  | //  SVX_EVENT_IMAGE_LOAD,
 | 
					
						
							|  |  |  | //  SVX_EVENT_IMAGE_ABORT,
 | 
					
						
							|  |  |  | //  SVX_EVENT_IMAGE_ERROR,
 | 
					
						
							|  |  |  | //  0
 | 
					
						
							|  |  |  | // };
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // const sal_Char* aKnownEventNames[] =
 | 
					
						
							|  |  |  | // {
 | 
					
						
							|  |  |  | //  "OnSelect",                 // SW_EVENT_OBJECT_SELECT
 | 
					
						
							|  |  |  | //  "OnInsertStart",            // SW_EVENT_START_INS_GLOSSARY
 | 
					
						
							|  |  |  | //  "OnInsertDone",             // SW_EVENT_END_INS_GLOSSARY
 | 
					
						
							|  |  |  | //  "OnMailMerge",              // SW_EVENT_MAIL_MERGE
 | 
					
						
							|  |  |  | //  "OnAlphaCharInput",         // SW_EVENT_FRM_KEYINPUT_ALPHA
 | 
					
						
							|  |  |  | //  "OnNonAlphaCharInput",      // SW_EVENT_FRM_KEYINPUT_NOALPHA
 | 
					
						
							|  |  |  | //  "OnResize",                 // SW_EVENT_FRM_RESIZE
 | 
					
						
							|  |  |  | //  "OnMove",                   // SW_EVENT_FRM_MOVE
 | 
					
						
							|  |  |  | //  "PageCountChange",          // SW_EVENT_PAGE_COUNT
 | 
					
						
							|  |  |  | //  "OnMouseOver",              // SFX_EVENT_MOUSEOVER_OBJECT
 | 
					
						
							|  |  |  | //  "OnClick",                  // SFX_EVENT_MOUSECLICK_OBJECT
 | 
					
						
							|  |  |  | //  "OnMouseOut",               // SFX_EVENT_MOUSEOUT_OBJECT
 | 
					
						
							|  |  |  | //  "OnLoad",                   // SFX_EVENT_OPENDOC,
 | 
					
						
							|  |  |  | //  "OnUnload",                 // SFX_EVENT_CLOSEDOC,
 | 
					
						
							|  |  |  | //  "OnStartApp",               // SFX_EVENT_STARTAPP,
 | 
					
						
							|  |  |  | //  "OnCloseApp",               // SFX_EVENT_CLOSEAPP,
 | 
					
						
							|  |  |  | //  "OnNew",                    // SFX_EVENT_CREATEDOC,
 | 
					
						
							|  |  |  | //  "OnSave",                   // SFX_EVENT_SAVEDOC,
 | 
					
						
							|  |  |  | //  "OnSaveAs",                 // SFX_EVENT_SAVEASDOC,
 | 
					
						
							|  |  |  | //  "OnFocus",                  // SFX_EVENT_ACTIVATEDOC,
 | 
					
						
							|  |  |  | //  "OnUnfocus",                // SFX_EVENT_DEACTIVATEDOC,
 | 
					
						
							|  |  |  | //  "OnPrint",                  // SFX_EVENT_PRINTDOC,
 | 
					
						
							|  |  |  | //  "OnError",                  // SFX_EVENT_ONERROR,
 | 
					
						
							|  |  |  | //  "OnLoadFinished",           // SFX_EVENT_LOADFINISHED,
 | 
					
						
							|  |  |  | //  "OnSaveFinished",           // SFX_EVENT_SAVEFINISHED,
 | 
					
						
							|  |  |  | //  "OnModifyChanged",          // SFX_EVENT_MODIFYCHANGED,
 | 
					
						
							|  |  |  | //  "OnPrepareUnload",          // SFX_EVENT_PREPARECLOSEDOC,
 | 
					
						
							|  |  |  | //  "OnNewMail",                // SFX_EVENT_NEWMESSAGE,
 | 
					
						
							|  |  |  | //  "OnToggleFullscreen",       // SFX_EVENT_TOGGLEFULLSCREENMODE,
 | 
					
						
							|  |  |  | //  "OnSaveDone",               // SFX_EVENT_SAVEDOCDONE,
 | 
					
						
							|  |  |  | //  "OnSaveAsDone",             // SFX_EVENT_SAVEASDOCDONE,
 | 
					
						
							|  |  |  | //  "OnLoadError",              // SVX_EVENT_IMAGE_LOAD,
 | 
					
						
							|  |  |  | //  "OnLoadCancel",             // SVX_EVENT_IMAGE_ABORT,
 | 
					
						
							|  |  |  | //  "OnLoadDone",               // SVX_EVENT_IMAGE_ERROR,
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  NULL
 | 
					
						
							|  |  |  | // };
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // tables of allowed events for specific objects
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aGraphicEvents[] = | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     { SW_EVENT_OBJECT_SELECT,       "OnSelect" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOVER_OBJECT,   "OnMouseOver" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSECLICK_OBJECT,  "OnClick" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOUT_OBJECT,    "OnMouseOut" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_LOAD,         "OnLoadDone" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_ABORT,        "OnLoadCancel" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_ERROR,        "OnLoadError" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aFrameEvents[] = | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     { SW_EVENT_OBJECT_SELECT,       "OnSelect" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_KEYINPUT_ALPHA,  "OnAlphaCharInput" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_KEYINPUT_NOALPHA,    "OnNonAlphaCharInput" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_RESIZE,          "OnResize" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_MOVE,            "OnMove" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOVER_OBJECT,   "OnMouseOver" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSECLICK_OBJECT,  "OnClick" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOUT_OBJECT,    "OnMouseOut" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aOLEEvents[] = | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     { SW_EVENT_OBJECT_SELECT,       "OnSelect" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOVER_OBJECT,   "OnMouseOver" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSECLICK_OBJECT,  "OnClick" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOUT_OBJECT,    "OnMouseOut" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aHyperlinkEvents[] = | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     { SFX_EVENT_MOUSEOVER_OBJECT,   "OnMouseOver" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSECLICK_OBJECT,  "OnClick" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOUT_OBJECT,    "OnMouseOut" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aAutotextEvents[] = | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     { SW_EVENT_START_INS_GLOSSARY,  "OnInsertStart" }, | 
					
						
							|  |  |  |     { SW_EVENT_END_INS_GLOSSARY,    "OnInsertDone" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aFrameStyleEvents[] = | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     { SW_EVENT_OBJECT_SELECT,       "OnSelect" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_KEYINPUT_ALPHA,  "OnAlphaCharInput" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_KEYINPUT_NOALPHA,    "OnNonAlphaCharInput" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_RESIZE,          "OnResize" }, | 
					
						
							|  |  |  |     { SW_EVENT_FRM_MOVE,            "OnMove" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOVER_OBJECT,   "OnMouseOver" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSECLICK_OBJECT,  "OnClick" }, | 
					
						
							|  |  |  |     { SFX_EVENT_MOUSEOUT_OBJECT,    "OnMouseOut" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_LOAD,         "OnLoadDone" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_ABORT,        "OnLoadCancel" }, | 
					
						
							|  |  |  |     { SVX_EVENT_IMAGE_ERROR,        "OnLoadError" }, | 
					
						
							|  |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | const struct SvEventDescription aDocumentEvents[] = | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |      { SFX_EVENT_STARTAPP,      "OnStartApp" }, | 
					
						
							|  |  |  |      { SFX_EVENT_CLOSEAPP,      "OnCloseApp" }, | 
					
						
							|  |  |  |      { SFX_EVENT_CREATEDOC,     "OnNew" }, | 
					
						
							|  |  |  |      { SFX_EVENT_OPENDOC,       "OnLoad" }, | 
					
						
							|  |  |  |      { SFX_EVENT_SAVEDOC,       "OnSave" }, | 
					
						
							|  |  |  |      { SFX_EVENT_SAVEASDOC,     "OnSaveAs" }, | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | // ??? cf. SAVEDOCDONE, SAVEASDOCDONE
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |      { SFX_EVENT_SAVEFINISHED,  "OnSaveFinished" }, | 
					
						
							|  |  |  |      { SFX_EVENT_CLOSEDOC,      "OnUnload" }, | 
					
						
							|  |  |  |      { SFX_EVENT_ACTIVATEDOC,   "OnFocus" }, | 
					
						
							|  |  |  |      { SFX_EVENT_DEACTIVATEDOC, "OnUnfocus" }, | 
					
						
							|  |  |  |      { SFX_EVENT_ONERROR,       "OnError" }, | 
					
						
							|  |  |  |     { SFX_EVENT_NEWMESSAGE,     "OnNewMail" }, | 
					
						
							|  |  |  |      { SFX_EVENT_PRINTDOC,      "OnPrint" }, | 
					
						
							|  |  |  |      { SW_EVENT_MAIL_MERGE,     "OnMailMerge" }, | 
					
						
							|  |  |  |      { SW_EVENT_PAGE_COUNT,     "PageCountChange" }, | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | //  SFX_EVENT_LOADFINISHED,
 | 
					
						
							|  |  |  | //  SFX_EVENT_MODIFYCHANGED,
 | 
					
						
							|  |  |  | //  SFX_EVENT_PREPARECLOSEDOC,
 | 
					
						
							|  |  |  | //  SFX_EVENT_TOGGLEFULLSCREENMODE,
 | 
					
						
							|  |  |  | //  SFX_EVENT_SAVEDOCDONE,
 | 
					
						
							|  |  |  | //  SFX_EVENT_SAVEASDOCDONE,
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     { 0, NULL } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // SwHyperlinkEventDescriptor
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwHyperlinkEventDescriptor::SwHyperlinkEventDescriptor() : | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     SvDetachedEventDescriptor(aHyperlinkEvents), | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |     sImplName(RTL_CONSTASCII_USTRINGPARAM(sAPI_SwHyperlinkEventDescriptor)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwHyperlinkEventDescriptor::~SwHyperlinkEventDescriptor() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | OUString SwHyperlinkEventDescriptor::getImplementationName(void) | 
					
						
							|  |  |  |     throw( RuntimeException ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return sImplName; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SwHyperlinkEventDescriptor::copyMacrosFromINetFmt( | 
					
						
							|  |  |  |     const SwFmtINetFmt& aFmt) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     for(sal_Int16 i = 0; mpSupportedMacroItems[i].mnEvent != 0; i++) | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         USHORT nEvent = mpSupportedMacroItems[i].mnEvent; | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |         const SvxMacro* aMacro = aFmt.GetMacro(nEvent); | 
					
						
							|  |  |  |         if (NULL != aMacro) | 
					
						
							|  |  |  |             replaceByName(nEvent, *aMacro); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SwHyperlinkEventDescriptor::copyMacrosIntoINetFmt( | 
					
						
							|  |  |  |     SwFmtINetFmt& aFmt) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |     for(sal_Int16 i = 0; mpSupportedMacroItems[i].mnEvent != 0; i++) | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         USHORT nEvent = mpSupportedMacroItems[i].mnEvent; | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |         if (hasByName(nEvent)) | 
					
						
							| 
									
										
										
										
											2001-02-14 12:11:14 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |             SvxMacro aMacro(sEmpty, sEmpty); | 
					
						
							| 
									
										
										
										
											2001-02-14 12:11:14 +00:00
										 |  |  |             getByName(aMacro, nEvent); | 
					
						
							|  |  |  |             aFmt.SetMacro(nEvent, aMacro); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SwHyperlinkEventDescriptor::copyMacrosFromNameReplace( | 
					
						
							|  |  |  |     ::com::sun::star::uno::Reference< | 
					
						
							|  |  |  |         ::com::sun::star::container::XNameReplace> & xReplace) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     // iterate over all names (all names that *we* support)
 | 
					
						
							|  |  |  |     Sequence<OUString> aNames = getElementNames(); | 
					
						
							|  |  |  |     sal_Int32 nCount = aNames.getLength(); | 
					
						
							|  |  |  |     for(sal_Int32 i = 0; i < nCount; i++) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // copy element for that name
 | 
					
						
							|  |  |  |         const OUString& rName = aNames[i]; | 
					
						
							|  |  |  |         if (xReplace->hasByName(rName)) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |             SvBaseEventDescriptor::replaceByName(rName, | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |                                                  xReplace->getByName(rName)); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // SwFrameEventDescriptor
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // use double cast in superclass constructor to avoid ambigous cast
 | 
					
						
							|  |  |  | SwFrameEventDescriptor::SwFrameEventDescriptor( | 
					
						
							|  |  |  |     SwXTextFrame& rFrameRef ) : | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         SvEventDescriptor((text::XTextFrame&)rFrameRef, aFrameEvents), | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |         sSwFrameEventDescriptor(RTL_CONSTASCII_USTRINGPARAM( | 
					
						
							|  |  |  |             sAPI_SwFrameEventDescriptor)), | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |         rFrame(rFrameRef) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwFrameEventDescriptor::SwFrameEventDescriptor( | 
					
						
							|  |  |  |     SwXTextGraphicObject& rGraphicRef ) : | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         SvEventDescriptor((text::XTextContent&)rGraphicRef, aGraphicEvents), | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |         rFrame((SwXFrame&)rGraphicRef) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwFrameEventDescriptor::SwFrameEventDescriptor( | 
					
						
							|  |  |  |     SwXTextEmbeddedObject& rObjectRef ) : | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         SvEventDescriptor((text::XTextContent&)rObjectRef, aOLEEvents), | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |         rFrame((SwXFrame&)rObjectRef) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwFrameEventDescriptor::~SwFrameEventDescriptor() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SwFrameEventDescriptor::setMacroItem(const SvxMacroItem& rItem) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     rFrame.GetFrmFmt()->SetAttr(rItem); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const SvxMacroItem& SwFrameEventDescriptor::getMacroItem() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2000-12-20 14:16:41 +00:00
										 |  |  |     return (const SvxMacroItem&)rFrame.GetFrmFmt()->GetAttr(RES_FRMMACRO); | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | sal_uInt16 SwFrameEventDescriptor::getMacroItemWhich() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return RES_FRMMACRO; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | OUString SwFrameEventDescriptor::getImplementationName() | 
					
						
							|  |  |  |     throw( RuntimeException ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return sSwFrameEventDescriptor; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // SwFrameStyleEventDescriptor
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwFrameStyleEventDescriptor::SwFrameStyleEventDescriptor( | 
					
						
							|  |  |  |     SwXFrameStyle& rStyleRef ) : | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  |         SvEventDescriptor((document::XEventsSupplier&)rStyleRef, | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |                           aFrameStyleEvents), | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  |         sSwFrameStyleEventDescriptor(RTL_CONSTASCII_USTRINGPARAM( | 
					
						
							|  |  |  |             sAPI_SwFrameStyleEventDescriptor)), | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  |         rStyle(rStyleRef) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SwFrameStyleEventDescriptor::~SwFrameStyleEventDescriptor() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SwFrameStyleEventDescriptor::setMacroItem(const SvxMacroItem& rItem) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2000-12-20 14:16:41 +00:00
										 |  |  |     // As I was told, for some entirely unobvious reason getting an
 | 
					
						
							|  |  |  |     // item from a style has to look as follows:
 | 
					
						
							|  |  |  |     SfxStyleSheetBasePool* pBasePool = rStyle.GetBasePool(); | 
					
						
							|  |  |  |     if (pBasePool) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         SfxStyleSheetBase* pBase = pBasePool->Find(rStyle.GetStyleName()); | 
					
						
							|  |  |  |         if (pBase) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             SwDocStyleSheet aStyle(*(SwDocStyleSheet*)pBase); | 
					
						
							|  |  |  |             SfxItemSet& rStyleSet = aStyle.GetItemSet(); | 
					
						
							|  |  |  |             SfxItemSet aSet(*rStyleSet.GetPool(), RES_FRMMACRO, RES_FRMMACRO); | 
					
						
							|  |  |  |             aSet.Put(rItem); | 
					
						
							|  |  |  |             aStyle.SetItemSet(aSet); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-20 14:16:41 +00:00
										 |  |  | static const SvxMacroItem aEmptyMacroItem(RES_FRMMACRO); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | const SvxMacroItem& SwFrameStyleEventDescriptor::getMacroItem() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2000-12-20 14:16:41 +00:00
										 |  |  |     // As I was told, for some entirely unobvious reason getting an
 | 
					
						
							|  |  |  |     // item from a style has to look as follows:
 | 
					
						
							|  |  |  |     SfxStyleSheetBasePool* pBasePool = rStyle.GetBasePool(); | 
					
						
							|  |  |  |     if (pBasePool) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         SfxStyleSheetBase* pBase = pBasePool->Find(rStyle.GetStyleName()); | 
					
						
							|  |  |  |         if (pBase) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             SwDocStyleSheet aStyle(*(SwDocStyleSheet*)pBase); | 
					
						
							|  |  |  |             return (const SvxMacroItem&)aStyle.GetItemSet().Get(RES_FRMMACRO); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |             return aEmptyMacroItem; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         return aEmptyMacroItem; | 
					
						
							| 
									
										
										
										
											2000-12-19 16:28:58 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2001-01-02 13:29:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | OUString SwFrameStyleEventDescriptor::getImplementationName() | 
					
						
							|  |  |  |     throw( RuntimeException ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return sSwFrameStyleEventDescriptor; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2001-02-14 12:11:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-17 12:52:27 +00:00
										 |  |  | sal_uInt16 SwFrameStyleEventDescriptor::getMacroItemWhich() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return RES_FRMMACRO; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 |