1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _REGISTER_HXX_
29 #define _REGISTER_HXX_
30 
31 #ifndef _CONSTANTS_HXX_
32 #include "constants.hxx"
33 #endif
34 
35 #ifdef _MSC_VER
36 #pragma warning(push, 1) /* disable warnings within system headers */
37 #endif
38 #define WIN32_LEAN_AND_MEAN
39 #include <windows.h>
40 #include <msi.h>
41 #ifdef _MSC_VER
42 #pragma warning(pop)
43 #endif
44 
45 #include <string>
46 
47 const int MOD_WRITER  = 0x1;
48 const int MOD_CALC    = 0x2;
49 const int MOD_IMPRESS = 0x4;
50 const int MOD_ACTIVEX = 0x40;
51 
52 /*  registers StarOffice for MS document
53     types and as default HTML editor if
54     specified */
55 void Register4MsDoc(MSIHANDLE handle, int Register);
56 
57 void Unregister4MsDoc(MSIHANDLE handle, int Unregister);
58 
59 /* restores the entries for the selected
60    registry entries */
61 void Unregister4MsDocAll(MSIHANDLE handle);
62 
63 /* restores lost settings formerly made
64    with Register4MsDoc */
65 void RepairRegister4MsDocSettings(MSIHANDLE handle);
66 
67 /** Returns whether we are registered for */
68 bool IsRegisteredFor(MSIHANDLE handle, int State);
69 
70 /** Returns whether we should preselect the
71     registration checkbox for a certain
72     application type or not */
73 bool query_preselect_registration_for_ms_application(
74     MSIHANDLE handle, int Register);
75 
76 // StarOffice 6.0 saved the registration
77 // state in HKEY_LOCAL_MACHINE\Software\
78 // Microsoft\Windows\CurrentVersion\Uninstall\
79 // StarOffice 6.0\Reg4MsdocState we move this
80 // value if available to the new registry
81 // location
82 int FixReturnRegistrationState(MSIHANDLE handle);
83 
84 #endif
85