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
;
45 uno::Sequence
< beans::Property
> FTPContent::getProperties(
46 const uno::Reference
< ucb::XCommandEnvironment
> & /*xEnv*/)
50 static const beans::Property aPropsInfoTable
[] =
53 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
55 getCppuType( static_cast< const rtl::OUString
* >( 0 ) ),
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::READONLY
60 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
63 beans::PropertyAttribute::BOUND
64 | beans::PropertyAttribute::READONLY
67 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
70 beans::PropertyAttribute::BOUND
71 | beans::PropertyAttribute::READONLY
74 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
76 getCppuType( static_cast< const rtl::OUString
* >( 0 ) ),
77 beans::PropertyAttribute::BOUND
78 // | beans::PropertyAttribute::READONLY
81 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
83 getCppuType( static_cast< const sal_Int64
* >( 0 ) ),
84 beans::PropertyAttribute::BOUND
85 | beans::PropertyAttribute::READONLY
88 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
90 getCppuType( static_cast< util::DateTime
* >( 0 ) ),
91 beans::PropertyAttribute::BOUND
92 | beans::PropertyAttribute::READONLY
95 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ),
98 beans::PropertyAttribute::BOUND
99 | beans::PropertyAttribute::READONLY
102 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
103 "CreatableContentsInfo" ) ),
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 //=========================================================================
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 ///////////////////////////////////////////////////////////////
134 ///////////////////////////////////////////////////////////////
136 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
142 RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
148 RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
151 static_cast< uno::Sequence
< beans::Property
> * >( 0 ) )
155 RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
158 static_cast< uno::Sequence
< beans::PropertyValue
> * >( 0 ) )
161 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
164 static_cast< ucb::OpenCommandArgument2
* >( 0 ) )
167 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
170 static_cast< ucb::InsertCommandArgument
* >( 0 ) )
173 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
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: */