Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / win32 / customactions / reg4msdoc / registrar.hxx
blob851b12f8daf78cea3f03460f0c41358918f2a029
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // Registrar.h: Schnittstelle f�r die Klasse Registrar.
3 //
4 //////////////////////////////////////////////////////////////////////
6 #ifndef _REGISTRAR_HXX_
7 #define _REGISTRAR_HXX_
9 #include "registry.hxx"
10 #include "registrationcontextinformation.hxx"
12 #include "constants.hxx"
14 class Registrar
16 public:
18 Registrar(const RegistrationContextInformation& RegContext);
20 virtual ~Registrar();
22 bool IsRegisteredFor(int State) const;
24 virtual void RegisterForMsWord() const;
25 virtual void UnregisterForMsWord() const;
26 virtual bool QueryPreselectMsWordRegistration() const;
28 virtual void RegisterForMsExcel() const;
29 virtual void UnregisterForMsExcel() const;
30 virtual bool QueryPreselectMsExcelRegistration() const;
32 virtual void RegisterForMsPowerPoint() const;
33 virtual void UnregisterForMsPowerPoint() const;
34 virtual bool QueryPreselectMsPowerPointRegistration() const;
36 virtual void RegisterAsHtmlEditorForInternetExplorer() const;
37 virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
39 virtual void RegisterAsDefaultHtmlEditorForInternetExplorer() const;
40 virtual void UnregisterAsDefaultHtmlEditorForInternetExplorer() const;
42 virtual void RegisterAsDefaultShellHtmlEditor() const;
43 virtual void UnregisterAsDefaultShellHtmlEditor() const;
45 /** Restore the last registration state (necessary for
46 Setup repair)
48 virtual void RepairRegistrationState() const;
50 /** Unregisters all and delete all Registry keys we have written
52 virtual void UnregisterAllAndCleanUpRegistry() const;
54 protected:
56 virtual void RegisterForMsOfficeApplication(
57 const std::wstring& FileExtension,
58 const std::wstring& DocumentDisplayName,
59 const std::wstring& DefaultIconEntry,
60 const std::wstring& DefaultShellCommand,
61 const std::wstring& ShellNewCommandDisplayName,
62 const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const;
64 virtual void UnregisterForMsOfficeApplication(
65 const std::wstring& FileExtension) const;
67 virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
69 void SaveRegisteredFor(int State) const;
70 void SaveNotRegisteredFor(int State) const;
72 int GetRegisterState() const;
73 void SetRegisterState(int NewState) const;
75 virtual bool QueryPreselectForMsApplication(const std::wstring& file_extension) const;
77 /** A helper function (for readability) returns true if OpenOffice is already
78 registered for a MS application
80 @param DocumentExtensionDefValue
81 The default value of the appropriate document extension Registry key
83 bool IsOpenOfficeRegisteredForMsApplication(const std::wstring& DocumentExtensionDefValue) const;
85 protected:
86 const RegistrationContextInformation& m_ContextInformation;
88 const std::wstring FORWARD_KEY_PREFIX;
89 const std::wstring DEFAULT_VALUE_NAME;
90 const std::wstring BACKUP_VALUE_NAME;
91 const std::wstring PRIVATE_BACKUP_KEY_NAME;
92 const std::wstring REGISTRATION_STATE;
94 RegistryKey m_RootKey;
96 // prevent copy/assignment
97 private:
98 Registrar(const Registrar&);
99 Registrar& operator=(const Registrar&);
102 #endif
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */