1*1c4c525fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1c4c525fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1c4c525fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1c4c525fSAndrew Rist  * distributed with this work for additional information
6*1c4c525fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1c4c525fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1c4c525fSAndrew Rist  * "License"); you may not use this file except in compliance
9*1c4c525fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1c4c525fSAndrew Rist  *
11*1c4c525fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1c4c525fSAndrew Rist  *
13*1c4c525fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1c4c525fSAndrew Rist  * software distributed under the License is distributed on an
15*1c4c525fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1c4c525fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*1c4c525fSAndrew Rist  * specific language governing permissions and limitations
18*1c4c525fSAndrew Rist  * under the License.
19*1c4c525fSAndrew Rist  *
20*1c4c525fSAndrew Rist  *************************************************************/
21*1c4c525fSAndrew Rist 
22*1c4c525fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_stoc_source_uriproc_UriReference_hxx
25cdf0e10cSrcweir #define INCLUDED_stoc_source_uriproc_UriReference_hxx
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "com/sun/star/uno/RuntimeException.hpp"
28cdf0e10cSrcweir #include "osl/mutex.hxx"
29cdf0e10cSrcweir #include "rtl/ustring.hxx"
30cdf0e10cSrcweir #include "sal/types.h"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace rtl { class OUStringBuffer; }
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace stoc { namespace uriproc {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class UriReference {
37cdf0e10cSrcweir public:
38cdf0e10cSrcweir     UriReference(
39cdf0e10cSrcweir         rtl::OUString const & scheme, bool isHierarchical, bool hasAuthority,
40cdf0e10cSrcweir         rtl::OUString const & authority, rtl::OUString const & path,
41cdf0e10cSrcweir         bool hasQuery, rtl::OUString const & query);
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     ~UriReference();
44cdf0e10cSrcweir 
45cdf0e10cSrcweir     rtl::OUString getUriReference()
46cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     sal_Bool isAbsolute() throw (com::sun::star::uno::RuntimeException);
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     rtl::OUString getScheme() throw (com::sun::star::uno::RuntimeException);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     rtl::OUString getSchemeSpecificPart()
53cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     sal_Bool isHierarchical() throw (com::sun::star::uno::RuntimeException);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     sal_Bool hasAuthority() throw (com::sun::star::uno::RuntimeException);
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     rtl::OUString getAuthority() throw (com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     rtl::OUString getPath() throw (com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     sal_Bool hasRelativePath() throw (com::sun::star::uno::RuntimeException);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     sal_Int32 getPathSegmentCount()
66cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     rtl::OUString getPathSegment(sal_Int32 index)
69cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     sal_Bool hasQuery() throw (com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     rtl::OUString getQuery() throw (com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     sal_Bool hasFragment() throw (com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     rtl::OUString getFragment() throw (com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     void setFragment(rtl::OUString const & fragment)
80cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     void clearFragment() throw (com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     osl::Mutex m_mutex;
85cdf0e10cSrcweir     rtl::OUString m_scheme;
86cdf0e10cSrcweir     rtl::OUString m_authority;
87cdf0e10cSrcweir     rtl::OUString m_path;
88cdf0e10cSrcweir     rtl::OUString m_query;
89cdf0e10cSrcweir     rtl::OUString m_fragment;
90cdf0e10cSrcweir     bool m_isHierarchical;
91cdf0e10cSrcweir     bool m_hasAuthority;
92cdf0e10cSrcweir     bool m_hasQuery;
93cdf0e10cSrcweir     bool m_hasFragment;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir private:
96cdf0e10cSrcweir     UriReference(UriReference &); // not implemented
97cdf0e10cSrcweir     void operator =(UriReference); // not implemented
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     void appendSchemeSpecificPart(rtl::OUStringBuffer & buffer) const;
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir } }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir #endif
105