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_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_UCB_H
21 : #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_UCB_H
22 :
23 : #include <list>
24 : #include <rtl/byteseq.hxx>
25 : #include <rtl/instance.hxx>
26 : #include <com/sun/star/sdbc/XResultSet.hpp>
27 : #include <com/sun/star/ucb/XCommandEnvironment.hpp>
28 : #include "dp_misc_api.hxx"
29 : #include <ucbhelper/content.hxx>
30 :
31 : namespace ucbhelper
32 : {
33 : class Content;
34 : }
35 :
36 : namespace dp_misc {
37 :
38 : struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle
39 : {
40 3501 : static css::uno::Sequence< OUString > getTitleSequence()
41 : {
42 3501 : css::uno::Sequence< OUString > aSeq( 1 );
43 3501 : aSeq[ 0 ] = "Title";
44 3501 : return aSeq;
45 : }
46 17 : static OUString getTitle( ::ucbhelper::Content &rContent )
47 : {
48 17 : return rContent.getPropertyValue("Title").get<OUString>();
49 : }
50 : // just return titles - the ucbhelper should have a simpler API for this [!]
51 : static css::uno::Reference< css::sdbc::XResultSet >
52 1082 : createCursor( ::ucbhelper::Content &rContent,
53 : ucbhelper::ResultSetInclude eInclude )
54 : {
55 : return css::uno::Reference< css::sdbc::XResultSet >(
56 1082 : rContent.createCursor( StrTitle::getTitleSequence(), eInclude ) );
57 : }
58 : };
59 :
60 :
61 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(
62 : ::ucbhelper::Content * ucb_content,
63 : OUString const & url,
64 : css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
65 : bool throw_exc = true );
66 :
67 :
68 : /** @return true if previously non-existing folder has been created
69 : */
70 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(
71 : ::ucbhelper::Content * ucb_content,
72 : OUString const & url,
73 : css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
74 : bool throw_exc = true );
75 :
76 :
77 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(
78 : OUString const & url,
79 : css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
80 : bool throw_exc = true );
81 :
82 :
83 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
84 : ::rtl::ByteSequence readFile( ::ucbhelper::Content & ucb_content );
85 :
86 :
87 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
88 : bool readLine( OUString * res, OUString const & startingWith,
89 : ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
90 :
91 : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
92 : bool readProperties( ::std::list< ::std::pair< OUString, OUString> > & out_result,
93 : ::ucbhelper::Content & ucb_content);
94 :
95 :
96 :
97 : }
98 :
99 : #endif
100 :
101 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|