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 SC_APPLUNO_HXX 25 #define SC_APPLUNO_HXX 26 27 #include <svl/itemprop.hxx> 28 #include <com/sun/star/lang/XServiceInfo.hpp> 29 #include <com/sun/star/beans/XPropertySet.hpp> 30 #include <com/sun/star/sheet/XRecentFunctions.hpp> 31 #include <com/sun/star/sheet/XFunctionDescriptions.hpp> 32 #include <com/sun/star/container/XEnumerationAccess.hpp> 33 #include <com/sun/star/container/XNameAccess.hpp> 34 #include <cppuhelper/implbase2.hxx> 35 #include <cppuhelper/implbase4.hxx> 36 37 class ScFunctionDescriptionObj; 38 39 40 41 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL 42 ScSpreadsheetSettings_CreateInstance( 43 const com::sun::star::uno::Reference< 44 com::sun::star::lang::XMultiServiceFactory>& rSMgr ); 45 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL 46 ScRecentFunctionsObj_CreateInstance( 47 const com::sun::star::uno::Reference< 48 com::sun::star::lang::XMultiServiceFactory>& rSMgr ); 49 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL 50 ScFunctionListObj_CreateInstance( 51 const com::sun::star::uno::Reference< 52 com::sun::star::lang::XMultiServiceFactory>& rSMgr ); 53 54 55 class ScSpreadsheetSettings : public cppu::WeakImplHelper2< 56 com::sun::star::beans::XPropertySet, 57 com::sun::star::lang::XServiceInfo> 58 { 59 private: 60 SfxItemPropertySet aPropSet; 61 62 public: 63 ScSpreadsheetSettings(); 64 virtual ~ScSpreadsheetSettings(); 65 66 static ::rtl::OUString getImplementationName_Static(); 67 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(); 68 69 // XPropertySet 70 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 71 SAL_CALL getPropertySetInfo(); 72 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 73 const ::com::sun::star::uno::Any& aValue ); 74 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 75 const ::rtl::OUString& PropertyName ); 76 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 77 const ::com::sun::star::uno::Reference< 78 ::com::sun::star::beans::XPropertyChangeListener >& xListener ); 79 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 80 const ::com::sun::star::uno::Reference< 81 ::com::sun::star::beans::XPropertyChangeListener >& aListener ); 82 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 83 const ::com::sun::star::uno::Reference< 84 ::com::sun::star::beans::XVetoableChangeListener >& aListener ); 85 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 86 const ::com::sun::star::uno::Reference< 87 ::com::sun::star::beans::XVetoableChangeListener >& aListener ); 88 89 // XServiceInfo 90 virtual ::rtl::OUString SAL_CALL getImplementationName(); 91 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); 92 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(); 93 }; 94 95 96 class ScRecentFunctionsObj : public cppu::WeakImplHelper2< 97 com::sun::star::sheet::XRecentFunctions, 98 com::sun::star::lang::XServiceInfo> 99 { 100 public: 101 ScRecentFunctionsObj(); 102 virtual ~ScRecentFunctionsObj(); 103 104 static ::rtl::OUString getImplementationName_Static(); 105 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(); 106 107 // XRecentFunctions 108 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds(); 109 virtual void SAL_CALL setRecentFunctionIds( const ::com::sun::star::uno::Sequence< 110 sal_Int32 >& aRecentFunctionIds ); 111 virtual sal_Int32 SAL_CALL getMaxRecentFunctions(); 112 113 // XServiceInfo 114 virtual ::rtl::OUString SAL_CALL getImplementationName(); 115 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); 116 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(); 117 }; 118 119 120 class ScFunctionListObj : public cppu::WeakImplHelper4< 121 com::sun::star::sheet::XFunctionDescriptions, 122 com::sun::star::container::XEnumerationAccess, 123 com::sun::star::container::XNameAccess, 124 com::sun::star::lang::XServiceInfo> 125 { 126 public: 127 ScFunctionListObj(); 128 virtual ~ScFunctionListObj(); 129 130 static ::rtl::OUString getImplementationName_Static(); 131 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(); 132 133 // XFunctionDescriptions 134 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL 135 getById( sal_Int32 nId ); 136 137 // XNameAccess 138 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ); 139 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(); 140 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ); 141 142 // XIndexAccess 143 virtual sal_Int32 SAL_CALL getCount(); 144 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ); 145 146 // XEnumerationAccess 147 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 148 createEnumeration(); 149 150 // XElementAccess 151 virtual ::com::sun::star::uno::Type SAL_CALL getElementType(); 152 virtual sal_Bool SAL_CALL hasElements(); 153 154 // XServiceInfo 155 virtual ::rtl::OUString SAL_CALL getImplementationName(); 156 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); 157 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(); 158 }; 159 160 161 162 #endif 163