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 _URLPARAMETER_HXX_
21 #define _URLPARAMETER_HXX_
23 #include <rtl/ustring.hxx>
24 #include <rtl/string.hxx>
25 #include <com/sun/star/ucb/IllegalIdentifierException.hpp>
26 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
27 #include <com/sun/star/io/XActiveDataSink.hpp>
28 #include <com/sun/star/io/XOutputStream.hpp>
29 #include <com/sun/star/ucb/Command.hpp>
37 class DbtToStringConverter
41 DbtToStringConverter( const sal_Char
* ptr
)
51 sal_Int32 sizeOfFile
= ( sal_Int32
) m_ptr
[0];
52 OUString
Hash( m_ptr
+1,sizeOfFile
,RTL_TEXTENCODING_UTF8
);
54 if( ( idx
= Hash
.indexOf( sal_Unicode( '#' ) ) ) != -1 )
55 return Hash
.copy( 1+idx
);
66 sal_Int32 sizeOfFile
= ( sal_Int32
) m_ptr
[0];
67 OUString
File( m_ptr
+1,sizeOfFile
,RTL_TEXTENCODING_UTF8
);
69 if( ( idx
= File
.indexOf( sal_Unicode( '#' ) ) ) != -1 )
70 return File
.copy( 0,idx
);
76 OUString
getDatabase()
81 sal_Int32 sizeOfDatabase
= ( int ) m_ptr
[ 1+ ( sal_Int32
) m_ptr
[0] ];
82 return OUString( m_ptr
+ 2 + ( sal_Int32
) m_ptr
[0],sizeOfDatabase
,RTL_TEXTENCODING_UTF8
);
91 sal_Int32 sizeOfTitle
=
92 ( sal_Int32
) m_ptr
[ 2 + m_ptr
[0] + ( sal_Int32
) m_ptr
[ 1+ ( sal_Int32
) m_ptr
[0] ] ];
93 return OUString( m_ptr
+ 3 + m_ptr
[0] + ( sal_Int32
) m_ptr
[ 1+ ( sal_Int32
) m_ptr
[0] ],
95 RTL_TEXTENCODING_UTF8
);
101 const sal_Char
* m_ptr
;
112 URLParameter( const OUString
& aURL
,
113 Databases
* pDatabases
)
114 throw( com::sun::star::ucb::IllegalIdentifierException
);
116 bool isPicture() const { return m_aModule
== "picture"; }
117 bool isActive() const { return !m_aActive
.isEmpty() && m_aActive
== "true"; }
118 bool isQuery() const { return m_aId
.isEmpty() && !m_aQuery
.isEmpty(); }
119 bool isEntryForModule() const { return m_aId
== "start" || m_bStart
; }
120 bool isFile() const { return !m_aId
.isEmpty(); }
121 bool isModule() const { return m_aId
.isEmpty() && !m_aModule
.isEmpty(); }
122 bool isRoot() const { return m_aModule
.isEmpty(); }
123 bool isErrorDocument();
125 OUString
get_url() const { return m_aURL
; }
131 // Not called for an directory
133 OUString
get_path() { return get_the_path(); }
135 OUString
get_eid() const { return m_aEid
; }
137 OUString
get_title();
139 OUString
get_jar() { return get_the_jar(); }
141 OUString
get_ExtensionRegistryPath() const { return m_aExtensionRegistryPath
; }
143 OUString
get_module() const { return m_aModule
; }
145 OUString
get_dbpar() const
147 if( !m_aDbPar
.isEmpty() )
153 OUString
get_prefix() const { return m_aPrefix
; }
155 OUString
get_language();
157 OUString
get_device() const { return m_aDevice
; }
159 OUString
get_program();
161 OUString
get_query() const { return m_aQuery
; }
163 OUString
get_scope() const { return m_aScope
; }
165 OUString
get_system() const { return m_aSystem
; }
167 sal_Int32
get_hitCount() const { return m_nHitCount
; }
169 OString
getByName( const char* par
);
171 void open( const com::sun::star::ucb::Command
& aCommand
,
173 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
,
174 const com::sun::star::uno::Reference
< com::sun::star::io::XActiveDataSink
>& xDataSink
);
176 void open( const com::sun::star::ucb::Command
& aCommand
,
178 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
,
179 const com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
>& xDataSink
);
183 Databases
* m_pDatabases
;
185 bool m_bHelpDataFileRead
;
197 OUString m_aExtensionRegistryPath
;
201 OUString m_aDefaultLanguage
;
202 OUString m_aLanguage
;
215 sal_Int32 m_nHitCount
; // The default maximum hitcount
220 void init( bool bDefaultLanguageIsInitialized
);
222 OUString
get_the_tag();
224 OUString
get_the_path();
226 OUString
get_the_title();
228 OUString
get_the_jar();
230 void readHelpDataFile();
232 void parse() throw( com::sun::star::ucb::IllegalIdentifierException
);
238 bool name( bool modulePresent
);
242 }; // end class URLParameter
245 } // end namespace chelp
249 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */