LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / svl / source / passwordcontainer / syscreds.hxx
blob4f2d6734788e7b703d4de5b8a9696e7972477fe6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
21 #define INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
23 #include <set>
24 #include <memory>
25 #include <osl/mutex.hxx>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <unotools/configitem.hxx>
30 class SysCredentialsConfig;
32 class SysCredentialsConfigItem : public utl::ConfigItem
34 public:
35 explicit SysCredentialsConfigItem( SysCredentialsConfig * pOwner );
36 //virtual ~SysCredentialsConfigItem();
38 virtual void Notify( const css::uno::Sequence< OUString > & seqPropertyNames ) override;
40 css::uno::Sequence< OUString > getSystemCredentialsURLs();
42 void setSystemCredentialsURLs( const css::uno::Sequence< OUString > & seqURLList );
44 //bool isSystemCredentialsURL( const OUString & rURL ) const;
46 private:
47 virtual void ImplCommit() override;
49 ::osl::Mutex m_aMutex;
50 bool m_bInited;
51 css::uno::Sequence< OUString > m_seqURLs;
52 SysCredentialsConfig * m_pOwner;
55 class SysCredentialsConfig
57 public:
58 SysCredentialsConfig();
60 OUString find( OUString const & rURL );
61 void add( OUString const & rURL, bool bPersistent );
62 void remove( OUString const & rURL );
63 css::uno::Sequence< OUString > list( bool bOnlyPersistent );
65 void persistentConfigChanged();
67 private:
68 void initCfg();
69 void writeCfg();
71 ::osl::Mutex m_aMutex;
72 std::set< OUString > m_aMemContainer;
73 std::set< OUString > m_aCfgContainer;
74 SysCredentialsConfigItem m_aConfigItem;
75 bool m_bCfgInited;
78 #endif // INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */