Update ooo320-m1
[ooovba.git] / setup_native / source / win32 / customactions / reg4msdoc / registrationcontextinformation.hxx
blobe2b5b039340decd2fc267ba4363ebe837fea294c
1 // MsOfficeDocumentInformation.h: Schnittstelle f�r die Klasse MsOfficeDocumentInformation.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #ifndef _REGISTRATIONCONTEXTINFORMATION_HXX_
6 #define _REGISTRATIONCONTEXTINFORMATION_HXX_
8 #ifdef _MSC_VER
9 #pragma warning(push, 1) /* disable warnings within system headers */
10 #endif
11 #define WIN32_LEAN_AND_MEAN
12 #include <windows.h>
13 #include <msi.h>
14 #ifdef _MSC_VER
15 #pragma warning(pop)
16 #endif
18 #include <string>
20 /** A simple implementation class that returns the
21 appropriate display names for the Microsoft
22 Office document types.
23 Under Windows 9x this class checks if the
24 document display name is convertable to an ANSI
25 string and if not returns an english default.
26 So we avoid garbage if soemone for instance
27 installs an japanese StarOffice/OpenOffice
28 under a German Windows 98 for instance.
30 class RegistrationContextInformation
32 public:
34 enum SHELL_COMMAND {New, Open, Print, Printto};
35 enum OFFICE_APPLICATION {Office, Writer, Calc, Impress};
37 RegistrationContextInformation(MSIHANDLE hMsi, const std::wstring& OpenOfficeExecutablePath);
39 /** Word document information
40 The icon index is the index of the icon
41 in soffice.exe to be associated with
42 word document files
44 std::wstring GetWordDocumentDisplayName() const;
45 std::wstring GetWordDocumentFileExtension() const;
46 std::wstring GetWordDocumentDefaultIconEntry() const;
47 std::wstring GetWordDocumentDefaultShellCommand() const;
49 /** MOOX Word document information
50 The icon index is the index of the icon
51 in soffice.exe to be associated with
52 word document files
54 std::wstring GetMOOXWordDocumentDisplayName() const;
55 std::wstring GetMOOXWordDocumentFileExtension() const;
57 /** Word template information
58 The icon index is the index of the icon
59 in soffice.exe to be associated with
60 word template files
62 std::wstring GetWordTemplateDisplayName() const;
63 std::wstring GetWordTemplateFileExtension() const;
64 std::wstring GetWordTemplateDefaultIconEntry() const;
65 std::wstring GetWordTemplateDefaultShellCommand() const;
67 /** Rtf document information
68 The icon index is the index of the icon
69 in soffice.exe to be associated with
70 rtf document files
72 std::wstring GetRtfDocumentDisplayName() const;
73 std::wstring GetRtfDocumentFileExtension() const;
74 std::wstring GetRtfDocumentDefaultIconEntry() const;
75 std::wstring GetRtfDocumentDefaultShellCommand() const;
77 /** Excel sheet information
78 The icon index is the index of the icon
79 in soffice.exe to be associated with
80 Excel sheets
82 std::wstring GetExcelSheetDisplayName() const;
83 std::wstring GetExcelSheetFileExtension() const;
84 std::wstring GetExcelSheetDefaultIconEntry() const;
85 std::wstring GetExcelSheetDefaultShellCommand() const;
87 std::wstring GetMOOXExcelSheetDisplayName() const;
88 std::wstring GetMOOXExcelSheetFileExtension() const;
90 /** Excel template information
91 The icon index is the index of the icon
92 in soffice.exe to be associated with
93 Excel template files
95 std::wstring GetExcelTemplateDisplayName() const;
96 std::wstring GetExcelTemplateFileExtension() const;
97 std::wstring GetExcelTemplateDefaultIconEntry() const;
98 std::wstring GetExcelTemplateDefaultShellCommand() const;
100 /** PowerPoint document information
101 The icon index is the index of the icon
102 in soffice.exe to be associated with
103 PowerPoint document files
105 std::wstring GetPowerPointDocumentDisplayName() const;
106 std::wstring GetPowerPointDocumentFileExtension() const;
107 std::wstring GetPowerPointDocumentDefaultIconEntry() const;
108 std::wstring GetPowerPointDocumentDefaultShellCommand() const;
110 std::wstring GetMOOXPowerPointDocumentDisplayName() const;
111 std::wstring GetMOOXPowerPointDocumentFileExtension() const;
113 /** PowerPoint template information
114 The icon index is the index of the icon
115 in soffice.exe to be associated with
116 PowerPoint template files
118 std::wstring GetPowerPointTemplateDisplayName() const;
119 std::wstring GetPowerPointTemplateFileExtension() const;
120 std::wstring GetPowerPointTemplateDefaultIconEntry() const;
121 std::wstring GetPowerPointTemplateDefaultShellCommand() const;
123 /** PowerPoint Show information
125 std::wstring GetPowerPointShowDisplayName() const;
126 std::wstring GetPowerPointShowFileExtension() const;
127 std::wstring GetPowerPointShowDefaultIconEntry() const;
128 std::wstring GetPowerPointShowDefaultShellCommand() const;
130 /** The string for the "New" command that should appear
131 in the Explorer context menu when someone right
132 clicks a Microsoft document
134 std::wstring ShellNewCommandDisplayName() const;
136 /** The string for the "Edit" command that should
137 appear in the Explorer context menu when someone
138 right clicks a document
140 std::wstring ShellEditCommandDisplayName() const;
142 /** A friendly name for the application
144 std::wstring GetOpenOfficeFriendlyAppName() const;
146 /** The path to the StarOffice/OpenOffice executable
148 std::wstring GetOpenOfficeExecutablePath() const;
150 /** The name of the executable (currently "soffice.exe"
151 but may change in the future, who knows)
153 std::wstring GetOpenOfficeExecutableName() const;
155 /** A command line for the specified shell command
157 std::wstring GetOpenOfficeCommandline(SHELL_COMMAND ShellCommand,
158 OFFICE_APPLICATION OfficeApp) const;
160 private:
161 bool IsConvertableToAnsi(const std::wstring& String) const;
163 void ExtractOpenOfficeExecNameFromPath();
165 private:
166 MSIHANDLE msihandle_;
167 bool m_IsWin9x;
168 std::wstring m_OOExecPath;
169 std::wstring m_OOExecName;
172 #endif