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 <com/sun/star/sdbc/XResultSet.hpp>
25 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
26 #include "dp_misc_api.hxx"
27 #include <ucbhelper/content.hxx>
28 
29 namespace ucbhelper
30 {
31 class Content;
32 }
33 
34 namespace dp_misc {
35 
37 {
38  static css::uno::Sequence< OUString > getTitleSequence()
39  {
40  css::uno::Sequence<OUString> aSeq { "Title" };
41  return aSeq;
42  }
43  static OUString getTitle( ::ucbhelper::Content &rContent )
44  {
45  return rContent.getPropertyValue("Title").get<OUString>();
46  }
47  // just return titles - the ucbhelper should have a simpler API for this [!]
48  static css::uno::Reference< css::sdbc::XResultSet >
51  {
52  return rContent.createCursor( StrTitle::getTitleSequence(), eInclude );
53  }
54 };
55 
56 
58  ::ucbhelper::Content * ucb_content,
59  OUString const & url,
60  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
61  bool throw_exc = true );
62 
63 
67  ::ucbhelper::Content * ucb_content,
68  OUString const & url,
69  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
70  bool throw_exc = true );
71 
72 
74  OUString const & url,
75  css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
76  bool throw_exc = true );
77 
78 
80 std::vector<sal_Int8> readFile( ::ucbhelper::Content & ucb_content );
81 
82 
84 bool readLine( OUString * res, OUString const & startingWith,
85  ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
86 
88 bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
89  ::ucbhelper::Content & ucb_content);
90 
91 
92 
93 }
94 
95 #endif
96 
97 /* 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:258
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:49
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC std::vector< sal_Int8 > readFile(::ucbhelper::Content &ucb_content)
Definition: dp_ucb.cxx:189
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readLine(OUString *res, OUString const &startingWith,::ucbhelper::Content &ucb_content, rtl_TextEncoding textenc)
Definition: dp_ucb.cxx:202
#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:38
static OUString getTitle(::ucbhelper::Content &rContent)
Definition: dp_ucb.h:43
Sequence< sal_Int8 > aSeq
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)