/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_UNOAUTOPILOT_HXX #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_UNOAUTOPILOT_HXX #include #include #include #include "componentmodule.hxx" #include #include #include namespace dbp { typedef ::svt::OGenericUnoDialog OUnoAutoPilot_Base; template class OUnoAutoPilot :public OUnoAutoPilot_Base ,public ::comphelper::OPropertyArrayUsageHelper< OUnoAutoPilot< TYPE, SERVICEINFO > > ,public OModuleResourceClient { explicit OUnoAutoPilot(const css::uno::Reference< css::uno::XComponentContext >& _rxORB) : OUnoAutoPilot_Base(_rxORB) { } protected: css::uno::Reference< css::beans::XPropertySet > m_xObjectModel; public: // XTypeProvider virtual css::uno::Sequence SAL_CALL getImplementationId( ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return css::uno::Sequence(); } // XServiceInfo virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return getImplementationName_Static(); } virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return getSupportedServiceNames_Static(); } // XServiceInfo - static methods static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw( css::uno::RuntimeException ) { return SERVICEINFO::getServiceNames(); } static OUString getImplementationName_Static() throw( css::uno::RuntimeException ) { return SERVICEINFO::getImplementationName(); } static css::uno::Reference< css::uno::XInterface > SAL_CALL Create(const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxFactory) { return *(new OUnoAutoPilot( comphelper::getComponentContext(_rxFactory) )); } // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE { css::uno::Reference< css::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE { return *this->getArrayHelper(); } // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE { css::uno::Sequence< css::beans::Property > aProps; describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } protected: // OGenericUnoDialog overridables virtual VclPtr createDialog(vcl::Window* _pParent) SAL_OVERRIDE { return VclPtr::Create(_pParent, m_xObjectModel, m_aContext); } virtual void implInitialize(const css::uno::Any& _rValue) SAL_OVERRIDE { css::beans::PropertyValue aArgument; if (_rValue >>= aArgument) if (aArgument.Name == "ObjectModel") { aArgument.Value >>= m_xObjectModel; return; } OUnoAutoPilot_Base::implInitialize(_rValue); } }; } // namespace dbp #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_UNOAUTOPILOT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */