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 :
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 :
32 : using namespace com::sun::star;
33 : using namespace ftp;
34 :
35 : // virtual
36 0 : uno::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 : OUString( "ContentType" ),
45 : -1,
46 0 : cppu::UnoType<OUString>::get(),
47 : beans::PropertyAttribute::BOUND
48 : | beans::PropertyAttribute::READONLY
49 : ),
50 : beans::Property(
51 : OUString( "IsDocument" ),
52 : -1,
53 0 : getCppuBooleanType(),
54 : beans::PropertyAttribute::BOUND
55 : | beans::PropertyAttribute::READONLY
56 : ),
57 : beans::Property(
58 : OUString( "IsFolder" ),
59 : -1,
60 0 : getCppuBooleanType(),
61 : beans::PropertyAttribute::BOUND
62 : | beans::PropertyAttribute::READONLY
63 : ),
64 : beans::Property(
65 : OUString( "Title" ),
66 : -1,
67 0 : cppu::UnoType<OUString>::get(),
68 : beans::PropertyAttribute::BOUND
69 : // | beans::PropertyAttribute::READONLY
70 : ),
71 : beans::Property(
72 : OUString( "Size" ),
73 : -1,
74 0 : cppu::UnoType<sal_Int64>::get(),
75 : beans::PropertyAttribute::BOUND
76 : | beans::PropertyAttribute::READONLY
77 : ),
78 : beans::Property(
79 : OUString( "DateCreated" ),
80 : -1,
81 0 : cppu::UnoType<util::DateTime>::get(),
82 : beans::PropertyAttribute::BOUND
83 : | beans::PropertyAttribute::READONLY
84 : ),
85 : beans::Property(
86 : OUString( "IsReadOnly" ),
87 : -1,
88 0 : getCppuBooleanType(),
89 : beans::PropertyAttribute::BOUND
90 : | beans::PropertyAttribute::READONLY
91 : ),
92 : beans::Property(
93 : OUString(
94 : "CreatableContentsInfo" ),
95 : -1,
96 : getCppuType(
97 0 : static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
98 : beans::PropertyAttribute::BOUND
99 : | beans::PropertyAttribute::READONLY
100 : )
101 0 : };
102 :
103 0 : return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT );
104 : }
105 :
106 :
107 : // virtual
108 0 : uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
109 : const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
110 : {
111 : // osl::MutexGuard aGuard( m_aMutex );
112 :
113 :
114 :
115 : // Supported commands
116 :
117 :
118 :
119 : #define COMMAND_COUNT 8
120 :
121 : static const ucb::CommandInfo aCommandInfoTable[] =
122 : {
123 :
124 : // Required commands
125 :
126 : ucb::CommandInfo(
127 : OUString( "getCommandInfo" ),
128 : -1,
129 0 : getCppuVoidType()
130 : ),
131 : ucb::CommandInfo(
132 : OUString( "getPropertySetInfo" ),
133 : -1,
134 0 : getCppuVoidType()
135 : ),
136 : ucb::CommandInfo(
137 : OUString( "getPropertyValues" ),
138 : -1,
139 : getCppuType(
140 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
141 : ),
142 : ucb::CommandInfo(
143 : OUString( "setPropertyValues" ),
144 : -1,
145 : getCppuType(
146 0 : static_cast< uno::Sequence< beans::PropertyValue > * >( 0 ) )
147 : ),
148 : ucb::CommandInfo(
149 : OUString( "open" ),
150 : -1,
151 0 : cppu::UnoType<ucb::OpenCommandArgument2>::get()
152 : ),
153 : ucb::CommandInfo(
154 : OUString( "insert" ),
155 : -1,
156 0 : cppu::UnoType<ucb::InsertCommandArgument>::get()
157 : ),
158 : ucb::CommandInfo(
159 : OUString( "delete" ),
160 : -1,
161 0 : getCppuBooleanType()
162 : ),
163 : ucb::CommandInfo(
164 : OUString( "createNewContent" ),
165 : -1,
166 0 : cppu::UnoType<ucb::ContentInfo>::get()
167 : )
168 0 : };
169 :
170 0 : return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
171 : }
172 :
173 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|