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 
29 #ifndef SETUP_MAIN_HXX
30 #define SETUP_MAIN_HXX
31 
32 class SetupApp
33 {
34     DWORD           m_nOSVersion;
35     DWORD           m_nMinorVersion;
36     boolean         m_bIsWin9x      : 1;
37     boolean         m_bNeedReboot   : 1;
38     boolean         m_bAdministrative : 1;
39 
40 public:
41     UINT            m_uiRet;
42 
43                     SetupApp();
44     virtual        ~SetupApp();
45 
46     virtual boolean Initialize( HINSTANCE hInst ) = 0;
47     virtual boolean AlreadyRunning() const = 0;
48     virtual boolean ReadProfile() = 0;
49     virtual boolean GetPatches() = 0;
50     virtual boolean ChooseLanguage( long& rLanguage ) = 0;
51     virtual boolean CheckVersion() = 0;
52     virtual boolean CheckForUpgrade() = 0;
53     virtual boolean InstallRuntimes() = 0;
54     virtual boolean Install( long nLanguage ) = 0;
55 
56     virtual UINT    GetError() const = 0;
57     virtual void    DisplayError( UINT nErr ) const = 0;
58 
59     void            SetError( UINT nErr ) { m_uiRet = nErr; }
60     boolean         IsWin9x() const { return m_bIsWin9x; }
61     DWORD           GetOSVersion() const { return m_nOSVersion; }
62     DWORD           GetMinorVersion() const { return m_nMinorVersion; }
63 
64     boolean         IsAdminInstall() { return m_bAdministrative; }
65     void            SetAdminInstall( boolean bValue ) { m_bAdministrative = bValue; }
66 
67     void            SetRebootNeeded( boolean bNeedReboot ) { m_bNeedReboot = bNeedReboot; }
68     boolean         NeedReboot() const { return m_bNeedReboot; }
69 };
70 
71 SetupApp* Create_SetupAppA();
72 SetupApp* Create_SetupAppW();
73 
74 #endif
75