1*2c7984eaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2c7984eaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2c7984eaSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2c7984eaSAndrew Rist * distributed with this work for additional information 6*2c7984eaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2c7984eaSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2c7984eaSAndrew Rist * "License"); you may not use this file except in compliance 9*2c7984eaSAndrew Rist * with the License. You may obtain a copy of the License at 10*2c7984eaSAndrew Rist * 11*2c7984eaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2c7984eaSAndrew Rist * 13*2c7984eaSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2c7984eaSAndrew Rist * software distributed under the License is distributed on an 15*2c7984eaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2c7984eaSAndrew Rist * KIND, either express or implied. See the License for the 17*2c7984eaSAndrew Rist * specific language governing permissions and limitations 18*2c7984eaSAndrew Rist * under the License. 19*2c7984eaSAndrew Rist * 20*2c7984eaSAndrew Rist *************************************************************/ 21*2c7984eaSAndrew Rist 22*2c7984eaSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _REGISTER_HXX_ 25cdf0e10cSrcweir #define _REGISTER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _CONSTANTS_HXX_ 28cdf0e10cSrcweir #include "constants.hxx" 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifdef _MSC_VER 32cdf0e10cSrcweir #pragma warning(push, 1) /* disable warnings within system headers */ 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir #define WIN32_LEAN_AND_MEAN 35cdf0e10cSrcweir #include <windows.h> 36cdf0e10cSrcweir #include <msi.h> 37cdf0e10cSrcweir #ifdef _MSC_VER 38cdf0e10cSrcweir #pragma warning(pop) 39cdf0e10cSrcweir #endif 40cdf0e10cSrcweir 41cdf0e10cSrcweir #include <string> 42cdf0e10cSrcweir 43cdf0e10cSrcweir const int MOD_WRITER = 0x1; 44cdf0e10cSrcweir const int MOD_CALC = 0x2; 45cdf0e10cSrcweir const int MOD_IMPRESS = 0x4; 46cdf0e10cSrcweir const int MOD_ACTIVEX = 0x40; 47cdf0e10cSrcweir 48cdf0e10cSrcweir /* registers StarOffice for MS document 49cdf0e10cSrcweir types and as default HTML editor if 50cdf0e10cSrcweir specified */ 51cdf0e10cSrcweir void Register4MsDoc(MSIHANDLE handle, int Register); 52cdf0e10cSrcweir 53cdf0e10cSrcweir void Unregister4MsDoc(MSIHANDLE handle, int Unregister); 54cdf0e10cSrcweir 55cdf0e10cSrcweir /* restores the entries for the selected 56cdf0e10cSrcweir registry entries */ 57cdf0e10cSrcweir void Unregister4MsDocAll(MSIHANDLE handle); 58cdf0e10cSrcweir 59cdf0e10cSrcweir /* restores lost settings formerly made 60cdf0e10cSrcweir with Register4MsDoc */ 61cdf0e10cSrcweir void RepairRegister4MsDocSettings(MSIHANDLE handle); 62cdf0e10cSrcweir 63cdf0e10cSrcweir /** Returns whether we are registered for */ 64cdf0e10cSrcweir bool IsRegisteredFor(MSIHANDLE handle, int State); 65cdf0e10cSrcweir 66cdf0e10cSrcweir /** Returns whether we should preselect the 67cdf0e10cSrcweir registration checkbox for a certain 68cdf0e10cSrcweir application type or not */ 69cdf0e10cSrcweir bool query_preselect_registration_for_ms_application( 70cdf0e10cSrcweir MSIHANDLE handle, int Register); 71cdf0e10cSrcweir 72cdf0e10cSrcweir // StarOffice 6.0 saved the registration 73cdf0e10cSrcweir // state in HKEY_LOCAL_MACHINE\Software\ 74cdf0e10cSrcweir // Microsoft\Windows\CurrentVersion\Uninstall\ 75cdf0e10cSrcweir // StarOffice 6.0\Reg4MsdocState we move this 76cdf0e10cSrcweir // value if available to the new registry 77cdf0e10cSrcweir // location 78cdf0e10cSrcweir int FixReturnRegistrationState(MSIHANDLE handle); 79cdf0e10cSrcweir 80cdf0e10cSrcweir #endif 81