1 /* 2 * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef MESSAGE_PACKAGE_LISTENER_H 6 #define MESSAGE_PACKAGE_LISTENER_H 7 8 9 #include "PackageInfoListener.h" 10 11 12 enum { 13 MSG_UPDATE_PACKAGE = 'updp' 14 }; 15 16 class BHandler; 17 18 19 class MessagePackageListener : public PackageInfoListener { 20 public: 21 MessagePackageListener(BHandler* target); 22 virtual ~MessagePackageListener(); 23 24 virtual void PackageChanged(const PackageInfoEvent& event); 25 26 void SetChangesMask(uint32 mask); 27 28 private: 29 BHandler* fTarget; 30 uint32 fChangesMask; 31 }; 32 33 34 class OnePackageMessagePackageListener : public MessagePackageListener { 35 public: 36 OnePackageMessagePackageListener( 37 BHandler* target); 38 virtual ~OnePackageMessagePackageListener(); 39 40 void SetPackage(const PackageInfoRef& package); 41 const PackageInfoRef& Package() const; 42 43 private: 44 PackageInfoRef fPackage; 45 }; 46 47 48 #endif // MESSAGE_PACKAGE_LISTENER_H 49