LibreOffice Module desktop (master)  1
dp_ucb.h
Go to the documentation of this file.
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 <vector>
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 
39 {
40  static css::uno::Sequence< OUString > getTitleSequence()
41  {
42  css::uno::Sequence<OUString> aSeq { "Title" };
43  return aSeq;
44  }
45  static OUString getTitle( ::ucbhelper::Content &rContent )
46  {
47  return rContent.getPropertyValue("Title").get<OUString>();
48  }
49  // just return titles - the ucbhelper should have a simpler API for this [!]
50  static css::uno::Reference< css::sdbc::XResultSet >
53  {
54  return rContent.createCursor( StrTitle::getTitleSequence(), eInclude );
55  }
56 };
57 
58 
60  ::ucbhelper::Content * ucb_content,
61  OUString const & url,
62  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
63  bool throw_exc = true );
64 
65 
69  ::ucbhelper::Content * ucb_content,
70  OUString const & url,
71  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
72  bool throw_exc = true );
73 
74 
76  OUString const & url,
77  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
78  bool throw_exc = true );
79 
80 
82 std::vector<sal_Int8> readFile( ::ucbhelper::Content & ucb_content );
83 
84 
86 bool readLine( OUString * res, OUString const & startingWith,
87  ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
88 
90 bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
91  ::ucbhelper::Content & ucb_content);
92 
93 
94 
95 }
96 
97 #endif
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readProperties(std::vector< std::pair< OUString, OUString > > &out_result,::ucbhelper::Content &ucb_content)
Definition: dp_ucb.cxx:259
css::uno::Any getPropertyValue(const OUString &rPropertyName)
static css::uno::Reference< css::sdbc::XResultSet > createCursor(::ucbhelper::Content &rContent, ucbhelper::ResultSetInclude eInclude)
Definition: dp_ucb.h:51
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC std::vector< sal_Int8 > readFile(::ucbhelper::Content &ucb_content)
Definition: dp_ucb.cxx:190
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readLine(OUString *res, OUString const &startingWith,::ucbhelper::Content &ucb_content, rtl_TextEncoding textenc)
Definition: dp_ucb.cxx:203
#define DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
Definition: dp_misc_api.hxx:29
css::uno::Reference< css::sdbc::XResultSet > createCursor(const css::uno::Sequence< OUString > &rPropertyNames, ResultSetInclude eMode=INCLUDE_FOLDERS_AND_DOCUMENTS)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
static css::uno::Sequence< OUString > getTitleSequence()
Definition: dp_ucb.h:40
static OUString getTitle(::ucbhelper::Content &rContent)
Definition: dp_ucb.h:45
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)