Update ooo320-m1
[ooovba.git] / ucb / source / ucp / ftp / ftpcontentcaps.cxx
blob7fc47b4cacee61a6fe9051791fd7fc680a10689e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpcontentcaps.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_ucb.hxx"
34 #include <com/sun/star/beans/Property.hpp>
35 #include <com/sun/star/beans/PropertyAttribute.hpp>
36 #include <com/sun/star/beans/PropertyValue.hpp>
37 #include <com/sun/star/ucb/CommandInfo.hpp>
38 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
39 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
40 #include <com/sun/star/util/DateTime.hpp>
41 #include <com/sun/star/uno/Sequence.hxx>
43 #include "ftpcontent.hxx"
45 using namespace com::sun::star;
46 using namespace ftp;
48 // virtual
49 uno::Sequence< beans::Property > FTPContent::getProperties(
50 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/)
52 #define PROPS_COUNT 7
54 static const beans::Property aPropsInfoTable[] =
56 beans::Property(
57 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
58 -1,
59 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
60 beans::PropertyAttribute::BOUND
61 | beans::PropertyAttribute::READONLY
63 beans::Property(
64 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
65 -1,
66 getCppuBooleanType(),
67 beans::PropertyAttribute::BOUND
68 | beans::PropertyAttribute::READONLY
70 beans::Property(
71 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
72 -1,
73 getCppuBooleanType(),
74 beans::PropertyAttribute::BOUND
75 | beans::PropertyAttribute::READONLY
77 beans::Property(
78 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
79 -1,
80 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
81 beans::PropertyAttribute::BOUND
82 // | beans::PropertyAttribute::READONLY
84 beans::Property(
85 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
86 -1,
87 getCppuType( static_cast< const sal_Int64 * >( 0 ) ),
88 beans::PropertyAttribute::BOUND
89 | beans::PropertyAttribute::READONLY
91 beans::Property(
92 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
93 -1,
94 getCppuType( static_cast< util::DateTime* >( 0 ) ),
95 beans::PropertyAttribute::BOUND
96 | beans::PropertyAttribute::READONLY
98 beans::Property(
99 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ),
101 getCppuBooleanType(),
102 beans::PropertyAttribute::BOUND
103 | beans::PropertyAttribute::READONLY
107 return uno::Sequence< beans::Property >( aPropsInfoTable,PROPS_COUNT);
110 //=========================================================================
111 // virtual
112 uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
113 const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
115 // osl::MutexGuard aGuard( m_aMutex );
117 //=================================================================
119 // Supported commands
121 //=================================================================
123 #define COMMAND_COUNT 7
125 static const ucb::CommandInfo aCommandInfoTable[] =
127 ///////////////////////////////////////////////////////////////
128 // Required commands
129 ///////////////////////////////////////////////////////////////
130 ucb::CommandInfo(
131 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
133 getCppuVoidType()
135 ucb::CommandInfo(
136 rtl::OUString(
137 RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
139 getCppuVoidType()
141 ucb::CommandInfo(
142 rtl::OUString(
143 RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
145 getCppuType(
146 static_cast< uno::Sequence< beans::Property > * >( 0 ) )
148 ucb::CommandInfo(
149 rtl::OUString(
150 RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
152 getCppuType(
153 static_cast< uno::Sequence< beans::PropertyValue > * >( 0 ) )
155 ucb::CommandInfo(
156 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
158 getCppuType(
159 static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
161 ucb::CommandInfo(
162 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
164 getCppuType(
165 static_cast< ucb::InsertCommandArgument * >( 0 ) )
167 ucb::CommandInfo(
168 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
170 getCppuType( static_cast< sal_Bool * >( 0 ) )
174 return uno::Sequence<ucb::CommandInfo>(aCommandInfoTable,COMMAND_COUNT);