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