Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / ftp / ftpcontentcaps.cxx
blobfb9f152c965d15c756f0f8b75808b3d082c325fd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <com/sun/star/beans/Property.hpp>
31 #include <com/sun/star/beans/PropertyAttribute.hpp>
32 #include <com/sun/star/beans/PropertyValue.hpp>
33 #include <com/sun/star/ucb/CommandInfo.hpp>
34 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
35 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
36 #include <com/sun/star/util/DateTime.hpp>
37 #include <com/sun/star/uno/Sequence.hxx>
39 #include "ftpcontent.hxx"
41 using namespace com::sun::star;
42 using namespace ftp;
44 // virtual
45 uno::Sequence< beans::Property > FTPContent::getProperties(
46 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/)
48 #define PROPS_COUNT 8
50 static const beans::Property aPropsInfoTable[] =
52 beans::Property(
53 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
54 -1,
55 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::READONLY
59 beans::Property(
60 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
61 -1,
62 getCppuBooleanType(),
63 beans::PropertyAttribute::BOUND
64 | beans::PropertyAttribute::READONLY
66 beans::Property(
67 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
68 -1,
69 getCppuBooleanType(),
70 beans::PropertyAttribute::BOUND
71 | beans::PropertyAttribute::READONLY
73 beans::Property(
74 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
75 -1,
76 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
77 beans::PropertyAttribute::BOUND
78 // | beans::PropertyAttribute::READONLY
80 beans::Property(
81 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
82 -1,
83 getCppuType( static_cast< const sal_Int64 * >( 0 ) ),
84 beans::PropertyAttribute::BOUND
85 | beans::PropertyAttribute::READONLY
87 beans::Property(
88 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
89 -1,
90 getCppuType( static_cast< util::DateTime * >( 0 ) ),
91 beans::PropertyAttribute::BOUND
92 | beans::PropertyAttribute::READONLY
94 beans::Property(
95 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ),
96 -1,
97 getCppuBooleanType(),
98 beans::PropertyAttribute::BOUND
99 | beans::PropertyAttribute::READONLY
101 beans::Property(
102 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
103 "CreatableContentsInfo" ) ),
105 getCppuType(
106 static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
107 beans::PropertyAttribute::BOUND
108 | beans::PropertyAttribute::READONLY
112 return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT );
115 //=========================================================================
116 // virtual
117 uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
118 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
120 // osl::MutexGuard aGuard( m_aMutex );
122 //=================================================================
124 // Supported commands
126 //=================================================================
128 #define COMMAND_COUNT 8
130 static const ucb::CommandInfo aCommandInfoTable[] =
132 ///////////////////////////////////////////////////////////////
133 // Required commands
134 ///////////////////////////////////////////////////////////////
135 ucb::CommandInfo(
136 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
138 getCppuVoidType()
140 ucb::CommandInfo(
141 rtl::OUString(
142 RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
144 getCppuVoidType()
146 ucb::CommandInfo(
147 rtl::OUString(
148 RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
150 getCppuType(
151 static_cast< uno::Sequence< beans::Property > * >( 0 ) )
153 ucb::CommandInfo(
154 rtl::OUString(
155 RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
157 getCppuType(
158 static_cast< uno::Sequence< beans::PropertyValue > * >( 0 ) )
160 ucb::CommandInfo(
161 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
163 getCppuType(
164 static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
166 ucb::CommandInfo(
167 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
169 getCppuType(
170 static_cast< ucb::InsertCommandArgument * >( 0 ) )
172 ucb::CommandInfo(
173 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
175 getCppuBooleanType()
177 ucb::CommandInfo(
178 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
180 getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
184 return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */