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 .
21 #include <com/sun/star/beans/Property.hpp>
22 #include <com/sun/star/beans/PropertyAttribute.hpp>
23 #include <com/sun/star/beans/PropertyValue.hpp>
24 #include <com/sun/star/ucb/CommandInfo.hpp>
25 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
26 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
27 #include <com/sun/star/util/DateTime.hpp>
28 #include <com/sun/star/uno/Sequence.hxx>
30 #include "ftpcontent.hxx"
32 using namespace com::sun::star
;
36 uno::Sequence
< beans::Property
> FTPContent::getProperties(
37 const uno::Reference
< ucb::XCommandEnvironment
> & /*xEnv*/)
41 static const beans::Property aPropsInfoTable
[] =
44 OUString( "ContentType" ),
46 cppu::UnoType
<OUString
>::get(),
47 beans::PropertyAttribute::BOUND
48 | beans::PropertyAttribute::READONLY
51 OUString( "IsDocument" ),
53 cppu::UnoType
<bool>::get(),
54 beans::PropertyAttribute::BOUND
55 | beans::PropertyAttribute::READONLY
58 OUString( "IsFolder" ),
60 cppu::UnoType
<bool>::get(),
61 beans::PropertyAttribute::BOUND
62 | beans::PropertyAttribute::READONLY
67 cppu::UnoType
<OUString
>::get(),
68 beans::PropertyAttribute::BOUND
69 // | beans::PropertyAttribute::READONLY
74 cppu::UnoType
<sal_Int64
>::get(),
75 beans::PropertyAttribute::BOUND
76 | beans::PropertyAttribute::READONLY
79 OUString( "DateCreated" ),
81 cppu::UnoType
<util::DateTime
>::get(),
82 beans::PropertyAttribute::BOUND
83 | beans::PropertyAttribute::READONLY
86 OUString( "IsReadOnly" ),
88 cppu::UnoType
<bool>::get(),
89 beans::PropertyAttribute::BOUND
90 | beans::PropertyAttribute::READONLY
94 "CreatableContentsInfo" ),
96 cppu::UnoType
<uno::Sequence
< ucb::ContentInfo
>>::get(),
97 beans::PropertyAttribute::BOUND
98 | beans::PropertyAttribute::READONLY
102 return uno::Sequence
< beans::Property
>( aPropsInfoTable
, PROPS_COUNT
);
107 uno::Sequence
< ucb::CommandInfo
> FTPContent::getCommands(
108 const uno::Reference
< ucb::XCommandEnvironment
> & /*xEnv*/ )
110 // osl::MutexGuard aGuard( m_aMutex );
114 // Supported commands
118 #define COMMAND_COUNT 8
120 static const ucb::CommandInfo aCommandInfoTable
[] =
126 OUString( "getCommandInfo" ),
128 cppu::UnoType
<void>::get()
131 OUString( "getPropertySetInfo" ),
133 cppu::UnoType
<void>::get()
136 OUString( "getPropertyValues" ),
138 cppu::UnoType
<uno::Sequence
< beans::Property
>>::get()
141 OUString( "setPropertyValues" ),
143 cppu::UnoType
<uno::Sequence
< beans::PropertyValue
>>::get()
148 cppu::UnoType
<ucb::OpenCommandArgument2
>::get()
151 OUString( "insert" ),
153 cppu::UnoType
<ucb::InsertCommandArgument
>::get()
156 OUString( "delete" ),
158 cppu::UnoType
<bool>::get()
161 OUString( "createNewContent" ),
163 cppu::UnoType
<ucb::ContentInfo
>::get()
167 return uno::Sequence
< ucb::CommandInfo
>( aCommandInfoTable
, COMMAND_COUNT
);
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */