1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATA_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATA_HXX
23 #include <rtl/ustring.hxx>
24 #include <osl/mutex.hxx>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
28 namespace com
{ namespace sun
{ namespace star
{
30 class XHierarchicalNameAccess
;
33 class XOfficeInstallationDirectories
;
37 namespace hierarchy_ucp
42 class HierarchyEntryData
45 enum Type
{ NONE
, LINK
, FOLDER
};
47 HierarchyEntryData() : m_aType( NONE
) {}
48 HierarchyEntryData( const Type
& rType
) : m_aType( rType
) {}
50 const OUString
& getName() const { return m_aName
; }
51 void setName( const OUString
& rName
) { m_aName
= rName
; }
53 const OUString
& getTitle() const { return m_aTitle
; }
54 void setTitle( const OUString
& rTitle
) { m_aTitle
= rTitle
; }
56 const OUString
& getTargetURL() const { return m_aTargetURL
; }
57 void setTargetURL( const OUString
& rURL
) { m_aTargetURL
= rURL
; }
60 { return ( m_aType
!= NONE
) ? m_aType
61 : m_aTargetURL
.getLength()
64 void setType( const Type
& rType
) { m_aType
= rType
; }
67 OUString m_aName
; // Name (language independent)
68 OUString m_aTitle
; // Title (language dependent)
69 OUString m_aTargetURL
; // Target URL ( links only )
75 class HierarchyContentProvider
;
80 OUString m_aServiceSpecifier
;
83 ::osl::Mutex m_aMutex
;
84 ::com::sun::star::uno::Reference
<
85 ::com::sun::star::uno::XComponentContext
> m_xContext
;
86 ::com::sun::star::uno::Reference
<
87 ::com::sun::star::lang::XMultiServiceFactory
> m_xConfigProvider
;
88 ::com::sun::star::uno::Reference
<
89 ::com::sun::star::container::XHierarchicalNameAccess
>
91 ::com::sun::star::uno::Reference
<
92 ::com::sun::star::util::XOfficeInstallationDirectories
>
94 bool m_bTriedToGetRootReadAccess
; // #82494#
97 static OUString
createPathFromHierarchyURL( const HierarchyUri
& rURI
);
98 ::com::sun::star::uno::Reference
<
99 ::com::sun::star::container::XHierarchicalNameAccess
>
103 HierarchyEntry( const ::com::sun::star::uno::Reference
<
104 ::com::sun::star::uno::XComponentContext
>& rxContext
,
105 HierarchyContentProvider
* pProvider
,
106 const OUString
& rURL
);
110 bool getData( HierarchyEntryData
& rData
);
112 bool setData( const HierarchyEntryData
& rData
, bool bCreate
);
114 bool move( const OUString
& rNewURL
,
115 const HierarchyEntryData
& rData
);
121 struct iterator_Impl
;
125 friend class HierarchyEntry
;
127 iterator_Impl
* m_pImpl
;
133 const HierarchyEntryData
& operator*() const;
136 bool first( iterator
& it
);
137 bool next ( iterator
& it
);
140 } // namespace hierarchy_ucp
142 #endif // INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATA_HXX
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */