From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../EventListener/EventListener.cpp | 76 ++ .../EventListener/EventListener.def | 9 + .../EventListener/EventListener.idl | 60 ++ .../EventListener/EventListener.rc | 154 ++++ .../EventListener/EventListener.sln | 31 + .../EventListener/EventListener.vcproj | 927 +++++++++++++++++++++ .../EventListener/EvtListener.cpp | 38 + .../EventListener/EvtListener.h | 52 ++ .../EventListener/EvtListener.rgs | 26 + .../EventListenerSample/EventListener/StdAfx.cpp | 32 + .../ole/EventListenerSample/EventListener/StdAfx.h | 44 + .../EventListenerSample/EventListener/resource.h | 37 + .../VBEventListener/Module1.bas | 9 + .../VBEventListener/VBEventListener.cls | 69 ++ .../VBEventListener/VBasicEventListener.vbp | 38 + .../VBEventListener/VBasicEventListener.vbw | 2 + .../EventListenerSample/VBEventListener/readme.txt | 7 + extensions/test/ole/EventListenerSample/events.htm | 115 +++ extensions/test/ole/EventListenerSample/readme.txt | 20 + 19 files changed, 1746 insertions(+) create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.def create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.idl create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.rc create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.sln create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EvtListener.cpp create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EvtListener.h create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EvtListener.rgs create mode 100644 extensions/test/ole/EventListenerSample/EventListener/StdAfx.cpp create mode 100644 extensions/test/ole/EventListenerSample/EventListener/StdAfx.h create mode 100644 extensions/test/ole/EventListenerSample/EventListener/resource.h create mode 100644 extensions/test/ole/EventListenerSample/VBEventListener/Module1.bas create mode 100644 extensions/test/ole/EventListenerSample/VBEventListener/VBEventListener.cls create mode 100644 extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbp create mode 100644 extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbw create mode 100644 extensions/test/ole/EventListenerSample/VBEventListener/readme.txt create mode 100644 extensions/test/ole/EventListenerSample/events.htm create mode 100644 extensions/test/ole/EventListenerSample/readme.txt (limited to 'extensions/test/ole/EventListenerSample') diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp b/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp new file mode 100644 index 000000000..ad42dda62 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +// EventListener.cpp : Implementation of DLL Exports. + +// Note: Proxy/Stub Information +// To build a separate proxy/stub DLL, +// run nmake -f EventListenerps.mk in the project directory. + +#include "stdafx.h" +#include "resource.h" +#include +#include "EventListener.h" + +#include "EventListener_i.c" +#include "EvtListener.h" + +CComModule _Module; + +BEGIN_OBJECT_MAP(ObjectMap) +OBJECT_ENTRY(CLSID_EvtListener, CEvtListener) +END_OBJECT_MAP() + +// DLL Entry Point + +extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + _Module.Init(ObjectMap, hInstance, &LIBID_EVENTLISTENERLib); + DisableThreadLibraryCalls(hInstance); + } + else if (dwReason == DLL_PROCESS_DETACH) + _Module.Term(); + return TRUE; // ok +} + +// Used to determine whether the DLL can be unloaded by OLE + +STDAPI DllCanUnloadNow(void) { return (_Module.GetLockCount() == 0) ? S_OK : S_FALSE; } + +// Returns a class factory to create an object of the requested type + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + return _Module.GetClassObject(rclsid, riid, ppv); +} + +// DllRegisterServer - Adds entries to the system registry + +STDAPI DllRegisterServer(void) +{ + // registers object, typelib and all interfaces in typelib + return _Module.RegisterServer(TRUE); +} + +// DllUnregisterServer - Removes entries from the system registry + +STDAPI DllUnregisterServer(void) { return _Module.UnregisterServer(TRUE); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.def b/extensions/test/ole/EventListenerSample/EventListener/EventListener.def new file mode 100644 index 000000000..9d88a68f7 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.def @@ -0,0 +1,9 @@ +; EventListener.def : Declares the module parameters. + +LIBRARY "EventListener.DLL" + +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.idl b/extensions/test/ole/EventListenerSample/EventListener/EventListener.idl new file mode 100644 index 000000000..3ed514074 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +// EventListener.idl : IDL source for EventListener.dll + + +// This file will be processed by the MIDL tool to +// produce the type library (EventListener.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + [ + object, + uuid(86653399-24C6-4C2B-9E8A-564175250CB2), + dual, + helpstring("IEvtListener interface"), + pointer_default(unique) + ] + interface IEvtListener : IDispatch + { + [id(1), helpstring("Method disposing")] HRESULT disposing([in] IDispatch* source); + }; + +[ + uuid(E3E61535-3262-45E6-BFD9-EE8AED051BD1), + version(1.0), + helpstring("EventListener 1.0 Type Library") +] +library EVENTLISTENERLib +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + [ + uuid(830E0743-87C1-4C99-A77A-5FBA0C2EBD9A), + helpstring("EvtListener Class") + ] + coclass EvtListener + { + [default] interface IEvtListener; + }; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.rc b/extensions/test/ole/EventListenerSample/EventListener/EventListener.rc new file mode 100644 index 000000000..2de599591 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.rc @@ -0,0 +1,154 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +// Microsoft Developer Studio generated resource script. + +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS + + +// Generated from the TEXTINCLUDE 2 resource. + +#include "winres.h" + + +#undef APSTUDIO_READONLY_SYMBOLS + + +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED + + +// TEXTINCLUDE + + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "1 TYPELIB ""EventListener.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC + + +// Version + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "EventListener Module\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "EventListener\0" + VALUE "LegalCopyright", "Copyright 2001\0" + VALUE "OriginalFilename", "EventListener.DLL\0" + VALUE "ProductName", "EventListener Module\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + VALUE "OLESelfRegister", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + + + +// String Table + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROJNAME "EventListener" +END + +#endif // German (Germany) resources + + + + +// English (USA) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + + + +// REGISTRY + + +IDR_EVTLISTENER REGISTRY DISCARDABLE "EvtListener.rgs" +#endif // English (USA) resources + + + + +#ifndef APSTUDIO_INVOKED + + +// Generated from the TEXTINCLUDE 3 resource. + +1 TYPELIB "EventListener.tlb" + + +#endif // not APSTUDIO_INVOKED + diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln b/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln new file mode 100644 index 000000000..3837163ef --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventListener", "EventListener.vcproj", "{055137B6-A402-4913-AC11-9A096E866F5B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release MinDependency|Win32 = Release MinDependency|Win32 + Release MinSize|Win32 = Release MinSize|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32 + Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.ActiveCfg = Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.Build.0 = Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.Build.0 = Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj b/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj new file mode 100644 index 000000000..e8aef5532 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/EventListenerSample/EventListener/EvtListener.cpp b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.cpp new file mode 100644 index 000000000..677981749 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.cpp @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +// EvtListener.cpp : Implementation of CEvtListener +#include "stdafx.h" +#include "EventListener.h" +#include "EvtListener.h" + + +// CEvtListener + +STDMETHODIMP CEvtListener::disposing( IDispatch* source) +{ + ::MessageBox(NULL,_T("XEventListener::disposing"), + _T("EventListener.EvtListener component"), MB_OK); + return S_OK; +} + +CEvtListener::~CEvtListener() +{ + +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h new file mode 100644 index 000000000..6705864db --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +// EvtListener.h : Declaration of CEvtListener + +#pragma once + +#include "resource.h" + + +// CEvtListener +class ATL_NO_VTABLE CEvtListener : + public CComObjectRootEx, + public CComCoClass, + public IDispatchImpl +{ +public: + CEvtListener() + { + } + ~CEvtListener(); + +DECLARE_REGISTRY_RESOURCEID(IDR_EVTLISTENER) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CEvtListener) + COM_INTERFACE_ENTRY(IEvtListener) + COM_INTERFACE_ENTRY(IDispatch) +END_COM_MAP() + +// IEvtListener +public: + STDMETHOD(disposing)(IDispatch* source); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/EvtListener.rgs b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.rgs new file mode 100644 index 000000000..e0aa9bbb7 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.rgs @@ -0,0 +1,26 @@ +HKCR +{ + EventListener.EvtListener.1 = s 'EvtListener Class' + { + CLSID = s '{830E0743-87C1-4C99-A77A-5FBA0C2EBD9A}' + } + EventListener.EvtListener = s 'EvtListener Class' + { + CLSID = s '{830E0743-87C1-4C99-A77A-5FBA0C2EBD9A}' + CurVer = s 'EventListener.EvtListener.1' + } + NoRemove CLSID + { + ForceRemove {830E0743-87C1-4C99-A77A-5FBA0C2EBD9A} = s 'EvtListener Class' + { + ProgID = s 'EventListener.EvtListener.1' + VersionIndependentProgID = s 'EventListener.EvtListener' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + 'TypeLib' = s '{E3E61535-3262-45E6-BFD9-EE8AED051BD1}' + } + } +} diff --git a/extensions/test/ole/EventListenerSample/EventListener/StdAfx.cpp b/extensions/test/ole/EventListenerSample/EventListener/StdAfx.cpp new file mode 100644 index 000000000..da0608bfd --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/StdAfx.cpp @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +// stdafx.cpp : source file that includes just the standard includes +// stdafx.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include +#include +#endif + +#include + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/StdAfx.h b/extensions/test/ole/EventListenerSample/EventListener/StdAfx.h new file mode 100644 index 000000000..c901a6dbe --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/StdAfx.h @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#if !defined(AFX_STDAFX_H__E275407A_804A_477E_9A28_F5CA84E711C3__INCLUDED_) +#define AFX_STDAFX_H__E275407A_804A_477E_9A28_F5CA84E711C3__INCLUDED_ + +#ifdef _MSC_VER +#pragma once +#endif + +#define STRICT +#define _ATL_APARTMENT_THREADED + +#include +//You may derive a class from CComModule and use it if you want to override +//something, but do not change the name of _Module +extern CComModule _Module; +#include + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__E275407A_804A_477E_9A28_F5CA84E711C3__INCLUDED) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/EventListener/resource.h b/extensions/test/ole/EventListenerSample/EventListener/resource.h new file mode 100644 index 000000000..783a14507 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/resource.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by EventListener.rc + +#define IDS_PROJNAME 100 +#define IDR_EVTLISTENER 101 + +// Next default values for new objects + +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/EventListenerSample/VBEventListener/Module1.bas b/extensions/test/ole/EventListenerSample/VBEventListener/Module1.bas new file mode 100644 index 000000000..aafd265a0 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/VBEventListener/Module1.bas @@ -0,0 +1,9 @@ +Attribute VB_Name = "Module1" +Option Explicit + + +Sub Main() + +End Sub + + diff --git a/extensions/test/ole/EventListenerSample/VBEventListener/VBEventListener.cls b/extensions/test/ole/EventListenerSample/VBEventListener/VBEventListener.cls new file mode 100644 index 000000000..f3c09aa4d --- /dev/null +++ b/extensions/test/ole/EventListenerSample/VBEventListener/VBEventListener.cls @@ -0,0 +1,69 @@ +' +' This file is part of the LibreOffice project. +' +' This Source Code Form is subject to the terms of the Mozilla Public +' License, v. 2.0. If a copy of the MPL was not distributed with this +' file, You can obtain one at http://mozilla.org/MPL/2.0/. +' +' This file incorporates work covered by the following license notice: +' +' Licensed to the Apache Software Foundation (ASF) under one or more +' contributor license agreements. See the NOTICE file distributed +' with this work for additional information regarding copyright +' ownership. The ASF licenses this file to you under the Apache +' License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . +' + +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True + Persistable = 0 'NotPersistable + DataBindingBehavior = 0 'vbNone + DataSourceBehavior = 0 'vbNone + MTSTransactionMode = 0 'NotAnMTSObject +END +Attribute VB_Name = "VBEventListener" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = True +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = True +Option Explicit +Private interfaces(0) As String +Private bDisposingCalled As Boolean +Private bQuiet As Boolean + +Public Property Get Bridge_ImplementedInterfaces() As Variant + Bridge_ImplementedInterfaces = interfaces +End Property + +Private Sub Class_Initialize() +interfaces(0) = "com.sun.star.lang.XEventListener" +bDisposingCalled = False +bQuiet = False +End Sub + +Private Sub Class_Terminate() + On Error Resume Next + Debug.Print "Terminate VBEventListener" +End Sub + +Public Sub disposing(ByVal source As Object) + If bQuiet = False Then + MsgBox "disposing called" + End If + bDisposingCalled = True +End Sub + +Public Sub setQuiet(quiet As Boolean) + bQuiet = quiet +End Sub + +Public Sub resetDisposing() + bDisposingCalled = False +End Sub + +Public Function disposingCalled() + disposingCalled = bDisposingCalled +End Function diff --git a/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbp b/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbp new file mode 100644 index 000000000..f89b866be --- /dev/null +++ b/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbp @@ -0,0 +1,38 @@ +Type=OleDll +Class=VBEventListener; VBEventListener.cls +Module=Module1; Module1.bas +Startup="Sub Main" +HelpFile="" +ExeName32="VBasicEventListener.dll" +Command32="" +Name="VBasicEventListener" +HelpContextID="0" +Description="Implementation of UNO XEventListener" +CompatibleMode="1" +CompatibleEXE32="VBasicEventListener.dll" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="StarOffice" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=1 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +ThreadingModel=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbw b/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbw new file mode 100644 index 000000000..76699ee81 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.vbw @@ -0,0 +1,2 @@ +VBEventListener = 132, 132, 732, 748, +Module1 = 64, 33, 849, 530, diff --git a/extensions/test/ole/EventListenerSample/VBEventListener/readme.txt b/extensions/test/ole/EventListenerSample/VBEventListener/readme.txt new file mode 100644 index 000000000..417c102b0 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/VBEventListener/readme.txt @@ -0,0 +1,7 @@ +VBasicEventListener.dll is an ActiveX component written with VisualBasic. The +component registers on the system with a particular ID. When the library is build +this ID is generated, unless a previously build library exists. Then the ID of that +library is used. In order to use always the same ID, the library must be as binary in +the cvs. + +The library can be used under the licences noted in VBEventListener.cls. diff --git a/extensions/test/ole/EventListenerSample/events.htm b/extensions/test/ole/EventListenerSample/events.htm new file mode 100644 index 000000000..0fae7eee9 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/events.htm @@ -0,0 +1,115 @@ + + + + + +Document Title + + + + + + +

