Update ooo320-m1
[ooovba.git] / setup_native / source / win32 / customactions / reg4msdoc / registrar.hxx
blob90d90db90bddc48398ac77bdfa9842f446ca23b9
1 // Registrar.h: Schnittstelle f�r die Klasse Registrar.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #ifndef _REGISTRAR_HXX_
6 #define _REGISTRAR_HXX_
8 #include "registry.hxx"
9 #include "registrationcontextinformation.hxx"
11 #ifndef _CONSTANTS_HXX_
12 #include "constants.hxx"
13 #endif
15 class Registrar
17 public:
19 Registrar(const RegistrationContextInformation& RegContext);
21 virtual ~Registrar();
23 bool IsRegisteredFor(int State) const;
25 virtual void RegisterForMsWord() const;
26 virtual void UnregisterForMsWord() const;
27 virtual bool QueryPreselectMsWordRegistration() const;
29 virtual void RegisterForMsExcel() const;
30 virtual void UnregisterForMsExcel() const;
31 virtual bool QueryPreselectMsExcelRegistration() const;
33 virtual void RegisterForMsPowerPoint() const;
34 virtual void UnregisterForMsPowerPoint() const;
35 virtual bool QueryPreselectMsPowerPointRegistration() const;
37 virtual void RegisterAsHtmlEditorForInternetExplorer() const;
38 virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
40 virtual void RegisterAsDefaultHtmlEditorForInternetExplorer() const;
41 virtual void UnregisterAsDefaultHtmlEditorForInternetExplorer() const;
43 virtual void RegisterAsDefaultShellHtmlEditor() const;
44 virtual void UnregisterAsDefaultShellHtmlEditor() const;
46 /** Restore the last registration state (necessary for
47 Setup repair)
49 virtual void RepairRegistrationState() const;
51 /** Unregisters all and delete all Registry keys we have written
53 virtual void UnregisterAllAndCleanUpRegistry() const;
55 protected:
57 virtual void RegisterForMsOfficeApplication(
58 const std::wstring& FileExtension,
59 const std::wstring& DocumentDisplayName,
60 const std::wstring& DefaultIconEntry,
61 const std::wstring& DefaultShellCommand,
62 const std::wstring& ShellNewCommandDisplayName,
63 const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const;
65 virtual void UnregisterForMsOfficeApplication(
66 const std::wstring& FileExtension) const;
68 virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
70 void SaveRegisteredFor(int State) const;
71 void SaveNotRegisteredFor(int State) const;
73 int GetRegisterState() const;
74 void SetRegisterState(int NewState) const;
76 virtual bool QueryPreselectForMsApplication(const std::wstring& file_extension) const;
78 /** A helper function (for readability) returns true if OpenOffice is already
79 registered for a MS application
81 @param DocumentExtensionDefValue
82 The default value of the appropriate document extension Registry key
84 bool IsOpenOfficeRegisteredForMsApplication(const std::wstring& DocumentExtensionDefValue) const;
86 protected:
87 const RegistrationContextInformation& m_ContextInformation;
89 const std::wstring FORWARD_KEY_PREFIX;
90 const std::wstring DEFAULT_VALUE_NAME;
91 const std::wstring BACKUP_VALUE_NAME;
92 const std::wstring PRIVATE_BACKUP_KEY_NAME;
93 const std::wstring REGISTRATION_STATE;
95 RegistryKey m_RootKey;
97 // prevent copy/assignment
98 private:
99 Registrar(const Registrar&);
100 Registrar& operator=(const Registrar&);
103 #endif