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