LibreOffice Module extensions (master) 1
ldapuserprofilebe.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/container/XNameAccess.hpp>
27
28#include "ldapaccess.hxx"
29
30namespace com::sun::star::uno {
31 class XComponentContext;
32}
33
35
36namespace uno = css::uno ;
37namespace lang = css::lang ;
38namespace container = css::container;
39
40struct LdapDefinition;
41
42typedef cppu::WeakComponentImplHelper<css::beans::XPropertySet,
43 lang::XServiceInfo> BackendBase ;
44
51{
52 public:
53
54 explicit LdapUserProfileBe(const uno::Reference<uno::XComponentContext>& xContext);
55 virtual ~LdapUserProfileBe() override ;
56
57 // XServiceInfo
58 virtual OUString SAL_CALL
59 getImplementationName( ) override ;
60
61 virtual sal_Bool SAL_CALL
62 supportsService( const OUString& aServiceName ) override ;
63
64 virtual uno::Sequence<OUString> SAL_CALL
65 getSupportedServiceNames( ) override ;
66
67 // XPropertySet
68 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
70 { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
71
72 virtual void SAL_CALL setPropertyValue(
73 OUString const &, css::uno::Any const &) override;
74
75 virtual css::uno::Any SAL_CALL getPropertyValue(
76 OUString const & PropertyName) override;
77
78 virtual void SAL_CALL addPropertyChangeListener(
79 OUString const &,
80 css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
81 {}
82
83 virtual void SAL_CALL removePropertyChangeListener(
84 OUString const &,
85 css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
86 {}
87
88 virtual void SAL_CALL addVetoableChangeListener(
89 OUString const &,
90 css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
91 {}
92
93 virtual void SAL_CALL removeVetoableChangeListener(
94 OUString const &,
95 css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
96 {}
97
98 private:
100 static bool readLdapConfiguration(
101 uno::Reference<uno::XComponentContext> const & context,
102 LdapDefinition * definition, OUString * loggedOnUser);
103
104 static bool getLdapStringParam(uno::Reference<container::XNameAccess> const & xAccess,
105 const OUString& aLdapSetting,
106 OUString& aServerParameter);
107
109} ;
110
111}
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Implements the PlatformBackend service, a specialization of the XPropertySet service for retrieving L...
LdapUserProfileBe(const uno::Reference< uno::XComponentContext > &xContext)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removePropertyChangeListener(OUString const &, css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
static bool getLdapStringParam(uno::Reference< container::XNameAccess > const &xAccess, const OUString &aLdapSetting, OUString &aServerParameter)
virtual sal_Bool SAL_CALL supportsService(const OUString &aServiceName) override
virtual void SAL_CALL addVetoableChangeListener(OUString const &, css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
virtual void SAL_CALL setPropertyValue(OUString const &, css::uno::Any const &) override
virtual css::uno::Any SAL_CALL getPropertyValue(OUString const &PropertyName) override
virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL addPropertyChangeListener(OUString const &, css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
static bool readLdapConfiguration(uno::Reference< uno::XComponentContext > const &context, LdapDefinition *definition, OUString *loggedOnUser)
Check if LDAP is configured.
virtual void SAL_CALL removeVetoableChangeListener(OUString const &, css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
std::map< OUString, OUString > LdapData
Definition: ldapaccess.hxx:72
cppu::WeakComponentImplHelper< css::beans::XPropertySet, lang::XServiceInfo > BackendBase
Struct containing the information on LDAP connection.
Definition: ldapaccess.hxx:50
unsigned char sal_Bool