1*34dd1e25SAndrew Rist /************************************************************** 2*34dd1e25SAndrew Rist * 3*34dd1e25SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*34dd1e25SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*34dd1e25SAndrew Rist * distributed with this work for additional information 6*34dd1e25SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*34dd1e25SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*34dd1e25SAndrew Rist * "License"); you may not use this file except in compliance 9*34dd1e25SAndrew Rist * with the License. You may obtain a copy of the License at 10*34dd1e25SAndrew Rist * 11*34dd1e25SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*34dd1e25SAndrew Rist * 13*34dd1e25SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*34dd1e25SAndrew Rist * software distributed under the License is distributed on an 15*34dd1e25SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*34dd1e25SAndrew Rist * KIND, either express or implied. See the License for the 17*34dd1e25SAndrew Rist * specific language governing permissions and limitations 18*34dd1e25SAndrew Rist * under the License. 19*34dd1e25SAndrew Rist * 20*34dd1e25SAndrew Rist *************************************************************/ 21*34dd1e25SAndrew Rist 22*34dd1e25SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir import com.sun.star.uno.*; 25cdf0e10cSrcweir import com.sun.star.beans.*; 26cdf0e10cSrcweir import com.sun.star.awt.*; 27cdf0e10cSrcweir import com.sun.star.container.*; 28cdf0e10cSrcweir import com.sun.star.form.*; 29cdf0e10cSrcweir import com.sun.star.lang.*; 30cdf0e10cSrcweir import com.sun.star.sdb.*; 31cdf0e10cSrcweir import com.sun.star.sdbcx.*; 32cdf0e10cSrcweir 33cdf0e10cSrcweir public class UNO 34cdf0e10cSrcweir { queryPropertySet( Object aObject )35cdf0e10cSrcweir public static XPropertySet queryPropertySet( Object aObject ) 36cdf0e10cSrcweir { 37cdf0e10cSrcweir return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, aObject ); 38cdf0e10cSrcweir } queryControlModel( Object aObject )39cdf0e10cSrcweir public static XControlModel queryControlModel( Object aObject ) 40cdf0e10cSrcweir { 41cdf0e10cSrcweir return (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aObject ); 42cdf0e10cSrcweir } queryIndexContainer( Object aObject )43cdf0e10cSrcweir public static XIndexContainer queryIndexContainer( Object aObject ) 44cdf0e10cSrcweir { 45cdf0e10cSrcweir return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, aObject ); 46cdf0e10cSrcweir } queryReset( Object aObject )47cdf0e10cSrcweir public static XReset queryReset( Object aObject ) 48cdf0e10cSrcweir { 49cdf0e10cSrcweir return (XReset)UnoRuntime.queryInterface( XReset.class, aObject ); 50cdf0e10cSrcweir } queryServiceInfo( Object aObject )51cdf0e10cSrcweir public static XServiceInfo queryServiceInfo( Object aObject ) 52cdf0e10cSrcweir { 53cdf0e10cSrcweir return (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, aObject ); 54cdf0e10cSrcweir } queryColumn( Object aObject )55cdf0e10cSrcweir public static XColumn queryColumn( Object aObject ) 56cdf0e10cSrcweir { 57cdf0e10cSrcweir return (XColumn)UnoRuntime.queryInterface( XColumn.class, aObject ); 58cdf0e10cSrcweir } 59cdf0e10cSrcweir queryComponent( Object aObject )60cdf0e10cSrcweir public static XComponent queryComponent( Object aObject ) 61cdf0e10cSrcweir { 62cdf0e10cSrcweir return (XComponent)UnoRuntime.queryInterface( XComponent.class, aObject ); 63cdf0e10cSrcweir } 64cdf0e10cSrcweir queryTablesSupplier( Object aObject )65cdf0e10cSrcweir public static XTablesSupplier queryTablesSupplier( Object aObject ) 66cdf0e10cSrcweir { 67cdf0e10cSrcweir return (XTablesSupplier)UnoRuntime.queryInterface( XTablesSupplier.class, aObject ); 68cdf0e10cSrcweir } 69cdf0e10cSrcweir 70cdf0e10cSrcweir /* replace Foo with the identifier of your choice. 71cdf0e10cSrcweir 72cdf0e10cSrcweir Why does Java not have templates? 73cdf0e10cSrcweir 74cdf0e10cSrcweir public static XFoo queryFoo( Object aObject ) 75cdf0e10cSrcweir { 76cdf0e10cSrcweir return (XFoo)UnoRuntime.queryInterface( XFoo.class, aObject ); 77cdf0e10cSrcweir } 78cdf0e10cSrcweir */ 79cdf0e10cSrcweir }; 80