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 _CONTENT_HXX 25 #define _CONTENT_HXX 26 27 #include <vos/ref.hxx> 28 #include <ucbhelper/contenthelper.hxx> 29 #include <com/sun/star/io/XInputStream.hpp> 30 31 #include "urlparameter.hxx" 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 namespace chelp 43 { 44 45 //========================================================================= 46 47 // UNO service name for the content. 48 #define MYUCP_CONTENT_SERVICE_NAME \ 49 "com.sun.star.ucb.CHelpContent" 50 51 //========================================================================= 52 53 class Databases; 54 55 struct ContentProperties 56 { 57 ::rtl::OUString aTitle; // Title 58 ::rtl::OUString aContentType; // ContentType 59 sal_Bool bIsDocument; // IsDocument 60 sal_Bool bIsFolder; // IsFolder 61 ContentPropertieschelp::ContentProperties62 ContentProperties() 63 : bIsDocument( sal_True ), bIsFolder( sal_False ) {} 64 }; 65 66 //========================================================================= 67 68 class Content : public ::ucbhelper::ContentImplHelper 69 { 70 public: 71 72 Content( const ::com::sun::star::uno::Reference< 73 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, 74 ::ucbhelper::ContentProviderImplHelper* pProvider, 75 const ::com::sun::star::uno::Reference< 76 ::com::sun::star::ucb::XContentIdentifier >& Identifier, 77 Databases* pDatabases ); 78 79 virtual ~Content(); 80 81 // XInterface 82 XINTERFACE_DECL() 83 84 // XTypeProvider 85 XTYPEPROVIDER_DECL() 86 87 // XServiceInfo 88 virtual ::rtl::OUString SAL_CALL 89 getImplementationName(); 90 91 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 92 getSupportedServiceNames(); 93 94 // XContent 95 virtual rtl::OUString SAL_CALL 96 getContentType(); 97 98 // XCommandProcessor 99 virtual com::sun::star::uno::Any SAL_CALL 100 execute( const com::sun::star::ucb::Command& aCommand, 101 sal_Int32 CommandId, 102 const com::sun::star::uno::Reference< 103 com::sun::star::ucb::XCommandEnvironment >& Environment ); 104 105 virtual void SAL_CALL 106 abort( sal_Int32 CommandId ); 107 108 109 private: 110 111 // private members; 112 113 ContentProperties m_aProps; 114 URLParameter m_aURLParameter; 115 Databases* m_pDatabases; 116 117 118 // private methods 119 120 virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > 121 getProperties( const com::sun::star::uno::Reference< 122 com::sun::star::ucb::XCommandEnvironment > & xEnv ); 123 virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo > 124 getCommands( const com::sun::star::uno::Reference< 125 com::sun::star::ucb::XCommandEnvironment > & xEnv ); 126 getParentURL()127 virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); } 128 129 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > 130 getPropertyValues( const ::com::sun::star::uno::Sequence< 131 ::com::sun::star::beans::Property >& rProperties ); 132 void setPropertyValues( 133 const ::com::sun::star::uno::Sequence< 134 ::com::sun::star::beans::PropertyValue >& rValues ); 135 136 137 }; 138 139 } 140 141 #endif 142