Line data Source code
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 : #ifndef INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
21 : #define INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
22 :
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>
29 :
30 : class SysCredentialsConfig;
31 :
32 2 : class SysCredentialsConfigItem : public utl::ConfigItem
33 : {
34 : public:
35 : explicit SysCredentialsConfigItem( SysCredentialsConfig * pOwner );
36 : //virtual ~SysCredentialsConfigItem();
37 :
38 : virtual void Notify(
39 : const com::sun::star::uno::Sequence< OUString > &
40 : seqPropertyNames ) SAL_OVERRIDE;
41 :
42 : com::sun::star::uno::Sequence< OUString >
43 : getSystemCredentialsURLs();
44 :
45 : void setSystemCredentialsURLs(
46 : const com::sun::star::uno::Sequence< OUString > &
47 : seqURLList );
48 :
49 : //bool isSystemCredentialsURL( const OUString & rURL ) const;
50 :
51 : private:
52 : virtual void ImplCommit() SAL_OVERRIDE;
53 :
54 : ::osl::Mutex m_aMutex;
55 : bool m_bInited;
56 : com::sun::star::uno::Sequence< OUString > m_seqURLs;
57 : SysCredentialsConfig * m_pOwner;
58 : };
59 :
60 : typedef std::set< OUString > StringSet;
61 :
62 2 : class SysCredentialsConfig
63 : {
64 : public:
65 : SysCredentialsConfig();
66 :
67 : OUString find( OUString const & rURL );
68 : void add( OUString const & rURL, bool bPersistent );
69 : void remove( OUString const & rURL );
70 : com::sun::star::uno::Sequence< OUString > list( bool bOnlyPersistent );
71 :
72 : void persistentConfigChanged();
73 :
74 : private:
75 : void initCfg();
76 : void writeCfg();
77 :
78 : ::osl::Mutex m_aMutex;
79 : StringSet m_aMemContainer;
80 : StringSet m_aCfgContainer;
81 : SysCredentialsConfigItem m_aConfigItem;
82 : bool m_bCfgInited;
83 : };
84 :
85 : #endif // INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_SYSCREDS_HXX
86 :
87 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|