xref: /trunk/main/sfx2/source/notify/hintpost.cxx (revision d119d52d)
1*d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d119d52dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d119d52dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d119d52dSAndrew Rist  * distributed with this work for additional information
6*d119d52dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d119d52dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d119d52dSAndrew Rist  * "License"); you may not use this file except in compliance
9*d119d52dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d119d52dSAndrew Rist  *
11*d119d52dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d119d52dSAndrew Rist  *
13*d119d52dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d119d52dSAndrew Rist  * software distributed under the License is distributed on an
15*d119d52dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d119d52dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d119d52dSAndrew Rist  * specific language governing permissions and limitations
18*d119d52dSAndrew Rist  * under the License.
19*d119d52dSAndrew Rist  *
20*d119d52dSAndrew Rist  *************************************************************/
21*d119d52dSAndrew Rist 
22*d119d52dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef GCC
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "arrdecl.hxx"
31cdf0e10cSrcweir #include <sfx2/hintpost.hxx>
32cdf0e10cSrcweir #include <sfx2/app.hxx>
33cdf0e10cSrcweir #include "sfxtypes.hxx"
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //====================================================================
36cdf0e10cSrcweir 
RegisterEvent()37cdf0e10cSrcweir void SfxHintPoster::RegisterEvent()
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 	DBG_MEMTEST();
40cdf0e10cSrcweir }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //--------------------------------------------------------------------
43cdf0e10cSrcweir 
SfxHintPoster()44cdf0e10cSrcweir SfxHintPoster::SfxHintPoster()
45cdf0e10cSrcweir {
46cdf0e10cSrcweir 	RegisterEvent();
47cdf0e10cSrcweir }
48cdf0e10cSrcweir 
49cdf0e10cSrcweir //--------------------------------------------------------------------
50cdf0e10cSrcweir 
SfxHintPoster(const GenLink & rLink)51cdf0e10cSrcweir SfxHintPoster::SfxHintPoster( const GenLink& rLink ):
52cdf0e10cSrcweir 	aLink(rLink)
53cdf0e10cSrcweir {
54cdf0e10cSrcweir }
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 
57cdf0e10cSrcweir //--------------------------------------------------------------------
58cdf0e10cSrcweir 
~SfxHintPoster()59cdf0e10cSrcweir SfxHintPoster::~SfxHintPoster()
60cdf0e10cSrcweir {
61cdf0e10cSrcweir }
62cdf0e10cSrcweir 
63cdf0e10cSrcweir //--------------------------------------------------------------------
64cdf0e10cSrcweir 
Post(SfxHint * pHintToPost)65cdf0e10cSrcweir void SfxHintPoster::Post( SfxHint* pHintToPost )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     GetpApp()->PostUserEvent( ( LINK(this, SfxHintPoster, DoEvent_Impl) ), pHintToPost );
68cdf0e10cSrcweir 	AddRef();
69cdf0e10cSrcweir }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir //--------------------------------------------------------------------
72cdf0e10cSrcweir 
IMPL_LINK_INLINE_START(SfxHintPoster,DoEvent_Impl,SfxHint *,pPostedHint)73cdf0e10cSrcweir IMPL_LINK_INLINE_START( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	DBG_MEMTEST();
76cdf0e10cSrcweir 	Event( pPostedHint );
77cdf0e10cSrcweir 	ReleaseRef();
78cdf0e10cSrcweir 	return 0;
79cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(SfxHintPoster,DoEvent_Impl,SfxHint *,pPostedHint)80cdf0e10cSrcweir IMPL_LINK_INLINE_END( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
81cdf0e10cSrcweir 
82cdf0e10cSrcweir //--------------------------------------------------------------------
83cdf0e10cSrcweir 
84cdf0e10cSrcweir void SfxHintPoster::Event( SfxHint* pPostedHint )
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	aLink.Call( pPostedHint );
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir //--------------------------------------------------------------------
90cdf0e10cSrcweir 
SetEventHdl(const GenLink & rLink)91cdf0e10cSrcweir void SfxHintPoster::SetEventHdl( const GenLink& rLink )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir 	DBG_MEMTEST();
94cdf0e10cSrcweir 	aLink = rLink;
95cdf0e10cSrcweir }
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 
98cdf0e10cSrcweir #define LOG( x )
99cdf0e10cSrcweir #if 0
100cdf0e10cSrcweir #define LOG( x )												\
101cdf0e10cSrcweir {																\
102cdf0e10cSrcweir 	SvFileStream aStrm( "f:\\temp\\log", STREAM_READWRITE );	\
103cdf0e10cSrcweir 	aStrm.Seek( STREAM_SEEK_TO_END );							\
104cdf0e10cSrcweir 	aStrm << x.GetStr() << '\n';								\
105cdf0e10cSrcweir }
106cdf0e10cSrcweir #endif
107