1*31598a22SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*31598a22SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*31598a22SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*31598a22SAndrew Rist  * distributed with this work for additional information
6*31598a22SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*31598a22SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*31598a22SAndrew Rist  * "License"); you may not use this file except in compliance
9*31598a22SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*31598a22SAndrew Rist  *
11*31598a22SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*31598a22SAndrew Rist  *
13*31598a22SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*31598a22SAndrew Rist  * software distributed under the License is distributed on an
15*31598a22SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*31598a22SAndrew Rist  * KIND, either express or implied.  See the License for the
17*31598a22SAndrew Rist  * specific language governing permissions and limitations
18*31598a22SAndrew Rist  * under the License.
19*31598a22SAndrew Rist  *
20*31598a22SAndrew Rist  *************************************************************/
21*31598a22SAndrew Rist 
22*31598a22SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_basctl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _BASCTL_BASIDECTRLR_HXX_
28cdf0e10cSrcweir #include <basidectrlr.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include <cppuhelper/queryinterface.hxx>
31cdf0e10cSrcweir #include <comphelper/sequence.hxx>
32cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include <vcl/syswin.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <basidesh.hxx>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
39cdf0e10cSrcweir using namespace com::sun::star;
40cdf0e10cSrcweir using namespace com::sun::star::uno;
41cdf0e10cSrcweir using namespace com::sun::star::beans;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #define PROPERTY_ID_ICONID      1
45cdf0e10cSrcweir #define PROPERTY_ICONID         ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IconId" ) )
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //----------------------------------------------------------------------------
49cdf0e10cSrcweir 
BasicIDEController(BasicIDEShell * pViewShell)50cdf0e10cSrcweir BasicIDEController::BasicIDEController( BasicIDEShell* pViewShell )
51cdf0e10cSrcweir 	:OPropertyContainer( m_aBHelper )
52cdf0e10cSrcweir 	,SfxBaseController( pViewShell )
53cdf0e10cSrcweir     ,m_nIconId( ICON_MACROLIBRARY )
54cdf0e10cSrcweir {
55cdf0e10cSrcweir 	registerProperty( PROPERTY_ICONID, PROPERTY_ID_ICONID, PropertyAttribute::READONLY, &m_nIconId, ::getCppuType( &m_nIconId ) );
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir //----------------------------------------------------------------------------
59cdf0e10cSrcweir 
~BasicIDEController()60cdf0e10cSrcweir BasicIDEController::~BasicIDEController()
61cdf0e10cSrcweir {
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir // XInterface
65cdf0e10cSrcweir //----------------------------------------------------------------------------
66cdf0e10cSrcweir 
queryInterface(const Type & rType)67cdf0e10cSrcweir Any SAL_CALL BasicIDEController::queryInterface( const Type & rType ) throw(RuntimeException)
68cdf0e10cSrcweir {
69cdf0e10cSrcweir     Any aReturn = SfxBaseController::queryInterface( rType );
70cdf0e10cSrcweir     if ( !aReturn.hasValue() )
71cdf0e10cSrcweir 		aReturn = OPropertyContainer::queryInterface( rType );
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     return aReturn;
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir //----------------------------------------------------------------------------
77cdf0e10cSrcweir 
acquire()78cdf0e10cSrcweir void SAL_CALL BasicIDEController::acquire() throw()
79cdf0e10cSrcweir {
80cdf0e10cSrcweir 	SfxBaseController::acquire();
81cdf0e10cSrcweir }
82cdf0e10cSrcweir 
83cdf0e10cSrcweir //----------------------------------------------------------------------------
84cdf0e10cSrcweir 
release()85cdf0e10cSrcweir void SAL_CALL BasicIDEController::release() throw()
86cdf0e10cSrcweir {
87cdf0e10cSrcweir 	SfxBaseController::release();
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
91cdf0e10cSrcweir // XTypeProvider ( ::SfxBaseController )
92cdf0e10cSrcweir //----------------------------------------------------------------------------
93cdf0e10cSrcweir 
getTypes()94cdf0e10cSrcweir Sequence< Type > SAL_CALL BasicIDEController::getTypes() throw(RuntimeException)
95cdf0e10cSrcweir {
96cdf0e10cSrcweir     Sequence< Type > aTypes = ::comphelper::concatSequences(
97cdf0e10cSrcweir 		SfxBaseController::getTypes(),
98cdf0e10cSrcweir 		OPropertyContainer::getTypes()
99cdf0e10cSrcweir         );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	return aTypes;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir //----------------------------------------------------------------------------
105cdf0e10cSrcweir 
getImplementationId()106cdf0e10cSrcweir Sequence< sal_Int8 > SAL_CALL BasicIDEController::getImplementationId() throw(RuntimeException)
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	static ::cppu::OImplementationId * pId = 0;
109cdf0e10cSrcweir 	if ( !pId )
110cdf0e10cSrcweir 	{
111cdf0e10cSrcweir 		::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
112cdf0e10cSrcweir 		if ( !pId )
113cdf0e10cSrcweir 		{
114cdf0e10cSrcweir 			static ::cppu::OImplementationId aId;
115cdf0e10cSrcweir 			pId = &aId;
116cdf0e10cSrcweir 		}
117cdf0e10cSrcweir 	}
118cdf0e10cSrcweir 	return pId->getImplementationId();
119cdf0e10cSrcweir }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir // XPropertySet
122cdf0e10cSrcweir //----------------------------------------------------------------------------
123cdf0e10cSrcweir 
getPropertySetInfo()124cdf0e10cSrcweir Reference< beans::XPropertySetInfo > SAL_CALL BasicIDEController::getPropertySetInfo() throw(RuntimeException)
125cdf0e10cSrcweir {
126cdf0e10cSrcweir 	Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
127cdf0e10cSrcweir 	return xInfo;
128cdf0e10cSrcweir }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir // OPropertySetHelper
131cdf0e10cSrcweir //----------------------------------------------------------------------------
132cdf0e10cSrcweir 
getInfoHelper()133cdf0e10cSrcweir ::cppu::IPropertyArrayHelper& BasicIDEController::getInfoHelper()
134cdf0e10cSrcweir {
135cdf0e10cSrcweir 	return *getArrayHelper();
136cdf0e10cSrcweir }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir // OPropertyArrayUsageHelper
139cdf0e10cSrcweir //----------------------------------------------------------------------------
140cdf0e10cSrcweir 
createArrayHelper() const141cdf0e10cSrcweir ::cppu::IPropertyArrayHelper* BasicIDEController::createArrayHelper( ) const
142cdf0e10cSrcweir {
143cdf0e10cSrcweir     Sequence< Property > aProps;
144cdf0e10cSrcweir 	describeProperties( aProps );
145cdf0e10cSrcweir     return new ::cppu::OPropertyArrayHelper( aProps );
146cdf0e10cSrcweir }
147cdf0e10cSrcweir 
148cdf0e10cSrcweir //----------------------------------------------------------------------------
149