1*cdf0e10cSrcweir // Registrar.h: Schnittstelle f�r die Klasse Registrar.
2*cdf0e10cSrcweir //
3*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
4*cdf0e10cSrcweir 
5*cdf0e10cSrcweir #ifndef _REGISTRAR_HXX_
6*cdf0e10cSrcweir #define _REGISTRAR_HXX_
7*cdf0e10cSrcweir 
8*cdf0e10cSrcweir #include "registry.hxx"
9*cdf0e10cSrcweir #include "registrationcontextinformation.hxx"
10*cdf0e10cSrcweir 
11*cdf0e10cSrcweir #ifndef _CONSTANTS_HXX_
12*cdf0e10cSrcweir #include "constants.hxx"
13*cdf0e10cSrcweir #endif
14*cdf0e10cSrcweir 
15*cdf0e10cSrcweir class Registrar
16*cdf0e10cSrcweir {
17*cdf0e10cSrcweir public:
18*cdf0e10cSrcweir 
19*cdf0e10cSrcweir 	Registrar(const RegistrationContextInformation& RegContext);
20*cdf0e10cSrcweir 
21*cdf0e10cSrcweir 	virtual ~Registrar();
22*cdf0e10cSrcweir 
23*cdf0e10cSrcweir     bool IsRegisteredFor(int State) const;
24*cdf0e10cSrcweir 
25*cdf0e10cSrcweir 	virtual void RegisterForMsWord() const;
26*cdf0e10cSrcweir 	virtual void UnregisterForMsWord() const;
27*cdf0e10cSrcweir     virtual bool QueryPreselectMsWordRegistration() const;
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir 	virtual void RegisterForMsExcel() const;
30*cdf0e10cSrcweir 	virtual void UnregisterForMsExcel() const;
31*cdf0e10cSrcweir     virtual bool QueryPreselectMsExcelRegistration() const;
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir 	virtual void RegisterForMsPowerPoint() const;
34*cdf0e10cSrcweir 	virtual void UnregisterForMsPowerPoint() const;
35*cdf0e10cSrcweir     virtual bool QueryPreselectMsPowerPointRegistration() const;
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir 	virtual void RegisterAsHtmlEditorForInternetExplorer() const;
38*cdf0e10cSrcweir 	virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 	virtual void RegisterAsDefaultHtmlEditorForInternetExplorer() const;
41*cdf0e10cSrcweir 	virtual void UnregisterAsDefaultHtmlEditorForInternetExplorer() const;
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir 	virtual void RegisterAsDefaultShellHtmlEditor() const;
44*cdf0e10cSrcweir 	virtual void UnregisterAsDefaultShellHtmlEditor() const;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 	/** Restore the last registration state (necessary for
47*cdf0e10cSrcweir 		Setup repair)
48*cdf0e10cSrcweir 	*/
49*cdf0e10cSrcweir 	virtual void RepairRegistrationState() const;
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir     /** Unregisters all and delete all Registry keys we have written
52*cdf0e10cSrcweir     */
53*cdf0e10cSrcweir     virtual void UnregisterAllAndCleanUpRegistry() const;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir protected:
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir     virtual void RegisterForMsOfficeApplication(
58*cdf0e10cSrcweir         const std::wstring& FileExtension,
59*cdf0e10cSrcweir         const std::wstring& DocumentDisplayName,
60*cdf0e10cSrcweir         const std::wstring& DefaultIconEntry,
61*cdf0e10cSrcweir         const std::wstring& DefaultShellCommand,
62*cdf0e10cSrcweir         const std::wstring& ShellNewCommandDisplayName,
63*cdf0e10cSrcweir         const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const;
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir     virtual void UnregisterForMsOfficeApplication(
66*cdf0e10cSrcweir         const std::wstring& FileExtension) const;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir     virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	void SaveRegisteredFor(int State) const;
71*cdf0e10cSrcweir     void SaveNotRegisteredFor(int State) const;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir     int GetRegisterState() const;
74*cdf0e10cSrcweir     void SetRegisterState(int NewState) const;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     virtual bool QueryPreselectForMsApplication(const std::wstring& file_extension) const;
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     /** A helper function (for readability) returns true if OpenOffice is already
79*cdf0e10cSrcweir           registered for a MS application
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir           @param DocumentExtensionDefValue
82*cdf0e10cSrcweir                       The default value of the appropriate document extension Registry key
83*cdf0e10cSrcweir     */
84*cdf0e10cSrcweir     bool IsOpenOfficeRegisteredForMsApplication(const std::wstring& DocumentExtensionDefValue) const;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir protected:
87*cdf0e10cSrcweir 	const RegistrationContextInformation&	m_ContextInformation;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir     const std::wstring FORWARD_KEY_PREFIX;
90*cdf0e10cSrcweir     const std::wstring DEFAULT_VALUE_NAME;
91*cdf0e10cSrcweir     const std::wstring BACKUP_VALUE_NAME;
92*cdf0e10cSrcweir     const std::wstring PRIVATE_BACKUP_KEY_NAME;
93*cdf0e10cSrcweir     const std::wstring REGISTRATION_STATE;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir     RegistryKey	 m_RootKey;
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir // prevent copy/assignment
98*cdf0e10cSrcweir private:
99*cdf0e10cSrcweir 	Registrar(const Registrar&);
100*cdf0e10cSrcweir 	Registrar& operator=(const Registrar&);
101*cdf0e10cSrcweir };
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir #endif
104