OSDN Git Service

9463c0ca003497e86054a2f2ee884bf6f2e529be
[mingw/mingw-get.git] / src / setup.h
1 #ifndef SETUP_H
2 /*
3  * setup.h
4  *
5  * $Id$
6  *
7  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8  * Copyright (C) 2013, MinGW.org Project
9  *
10  *
11  * Resource ID definitions and class declarations which are specific
12  * the mingw-get setup tool implementation.
13  *
14  *
15  * This is free software.  Permission is granted to copy, modify and
16  * redistribute this software, under the provisions of the GNU General
17  * Public License, Version 3, (or, at your option, any later version),
18  * as published by the Free Software Foundation; see the file COPYING
19  * for licensing details.
20  *
21  * Note, in particular, that this software is provided "as is", in the
22  * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23  * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24  * PARTICULAR PURPOSE.  Under no circumstances will the author, or the
25  * MinGW Project, accept liability for any damages, however caused,
26  * arising from the use of this software.
27  *
28  */
29 #define SETUP_H
30
31 #ifndef IMPLEMENTATION_LEVEL
32 #define IMPLEMENTATION_LEVEL    SETUP_TOOL_COMPONENT
33 #endif
34
35 #include "pkgimpl.h"
36
37 /* Dialogue identifiers...
38  */
39 #define IDD_SETUP_BEGIN          201
40 #define IDD_SETUP_OPTIONS        202
41 #define IDD_SETUP_LICENCE        203
42 #define IDD_SETUP_DOWNLOAD       204
43 #define IDD_SETUP_UNWISE         205
44 #define IDD_SETUP_EXISTS         206
45
46 /* Control identifiers...
47  */
48 #define ID_SETUP_RUN            2049
49 #define ID_SETUP_CHDIR          2050
50 #define ID_SETUP_CURDIR         2051
51 #define ID_SETUP_WITH_GUI       2052
52 #define ID_SETUP_ME_ONLY        2053
53 #define ID_SETUP_ALL_USERS      2054
54 #define ID_SETUP_START_MENU     2055
55 #define ID_SETUP_DESKTOP        2056
56 #define ID_SETUP_SHOW_LICENCE   2057
57
58 #ifndef RC_INVOKED
59 /* When compiling program code, rather than resources...
60  *
61  * We need to refer to the pkgXmlDocument class before it is formally
62  * declared; provide a minimal forward declaration.
63  */
64 class pkgXmlDocument;
65
66 #if IMPLEMENTATION_LEVEL == SETUP_TOOL_COMPONENT
67  /*
68   * The setup tool substitutes its own pkgSetupAction class,
69   * in place of mingw-get's pkgActionItem class.
70   */
71 # define pkgActionItem pkgSetupAction
72 #endif
73
74 /* User configuration choices...
75  */
76 #define SETUP_OPTION_WITH_GUI   0x0010
77 #define SETUP_OPTION_ALL_USERS  0x0001
78 #define SETUP_OPTION_START_MENU 0x0002
79 #define SETUP_OPTION_DESKTOP    0x0004
80
81 #define SETUP_OPTION_DEFAULTS   0x0016
82 #define SETUP_OPTION_PRIVILEGED 0x0100
83
84 enum
85 { /* Request codes for the setup hook functions, which are
86    * serviced by mingw-get-setup-0.dll
87    */
88   SETUP_HOOK_DMH_BIND = 0,
89   SETUP_HOOK_POST_INSTALL,
90   SETUP_HOOK_RUN_INSTALLER
91 };
92
93 class pkgSetupAction
94 {
95   /* A customised variation of the pkgActionItem class, tailored
96    * specifically to the requirements of the setup tool.
97    */
98   public:
99     inline unsigned long HasAttribute( unsigned long );
100     pkgSetupAction( pkgSetupAction *, const char *, const char * = 0 );
101     inline void DownloadArchiveFiles( void );
102     inline int UnpackScheduledArchives( void );
103     void ClearAllActions( void );
104     void UpdateDatabase( pkgXmlDocument & );
105
106   private:
107     unsigned long flags;
108     const char *package_name;
109     inline pkgSetupAction *Selection( void ){ return this; }
110     inline const char *ArchiveName( void ){ return package_name; }
111     void DownloadSingleArchive( const char *, const char * );
112     void DownloadArchiveFiles( pkgSetupAction * );
113     pkgSetupAction *prev, *next;
114     ~pkgSetupAction();
115 };
116
117 #endif /* !RC_INVOKED */
118 #endif /* !defined SETUP_H: $RCSfile$: end of file */