LibreOffice Module ucb (master) 1
ftpcontentcaps.cxx
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
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>
29
30#include "ftpcontent.hxx"
31
32using namespace com::sun::star;
33using namespace ftp;
34
35// virtual
36uno::Sequence< beans::Property > FTPContent::getProperties(
37 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/)
38{
39 #define PROPS_COUNT 8
40
41 static const beans::Property aPropsInfoTable[] =
42 {
43 beans::Property(
44 "ContentType",
45 -1,
47 beans::PropertyAttribute::BOUND
48 | beans::PropertyAttribute::READONLY
49 ),
50 beans::Property(
51 "IsDocument",
52 -1,
54 beans::PropertyAttribute::BOUND
55 | beans::PropertyAttribute::READONLY
56 ),
57 beans::Property(
58 "IsFolder",
59 -1,
61 beans::PropertyAttribute::BOUND
62 | beans::PropertyAttribute::READONLY
63 ),
64 beans::Property(
65 "Title",
66 -1,
68 beans::PropertyAttribute::BOUND
69 // | beans::PropertyAttribute::READONLY
70 ),
71 beans::Property(
72 "Size",
73 -1,
75 beans::PropertyAttribute::BOUND
76 | beans::PropertyAttribute::READONLY
77 ),
78 beans::Property(
79 "DateCreated",
80 -1,
82 beans::PropertyAttribute::BOUND
83 | beans::PropertyAttribute::READONLY
84 ),
85 beans::Property(
86 "IsReadOnly",
87 -1,
89 beans::PropertyAttribute::BOUND
90 | beans::PropertyAttribute::READONLY
91 ),
92 beans::Property(
93 "CreatableContentsInfo",
94 -1,
95 cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(),
96 beans::PropertyAttribute::BOUND
97 | beans::PropertyAttribute::READONLY
98 )
99 };
100
101 return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT );
102}
103
104
105// virtual
106uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
107 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
108{
109// osl::MutexGuard aGuard( m_aMutex );
110
111
112 // Supported commands
113
114
115 #define COMMAND_COUNT 8
116
117 static const ucb::CommandInfo aCommandInfoTable[] =
118 {
119
120 // Required commands
121
122 ucb::CommandInfo(
123 "getCommandInfo",
124 -1,
126 ),
127 ucb::CommandInfo(
128 "getPropertySetInfo",
129 -1,
131 ),
132 ucb::CommandInfo(
133 "getPropertyValues",
134 -1,
135 cppu::UnoType<uno::Sequence< beans::Property >>::get()
136 ),
137 ucb::CommandInfo(
138 "setPropertyValues",
139 -1,
140 cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get()
141 ),
142 ucb::CommandInfo(
143 "open",
144 -1,
146 ),
147 ucb::CommandInfo(
148 "insert",
149 -1,
151 ),
152 ucb::CommandInfo(
153 "delete",
154 -1,
156 ),
157 ucb::CommandInfo(
158 "createNewContent",
159 -1,
161 )
162 };
163
164 return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
165}
166
167/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::ucb::CommandInfo > getCommands(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv) override
#define COMMAND_COUNT
#define PROPS_COUNT
Definition of ftpcontentprovider.