1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SFXHINTPOST_HXX 24 #define _SFXHINTPOST_HXX 25 26 #include <sfx2/genlink.hxx> 27 #include <tools/ref.hxx> 28 29 //=================================================================== 30 31 class SfxHint; 32 33 //------------------------------------------------------------------- 34 35 class SfxHintPoster: public SvRefBase 36 37 /* [Beschreibung] 38 39 Mit Instanzen dieser Klasse k"onnen eindeutige Events per PostUserEvent 40 "uber die StarView-Application verschickt werden. Wenn das User-Event 41 ausgel"ost wird, wird der Handler <Event()> gerufen, dessen 42 Basisimplementierung den mit <SetEventHdl()> angegbenen Link ruft. 43 44 Die Instanz wird via Ref-Count mindestens solange gehalten, wie 45 ein ggf. abgeschicktes Event noch nicht angekommen ist. Sollte das 46 Ziel vorher sterben, ist die Verbindung zuvor mit 'SetEventHdl(GenLink())' 47 zu kappen. 48 */ 49 50 { 51 sal_uIntPtr nId; 52 GenLink aLink; 53 54 private: 55 void RegisterEvent(); 56 //#if 0 // _SOLAR__PRIVATE 57 DECL_LINK( DoEvent_Impl, SfxHint * ); 58 //#endif 59 60 protected: 61 virtual ~SfxHintPoster(); 62 virtual void Event( SfxHint* pPostedHint ); 63 64 public: 65 SfxHintPoster(); 66 SfxHintPoster( const GenLink& rLink ); 67 68 void Post( SfxHint* pHint = 0 ); 69 void SetEventHdl( const GenLink& rLink ); 70 }; 71 72 //------------------------------------------------------------------- 73 74 SV_DECL_IMPL_REF(SfxHintPoster); 75 76 #endif 77