merge the formfield patch from ooo-build
[ooovba.git] / shell / source / backends / gconfbe / gconflayer.hxx
blobe3e0e67313b8a2bd99ebc80e3338a793fbe25de9
1 #ifndef GCONFLAYER_HXX_
2 #define GCONFLAYER_HXX_
4 #include "gconfbackend.hxx"
5 #include <com/sun/star/configuration/backend/XLayer.hpp>
6 #include <com/sun/star/configuration/backend/BackendAccessException.hpp>
8 #ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
9 #include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
10 #endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
11 #include <com/sun/star/util/XTimeStamped.hpp>
12 #include <cppuhelper/implbase2.hxx>
14 #define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
15 #define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
17 enum ConfigurationSetting
19 SETTING_PROXY_MODE,
20 SETTING_PROXY_HTTP_HOST,
21 SETTING_PROXY_HTTP_PORT,
22 SETTING_PROXY_HTTPS_HOST,
23 SETTING_PROXY_HTTPS_PORT,
24 SETTING_PROXY_FTP_HOST,
25 SETTING_PROXY_FTP_PORT,
26 SETTING_NO_PROXY_FOR,
27 SETTING_ENABLE_ACCESSIBILITY,
28 SETTING_MAILER_PROGRAM,
29 SETTING_WORK_DIRECTORY,
30 SETTING_SOURCEVIEWFONT_NAME,
31 SETTING_SOURCEVIEWFONT_HEIGHT,
32 SETTING_USER_GIVENNAME,
33 SETTING_USER_SURNAME,
35 #ifdef ENABLE_LOCKDOWN
37 SETTING_DISABLE_PRINTING,
38 SETTING_USE_SYSTEM_FILE_DIALOG,
39 SETTING_DISABLE_UI_CUSTOMIZATION,
40 SETTING_PRINTING_MODIFIES_DOCUMENT,
41 SETTING_SHOW_ICONS_IN_MENUS,
42 SETTING_SHOW_INACTIVE_MENUITEMS,
43 SETTING_SHOW_FONT_PREVIEW,
44 SETTING_SHOW_FONT_HISTORY,
45 SETTING_ENABLE_OPENGL,
46 SETTING_OPTIMIZE_OPENGL,
47 SETTING_SAVE_DOCUMENT_WINDOWS,
48 SETTING_SAVE_DOCUMENT_VIEW_INFO,
49 SETTING_USE_SYSTEM_FONT,
50 SETTING_USE_FONT_ANTI_ALIASING,
51 SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
52 SETTING_WARN_CREATE_PDF,
53 SETTING_WARN_PRINT_DOC,
54 SETTING_WARN_SAVEORSEND_DOC,
55 SETTING_WARN_SIGN_DOC,
56 SETTING_REMOVE_PERSONAL_INFO,
57 SETTING_RECOMMEND_PASSWORD,
58 SETTING_UNDO_STEPS,
59 SETTING_SYMBOL_SET,
60 SETTING_MACRO_SECURITY_LEVEL,
61 SETTING_CREATE_BACKUP,
62 SETTING_WARN_ALIEN_FORMAT,
63 SETTING_AUTO_SAVE,
64 SETTING_AUTO_SAVE_INTERVAL,
65 SETTING_WRITER_DEFAULT_DOC_FORMAT,
66 SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
67 SETTING_CALC_DEFAULT_DOC_FORMAT,
69 #endif // ENABLE_LOCKDOWN
71 SETTINGS_LAST
74 struct ConfigurationValue
76 const ConfigurationSetting nSettingId;
77 const gchar *GconfItem;
78 const char *OOoConfItem;
79 const char *OOoConfValueType;
80 const sal_Bool bLocked;
81 const sal_Bool bNeedsTranslation;
82 const ConfigurationSetting nDependsOn;
85 namespace css = com::sun::star ;
86 namespace uno = css::uno ;
87 namespace lang = css::lang ;
88 namespace backend = css::configuration::backend ;
89 namespace util = css::util ;
91 /**
92 Implementation of the XLayer interface for the Gconf values mapped into
93 the org.openoffice.* configuration component.
95 class GconfLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
97 public :
98 /**
99 Constructor given the component context
101 @param xContext The component context
104 GconfLayer( const uno::Reference<uno::XComponentContext>& xContext,
105 const ConfigurationValue pConfigurationValuesList[],
106 const sal_Int32 nConfigurationValues,
107 const char * pPreloadValuesList[] );
109 // XLayer
110 virtual void SAL_CALL readData(
111 const uno::Reference<backend::XLayerHandler>& xHandler)
112 throw ( backend::MalformedDataException,
113 lang::NullPointerException,
114 lang::WrappedTargetException,
115 uno::RuntimeException );
117 // XTimeStamped
118 virtual rtl::OUString SAL_CALL getTimestamp(void)
119 throw (uno::RuntimeException);
121 protected:
123 /** Destructor */
124 ~GconfLayer(void) {}
126 private :
127 uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
128 const ConfigurationValue* m_pConfigurationValuesList;
129 const sal_Int32 m_nConfigurationValues;
130 const char** m_pPreloadValuesList;
133 #endif // GCONFLAYER