xref: /aoo41x/main/sfx2/source/notify/hintpost.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sfx2.hxx"
30 
31 #ifndef GCC
32 #endif
33 
34 #include "arrdecl.hxx"
35 #include <sfx2/hintpost.hxx>
36 #include <sfx2/app.hxx>
37 #include "sfxtypes.hxx"
38 
39 //====================================================================
40 
41 void SfxHintPoster::RegisterEvent()
42 {
43 	DBG_MEMTEST();
44 }
45 
46 //--------------------------------------------------------------------
47 
48 SfxHintPoster::SfxHintPoster()
49 {
50 	RegisterEvent();
51 }
52 
53 //--------------------------------------------------------------------
54 
55 SfxHintPoster::SfxHintPoster( const GenLink& rLink ):
56 	aLink(rLink)
57 {
58 }
59 
60 
61 //--------------------------------------------------------------------
62 
63 SfxHintPoster::~SfxHintPoster()
64 {
65 }
66 
67 //--------------------------------------------------------------------
68 
69 void SfxHintPoster::Post( SfxHint* pHintToPost )
70 {
71     GetpApp()->PostUserEvent( ( LINK(this, SfxHintPoster, DoEvent_Impl) ), pHintToPost );
72 	AddRef();
73 }
74 
75 //--------------------------------------------------------------------
76 
77 IMPL_LINK_INLINE_START( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
78 {
79 	DBG_MEMTEST();
80 	Event( pPostedHint );
81 	ReleaseRef();
82 	return 0;
83 }
84 IMPL_LINK_INLINE_END( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
85 
86 //--------------------------------------------------------------------
87 
88 void SfxHintPoster::Event( SfxHint* pPostedHint )
89 {
90 	aLink.Call( pPostedHint );
91 }
92 
93 //--------------------------------------------------------------------
94 
95 void SfxHintPoster::SetEventHdl( const GenLink& rLink )
96 {
97 	DBG_MEMTEST();
98 	aLink = rLink;
99 }
100 
101 
102 #define LOG( x )
103 #if 0
104 #define LOG( x )												\
105 {																\
106 	SvFileStream aStrm( "f:\\temp\\log", STREAM_READWRITE );	\
107 	aStrm.Seek( STREAM_SEEK_TO_END );							\
108 	aStrm << x.GetStr() << '\n';								\
109 }
110 #endif
111