1/* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 7 */ 8 9// This class provides some basic functionality for derivation of a 10// listener -> observer adapter. 11// The derived class should implement constructors similar to the 12// ones of this class and pass the respective parameter. 13// Each of the listener hook functions should construct a message 14// and let it be delivered by DeliverMessage(). 15 16#ifndef ABSTRACT_LO_ADAPTER_H 17#define ABSTRACT_LO_ADAPTER_H 18 19#include <SupportDefs.h> 20 21class BHandler; 22class BLooper; 23class BMessage; 24class BMessenger; 25 26class AbstractLOAdapter { 27 public: 28 AbstractLOAdapter(BHandler* handler); 29 AbstractLOAdapter(const BMessenger& messenger); 30 virtual ~AbstractLOAdapter(); 31 32 void DeliverMessage(BMessage* message); 33 void DeliverMessage(BMessage& message); 34 void DeliverMessage(uint32 command); 35 36 private: 37 BHandler* fHandler; 38 BMessenger* fMessenger; 39}; 40 41#endif // ABSTRACT_LO_ADAPTER_H 42