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