LibreOffice
LibreOffice 24.8 SDK C/C++ API Reference
 
Loading...
Searching...
No Matches
compbase_ex.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23#ifndef INCLUDED_CPPUHELPER_COMPBASE_EX_HXX
24#define INCLUDED_CPPUHELPER_COMPBASE_EX_HXX
25
27#include "com/sun/star/lang/XComponent.hpp"
29#include "cppuhelper/weak.hxx"
31
33
34namespace osl { class Mutex; }
35namespace cppu { struct class_data; }
36
37namespace cppu
38{
39
43class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakComponentImplHelperBase
44 : public ::cppu::OWeakObject
45 , public css::lang::XComponent
46{
47protected:
51
54 virtual void SAL_CALL disposing();
55
60 WeakComponentImplHelperBase( ::osl::Mutex & rMutex );
61public:
64 virtual ~WeakComponentImplHelperBase() SAL_OVERRIDE;
65
66 // these are here to force memory de/allocation to sal lib.
67 static void * SAL_CALL operator new( size_t nSize )
68 { return ::rtl_allocateMemory( nSize ); }
69 static void SAL_CALL operator delete( void * pMem )
70 { ::rtl_freeMemory( pMem ); }
71 static void * SAL_CALL operator new( size_t, void * pMem )
72 { return pMem; }
73 static void SAL_CALL operator delete( void *, void * )
74 {}
75
76 virtual css::uno::Any SAL_CALL queryInterface(
77 css::uno::Type const & rType ) SAL_OVERRIDE;
78 virtual void SAL_CALL acquire()
80 virtual void SAL_CALL release()
82 virtual void SAL_CALL dispose() SAL_OVERRIDE;
83 virtual void SAL_CALL addEventListener(
84 css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
85 virtual void SAL_CALL removeEventListener(
86 css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
87};
88
92class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakAggComponentImplHelperBase
93 : public ::cppu::OWeakAggObject
94 , public css::lang::XComponent
95{
96protected:
98
101 virtual void SAL_CALL disposing();
102
103 WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex );
104public:
105 virtual ~WeakAggComponentImplHelperBase() SAL_OVERRIDE;
106
107 // these are here to force memory de/allocation to sal lib.
108 static void * SAL_CALL operator new( size_t nSize )
109 { return ::rtl_allocateMemory( nSize ); }
110 static void SAL_CALL operator delete( void * pMem )
111 { ::rtl_freeMemory( pMem ); }
112 static void * SAL_CALL operator new( size_t, void * pMem )
113 { return pMem; }
114 static void SAL_CALL operator delete( void *, void * )
115 {}
116
117 virtual css::uno::Any SAL_CALL queryInterface(
118 css::uno::Type const & rType ) SAL_OVERRIDE;
119 virtual css::uno::Any SAL_CALL queryAggregation(
120 css::uno::Type const & rType ) SAL_OVERRIDE;
121 virtual void SAL_CALL acquire()
123 virtual void SAL_CALL release()
125 virtual void SAL_CALL dispose() SAL_OVERRIDE;
126 virtual void SAL_CALL addEventListener(
127 css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
128 virtual void SAL_CALL removeEventListener(
129 css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
130};
131
134CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL WeakComponentImplHelper_query(
135 css::uno::Type const & rType,
136 class_data * cd,
137 void * that,
138 ::cppu::WeakComponentImplHelperBase * pBase );
141CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes(
142 class_data * cd );
143
146CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg(
147 css::uno::Type const & rType,
148 class_data * cd,
149 void * that,
150 ::cppu::WeakAggComponentImplHelperBase * pBase );
153CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes(
154 class_data * cd );
155
156}
157
159
160#endif
161
162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SAL_NOEXCEPT
Macro for C++11 "noexcept" vs.
Definition types.h:434
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition types.h:312
#define SAL_OVERRIDE
C++11 "override" feature.
Definition types.h:409
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
#define CPPUHELPER_DLLPUBLIC
Definition cppuhelperdllapi.h:32
Definition condition.hxx:31
Definition Enterable.hxx:31
OBroadcastHelperVar< OMultiTypeInterfaceContainerHelper, OMultiTypeInterfaceContainerHelper::keyType > OBroadcastHelper
Definition interfacecontainer.h:608
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition queryinterface.hxx:43
A mutual exclusion synchronization object.
Definition mutex.hxx:35