1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <classes/actiontriggercontainer.hxx>
21 #include <classes/actiontriggerpropertyset.hxx>
22 #include <classes/actiontriggerseparatorpropertyset.hxx>
23 #include <cppuhelper/queryinterface.hxx>
24 #include <cppuhelper/supportsservice.hxx>
25 #include <cppuhelper/typeprovider.hxx>
28 using namespace com::sun::star::uno
;
29 using namespace com::sun::star::lang
;
30 using namespace com::sun::star::container
;
35 ActionTriggerContainer::ActionTriggerContainer() :
36 PropertySetContainer()
40 ActionTriggerContainer::~ActionTriggerContainer()
45 Any SAL_CALL
ActionTriggerContainer::queryInterface( const Type
& aType
)
47 Any a
= ::cppu::queryInterface(
49 static_cast< XMultiServiceFactory
* >(this),
50 static_cast< XServiceInfo
* >(this),
51 static_cast< XTypeProvider
* >(this));
58 return PropertySetContainer::queryInterface( aType
);
61 void ActionTriggerContainer::acquire() throw()
63 PropertySetContainer::acquire();
66 void ActionTriggerContainer::release() throw()
68 PropertySetContainer::release();
71 // XMultiServiceFactory
72 Reference
< XInterface
> SAL_CALL
ActionTriggerContainer::createInstance( const OUString
& aServiceSpecifier
)
74 if ( aServiceSpecifier
== SERVICENAME_ACTIONTRIGGER
)
75 return static_cast<OWeakObject
*>( new ActionTriggerPropertySet());
76 else if ( aServiceSpecifier
== SERVICENAME_ACTIONTRIGGERCONTAINER
)
77 return static_cast<OWeakObject
*>( new ActionTriggerContainer());
78 else if ( aServiceSpecifier
== SERVICENAME_ACTIONTRIGGERSEPARATOR
)
79 return static_cast<OWeakObject
*>( new ActionTriggerSeparatorPropertySet());
81 throw css::uno::RuntimeException("Unknown service specifier!", static_cast<OWeakObject
*>(this) );
84 Reference
< XInterface
> SAL_CALL
ActionTriggerContainer::createInstanceWithArguments( const OUString
& ServiceSpecifier
, const Sequence
< Any
>& /*Arguments*/ )
86 return createInstance( ServiceSpecifier
);
89 Sequence
< OUString
> SAL_CALL
ActionTriggerContainer::getAvailableServiceNames()
91 Sequence
< OUString
> aSeq( 3 );
93 aSeq
[0] = SERVICENAME_ACTIONTRIGGER
;
94 aSeq
[1] = SERVICENAME_ACTIONTRIGGERCONTAINER
;
95 aSeq
[2] = SERVICENAME_ACTIONTRIGGERSEPARATOR
;
101 OUString SAL_CALL
ActionTriggerContainer::getImplementationName()
103 return IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER
;
106 sal_Bool SAL_CALL
ActionTriggerContainer::supportsService( const OUString
& ServiceName
)
108 return cppu::supportsService(this, ServiceName
);
111 Sequence
< OUString
> SAL_CALL
ActionTriggerContainer::getSupportedServiceNames()
113 Sequence
< OUString
> seqServiceNames
{ SERVICENAME_ACTIONTRIGGERCONTAINER
};
114 return seqServiceNames
;
118 Sequence
< Type
> SAL_CALL
ActionTriggerContainer::getTypes()
120 // Create a static typecollection ...
121 static ::cppu::OTypeCollection
ourTypeCollection(
122 cppu::UnoType
<XMultiServiceFactory
>::get(),
123 cppu::UnoType
<XIndexContainer
>::get(),
124 cppu::UnoType
<XServiceInfo
>::get(),
125 cppu::UnoType
<XTypeProvider
>::get());
127 return ourTypeCollection
.getTypes();
130 Sequence
< sal_Int8
> SAL_CALL
ActionTriggerContainer::getImplementationId()
132 return css::uno::Sequence
<sal_Int8
>();
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */