1*6df1ea1fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6df1ea1fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6df1ea1fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6df1ea1fSAndrew Rist * distributed with this work for additional information 6*6df1ea1fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6df1ea1fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6df1ea1fSAndrew Rist * "License"); you may not use this file except in compliance 9*6df1ea1fSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*6df1ea1fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*6df1ea1fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6df1ea1fSAndrew Rist * software distributed under the License is distributed on an 15*6df1ea1fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6df1ea1fSAndrew Rist * KIND, either express or implied. See the License for the 17*6df1ea1fSAndrew Rist * specific language governing permissions and limitations 18*6df1ea1fSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*6df1ea1fSAndrew Rist *************************************************************/ 21*6df1ea1fSAndrew Rist 22*6df1ea1fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _FTP_FTPCONTENT_HXX 25cdf0e10cSrcweir #define _FTP_FTPCONTENT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <ucbhelper/contenthelper.hxx> 28cdf0e10cSrcweir #include <com/sun/star/ucb/InsertCommandArgument.hpp> 29cdf0e10cSrcweir #include <com/sun/star/ucb/XContentCreator.hpp> 30cdf0e10cSrcweir #include "ftpurl.hxx" 31cdf0e10cSrcweir 32cdf0e10cSrcweir 33cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace beans { 34cdf0e10cSrcweir struct Property; 35cdf0e10cSrcweir struct PropertyValue; 36cdf0e10cSrcweir } } } } 37cdf0e10cSrcweir 38cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace sdbc { 39cdf0e10cSrcweir class XRow; 40cdf0e10cSrcweir } } } } 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir namespace ftp 44cdf0e10cSrcweir { 45cdf0e10cSrcweir 46cdf0e10cSrcweir //========================================================================= 47cdf0e10cSrcweir 48cdf0e10cSrcweir // UNO service name for the content. 49cdf0e10cSrcweir #define FTP_CONTENT_SERVICE_NAME "com.sun.star.ucb.FTPContent" 50cdf0e10cSrcweir 51cdf0e10cSrcweir //========================================================================= 52cdf0e10cSrcweir 53cdf0e10cSrcweir class FTPContentProvider; 54cdf0e10cSrcweir 55cdf0e10cSrcweir //========================================================================= 56cdf0e10cSrcweir 57cdf0e10cSrcweir class FTPContent 58cdf0e10cSrcweir : public ::ucbhelper::ContentImplHelper, 59cdf0e10cSrcweir public com::sun::star::ucb::XContentCreator 60cdf0e10cSrcweir { 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir 63cdf0e10cSrcweir FTPContent( const ::com::sun::star::uno::Reference< 64cdf0e10cSrcweir ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, 65cdf0e10cSrcweir FTPContentProvider* pProvider, 66cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 67cdf0e10cSrcweir ::com::sun::star::ucb::XContentIdentifier >& Identifier, 68cdf0e10cSrcweir const FTPURL& FtpUrl); 69cdf0e10cSrcweir 70cdf0e10cSrcweir FTPContent( const ::com::sun::star::uno::Reference< 71cdf0e10cSrcweir ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, 72cdf0e10cSrcweir FTPContentProvider* pProvider, 73cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 74cdf0e10cSrcweir ::com::sun::star::ucb::XContentIdentifier >& Identifier, 75cdf0e10cSrcweir const com::sun::star::ucb::ContentInfo& aInfo); 76cdf0e10cSrcweir 77cdf0e10cSrcweir 78cdf0e10cSrcweir virtual ~FTPContent(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir // XInterface 81cdf0e10cSrcweir XINTERFACE_DECL() 82cdf0e10cSrcweir 83cdf0e10cSrcweir // XTypeProvider 84cdf0e10cSrcweir XTYPEPROVIDER_DECL() 85cdf0e10cSrcweir 86cdf0e10cSrcweir // XServiceInfo 87cdf0e10cSrcweir XSERVICEINFO_DECL() 88cdf0e10cSrcweir 89cdf0e10cSrcweir // XContent 90cdf0e10cSrcweir virtual rtl::OUString SAL_CALL 91cdf0e10cSrcweir getContentType() 92cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException ); 93cdf0e10cSrcweir 94cdf0e10cSrcweir // XCommandProcessor 95cdf0e10cSrcweir virtual com::sun::star::uno::Any SAL_CALL 96cdf0e10cSrcweir execute( const com::sun::star::ucb::Command& aCommand, 97cdf0e10cSrcweir sal_Int32 CommandId, 98cdf0e10cSrcweir const com::sun::star::uno::Reference< 99cdf0e10cSrcweir com::sun::star::ucb::XCommandEnvironment >& Environment ) 100cdf0e10cSrcweir throw( com::sun::star::uno::Exception, 101cdf0e10cSrcweir com::sun::star::ucb::CommandAbortedException, 102cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir virtual void SAL_CALL 105cdf0e10cSrcweir abort(sal_Int32 CommandId) 106cdf0e10cSrcweir throw( com::sun::star::uno::RuntimeException); 107cdf0e10cSrcweir 108cdf0e10cSrcweir // XContentCreator 109cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< 110cdf0e10cSrcweir com::sun::star::ucb::ContentInfo > SAL_CALL 111cdf0e10cSrcweir queryCreatableContentsInfo( ) 112cdf0e10cSrcweir throw (com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual com::sun::star::uno::Reference< 115cdf0e10cSrcweir com::sun::star::ucb::XContent > SAL_CALL 116cdf0e10cSrcweir createNewContent( const com::sun::star::ucb::ContentInfo& Info ) 117cdf0e10cSrcweir throw (com::sun::star::uno::RuntimeException); 118cdf0e10cSrcweir 119cdf0e10cSrcweir // XChild 120cdf0e10cSrcweir 121cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 122cdf0e10cSrcweir ::com::sun::star::uno::XInterface > SAL_CALL 123cdf0e10cSrcweir getParent( ) 124cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 125cdf0e10cSrcweir 126cdf0e10cSrcweir virtual void SAL_CALL 127cdf0e10cSrcweir setParent( const ::com::sun::star::uno::Reference< 128cdf0e10cSrcweir ::com::sun::star::uno::XInterface >& Parent ) 129cdf0e10cSrcweir throw (::com::sun::star::lang::NoSupportException, 130cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 131cdf0e10cSrcweir 132cdf0e10cSrcweir 133cdf0e10cSrcweir static com::sun::star::uno::Sequence< 134cdf0e10cSrcweir com::sun::star::ucb::ContentInfo > 135cdf0e10cSrcweir queryCreatableContentsInfo_Static( ) 136cdf0e10cSrcweir throw (com::sun::star::uno::RuntimeException); 137cdf0e10cSrcweir 138cdf0e10cSrcweir private: 139cdf0e10cSrcweir 140cdf0e10cSrcweir FTPContentProvider *m_pFCP; 141cdf0e10cSrcweir FTPURL m_aFTPURL; 142cdf0e10cSrcweir bool m_bInserted; 143cdf0e10cSrcweir bool m_bTitleSet; 144cdf0e10cSrcweir com::sun::star::ucb::ContentInfo m_aInfo; 145cdf0e10cSrcweir 146cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > 147cdf0e10cSrcweir getProperties( const com::sun::star::uno::Reference< 148cdf0e10cSrcweir com::sun::star::ucb::XCommandEnvironment > & xEnv ); 149cdf0e10cSrcweir 150cdf0e10cSrcweir 151cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< 152cdf0e10cSrcweir com::sun::star::ucb::CommandInfo> 153cdf0e10cSrcweir getCommands(const com::sun::star::uno::Reference< 154cdf0e10cSrcweir com::sun::star::ucb::XCommandEnvironment > & xEnv); 155cdf0e10cSrcweir 156cdf0e10cSrcweir 157cdf0e10cSrcweir virtual ::rtl::OUString getParentURL(); 158cdf0e10cSrcweir 159cdf0e10cSrcweir com::sun::star::uno::Reference<com::sun::star::sdbc::XRow> 160cdf0e10cSrcweir getPropertyValues( 161cdf0e10cSrcweir const com::sun::star::uno::Sequence< 162cdf0e10cSrcweir com::sun::star::beans::Property>& seqProp, 163cdf0e10cSrcweir const com::sun::star::uno::Reference< 164cdf0e10cSrcweir com::sun::star::ucb::XCommandEnvironment >& Environment 165cdf0e10cSrcweir ); 166cdf0e10cSrcweir 167cdf0e10cSrcweir com::sun::star::uno::Sequence<com::sun::star::uno::Any> 168cdf0e10cSrcweir setPropertyValues( 169cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< 170cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue>& seqPropVal); 171cdf0e10cSrcweir 172cdf0e10cSrcweir void insert(const com::sun::star::ucb::InsertCommandArgument&, 173cdf0e10cSrcweir const com::sun::star::uno::Reference< 174cdf0e10cSrcweir com::sun::star::ucb::XCommandEnvironment>&); 175cdf0e10cSrcweir }; 176cdf0e10cSrcweir 177cdf0e10cSrcweir } 178cdf0e10cSrcweir 179cdf0e10cSrcweir #endif 180