+The script on this page creates a new StarOffice document and connects an event listener +to it. When the document is closed then the XEventListener::disposing method is called on the +listener object. How the listener is set up depends on the button being clicked. +

+

+The button will run JScript code and that adds a JScript event listener to the document. +The listener is also implemented in JScript and is on this page. +

+ +

+ +The button runs JScript code that creates the ActiveX component EventListener.EvtListener that +is written in C++ and housed in a DLL. Then the event listener is added to the document. +

+ +

+The button runs VBScript code that creates the components EventListener.EvtListener and adds it +to the document. +

+ +

+Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was +written with VB. +

+ + + + + + diff --git a/extensions/test/ole/EventListenerSample/readme.txt b/extensions/test/ole/EventListenerSample/readme.txt new file mode 100644 index 000000000..0e7b1f646 --- /dev/null +++ b/extensions/test/ole/EventListenerSample/readme.txt @@ -0,0 +1,20 @@ +EventListener +======================================== + +The folder EventListener contains an MSDEV project that builds a DLL that +contains the EventListener.EvtListener ActiveX component. The component +implements the XEventListener interface according to the rules of the +OleBridge. The component will be used from the HTML page events.htm. + + +VBEventListener: +======================================== + +Contains a Visual Basic project that builds an ActiveX component that implements +com.sun.star.lang.XEventListener. Its ProgId is +VBasicEventListener.VBEventListener. The DLL should also be checked in. VB needs +its TLB, so it uses the same CLSIDs on the next build. The component will create +a message box when its disposing function has been called. + +The project also contains a client that builds a Project1.exe (in the same +folder) that creates VBEventListener and adds it to a StarOffice document. -- cgit v1.2.3