Left: | ||
Right: |
OLD | NEW |
---|---|
1 /** | 1 /** |
2 * \file interaction.h User interaction classes. Message boxes and translations. | 2 * \file interaction.h User interaction classes. Message boxes and translations. |
3 */ | 3 */ |
4 | 4 |
5 #ifndef INTERACTION_H | 5 #ifndef INTERACTION_H |
6 #define INTERACTION_H | 6 #define INTERACTION_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "session.h" | 10 #include "session.h" |
11 | 11 |
12 #include <Windows.h> | 12 #include <Windows.h> |
13 #include <Msi.h> | 13 #include <Msi.h> |
14 #include <MsiQuery.h> | 14 #include <MsiQuery.h> |
15 | 15 |
16 /** | 16 /** |
17 * A modal dialog box as displayable from within a custom action. | 17 * A modal dialog box as displayable from within a custom action. |
18 * | 18 * |
19 * The only fully user interface element that the Windows Installer supports for use within custom actions is a small set of modal dialog boxes. | 19 * The only fully user interface element that the Windows Installer supports for use within custom actions is a small set of modal dialog boxes. |
20 * The Windows Installer provides the call MsiProcessMessage, overloaded by a set of message type constants. | 20 * The Windows Installer provides the call MsiProcessMessage, overloaded by a set of message type constants. |
21 * This class represents those messages with user-provided messages; these ultima tely call MessageBox. | 21 * This class represents those messages with user-provided messages; these ultima tely call MessageBox. |
22 * | 22 * |
23 * \sa | 23 * \sa |
24 * * MSDN [MsiProcessMessage function](http://msdn.microsoft.com/en-us/library /windows/desktop/aa370354%28v=vs.85%29.aspx) | 24 * * MSDN [MsiProcessMessage function](http://msdn.microsoft.com/en-us/library /windows/desktop/aa370354%28v=vs.85%29.aspx) |
25 * * MSDN [Sending Messages to Windows Installer Using MsiProcessMessage](http ://msdn.microsoft.com/en-us/library/windows/desktop/aa371614%28v=vs.85%29.aspx) | 25 * * MSDN [Sending Messages to Windows Installer Using MsiProcessMessage](http ://msdn.microsoft.com/en-us/library/windows/desktop/aa371614%28v=vs.85%29.aspx) |
26 */ | 26 */ |
27 class Installer_Message_Box | 27 class InstallerMessageBox |
28 : public Message | 28 : public Message |
29 { | 29 { |
30 public: | 30 public: |
31 typedef enum | 31 typedef enum |
32 { | 32 { |
33 default_box = 0, | 33 defaultBox = 0, |
Felix Dahlke
2014/10/15 02:46:57
Enum values should be all uppercase and with under
Eric
2014/10/15 15:30:44
I will first point out that our coding style docum
| |
34 error_box = INSTALLMESSAGE::INSTALLMESSAGE_ERROR, | 34 errorBox = INSTALLMESSAGE::INSTALLMESSAGE_ERROR, |
35 warning_box = INSTALLMESSAGE::INSTALLMESSAGE_WARNING, | 35 warningBox = INSTALLMESSAGE::INSTALLMESSAGE_WARNING, |
36 user_box = INSTALLMESSAGE::INSTALLMESSAGE_USER | 36 userBox = INSTALLMESSAGE::INSTALLMESSAGE_USER |
37 } | 37 } |
38 box_type ; | 38 box_type ; |
39 | 39 |
40 typedef enum | 40 typedef enum |
41 { | 41 { |
42 default_buttonset = 0, | 42 defaultButtonset = 0, |
43 ok = MB_OK, | 43 ok = MB_OK, |
44 ok_cancel = MB_OKCANCEL, | 44 okCancel = MB_OKCANCEL, |
45 abort_retry_ignore = MB_ABORTRETRYIGNORE, | 45 abortRetryIgnore = MB_ABORTRETRYIGNORE, |
46 yes_no_cancel = MB_YESNOCANCEL, | 46 yesNoCancel = MB_YESNOCANCEL, |
47 yes_no = MB_YESNO, | 47 yesNo = MB_YESNO, |
48 retry_cancel = MB_RETRYCANCEL | 48 retryCancel = MB_RETRYCANCEL |
49 } | 49 } |
50 buttonset_type ; | 50 buttonset_type ; |
51 | 51 |
52 typedef enum | 52 typedef enum |
53 { | 53 { |
54 default_default_button = 0,» ///< use the default button | 54 defaultDefaultButton = 0, ///< use the default button |
55 default_button_one = MB_DEFBUTTON1, | 55 defaultButtonOne = MB_DEFBUTTON1, |
56 default_button_two = MB_DEFBUTTON2, | 56 defaultButtonTwo = MB_DEFBUTTON2, |
57 default_button_three = MB_DEFBUTTON3 | 57 defaultButtonThree = MB_DEFBUTTON3 |
58 } | 58 } |
59 default_button_type ; | 59 default_button_type ; |
60 | 60 |
61 typedef enum | 61 typedef enum |
62 { | 62 { |
63 default_icon = 0,» » » ///< use the default icon associated with the box_type | 63 defaultIcon = 0,» » » ///< use the default icon associated with the box_type |
64 warning_icon = MB_ICONWARNING,» ///< exclamation point | 64 warningIcon = MB_ICONWARNING,» ///< exclamation point |
65 information_icon = MB_ICONINFORMATION, ///< lowercase letter "i" in a circl e | 65 informationIcon = MB_ICONINFORMATION, ///< lowercase letter "i" in a circle |
66 error_icon = MB_ICONERROR» » ///< stop sign | 66 errorIcon = MB_ICONERROR» » ///< stop sign |
67 } | 67 } |
68 icon_type ; | 68 icon_type ; |
69 | 69 |
70 /** | 70 /** |
71 * Ordinary constructor, wide string | 71 * Ordinary constructor, wide string |
72 */ | 72 */ |
73 Installer_Message_Box( | 73 InstallerMessageBox( |
74 std::wstring message, | 74 std::wstring message, |
75 box_type box = box_type::user_box, | 75 box_type box = box_type::userBox, |
76 buttonset_type buttonset = buttonset_type::default_buttonset, | 76 buttonset_type buttonset = buttonset_type::defaultButtonset, |
77 default_button_type default_button = default_button_type::default_default_bu tton, | 77 default_button_type default_button = default_button_type::defaultDefaultButt on, |
78 icon_type icon = icon_type::default_icon | 78 icon_type icon = icon_type::defaultIcon |
79 ) ; | 79 ) ; |
80 | 80 |
81 /** | 81 /** |
82 * Ordinary constructor, regular string | 82 * Ordinary constructor, regular string |
83 */ | 83 */ |
84 Installer_Message_Box( | 84 InstallerMessageBox( |
85 std::string message, | 85 std::string message, |
86 box_type box = box_type::user_box, | 86 box_type box = box_type::userBox, |
87 buttonset_type buttonset = buttonset_type::default_buttonset, | 87 buttonset_type buttonset = buttonset_type::defaultButtonset, |
88 default_button_type default_button = default_button_type::default_default_bu tton, | 88 default_button_type default_button = default_button_type::defaultDefaultButt on, |
89 icon_type icon = icon_type::default_icon | 89 icon_type icon = icon_type::defaultIcon |
90 ) ; | 90 ) ; |
91 } ; | 91 } ; |
92 | 92 |
93 /** | 93 /** |
94 * Error for any non-handled return value from Session.write_message(). | 94 * Error for any non-handled return value from Session.write_message(). |
95 */ | 95 */ |
96 struct unexpected_return_value_from_message_box | 96 struct UnexpectedReturnValueFromMessageBox |
97 : std::logic_error | 97 : std::logic_error |
98 { | 98 { |
99 unexpected_return_value_from_message_box() | 99 UnexpectedReturnValueFromMessageBox() |
100 : std::logic_error( "Unexpected return value from message box." ) | 100 : std::logic_error( "Unexpected return value from message box." ) |
101 {} | 101 {} |
102 } ; | 102 } ; |
103 | 103 |
104 #endif | 104 #endif |
OLD | NEW |