bump product version to 4.1.6.2
[LibreOffice.git] / basctl / source / basicide / basidectrlr.cxx
blob855ad1ee3f6f937f1bdb819309bea4ebb8176fd1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "basidectrlr.hxx"
22 #include "basidesh.hxx"
24 #include <cppuhelper/queryinterface.hxx>
25 #include <comphelper/sequence.hxx>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
28 #include <vcl/syswin.hxx>
30 namespace basctl
33 using namespace com::sun::star;
34 using namespace com::sun::star::uno;
35 using namespace com::sun::star::beans;
37 namespace
40 int const nPropertyIconId = 1;
41 OUString const sPropertyIconId("IconId");
46 //----------------------------------------------------------------------------
48 Controller::Controller (Shell* pViewShell)
49 :OPropertyContainer( m_aBHelper )
50 ,SfxBaseController( pViewShell )
51 ,m_nIconId( ICON_MACROLIBRARY )
53 registerProperty(
54 sPropertyIconId, nPropertyIconId,
55 PropertyAttribute::READONLY,
56 &m_nIconId, getCppuType(&m_nIconId)
60 //----------------------------------------------------------------------------
62 Controller::~Controller()
63 { }
65 // XInterface
66 //----------------------------------------------------------------------------
68 Any SAL_CALL Controller::queryInterface( const Type & rType ) throw(RuntimeException)
70 Any aReturn = SfxBaseController::queryInterface( rType );
71 if ( !aReturn.hasValue() )
72 aReturn = OPropertyContainer::queryInterface( rType );
74 return aReturn;
77 //----------------------------------------------------------------------------
79 void SAL_CALL Controller::acquire() throw()
81 SfxBaseController::acquire();
84 //----------------------------------------------------------------------------
86 void SAL_CALL Controller::release() throw()
88 SfxBaseController::release();
92 // XTypeProvider ( ::SfxBaseController )
93 //----------------------------------------------------------------------------
95 Sequence< Type > SAL_CALL Controller::getTypes() throw(RuntimeException)
97 Sequence< Type > aTypes = ::comphelper::concatSequences(
98 SfxBaseController::getTypes(),
99 OPropertyContainer::getTypes()
102 return aTypes;
105 //----------------------------------------------------------------------------
107 Sequence< sal_Int8 > SAL_CALL Controller::getImplementationId() throw(RuntimeException)
109 static ::cppu::OImplementationId * pId = 0;
110 if ( !pId )
112 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
113 if ( !pId )
115 static ::cppu::OImplementationId aId;
116 pId = &aId;
119 return pId->getImplementationId();
122 // XPropertySet
123 //----------------------------------------------------------------------------
125 Reference< beans::XPropertySetInfo > SAL_CALL Controller::getPropertySetInfo() throw(RuntimeException)
127 Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
128 return xInfo;
131 // OPropertySetHelper
132 //----------------------------------------------------------------------------
134 ::cppu::IPropertyArrayHelper& Controller::getInfoHelper()
136 return *getArrayHelper();
139 // OPropertyArrayUsageHelper
140 //----------------------------------------------------------------------------
142 ::cppu::IPropertyArrayHelper* Controller::createArrayHelper( ) const
144 Sequence< Property > aProps;
145 describeProperties( aProps );
146 return new ::cppu::OPropertyArrayHelper( aProps );
149 //----------------------------------------------------------------------------
151 } // namespace basctl
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */