1 /* 2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 6 #include <LayoutContext.h> 7 8 9 // constructor 10 BLayoutContextListener::BLayoutContextListener() 11 { 12 } 13 14 // destructor 15 BLayoutContextListener::~BLayoutContextListener() 16 { 17 } 18 19 20 // #pragma mark - 21 22 23 // constructor 24 BLayoutContext::BLayoutContext() 25 { 26 } 27 28 // destructor 29 BLayoutContext::~BLayoutContext() 30 { 31 // notify the listeners 32 for (int32 i = 0; 33 BLayoutContextListener* listener 34 = (BLayoutContextListener*)fListeners.ItemAt(i); 35 i++) { 36 listener->LayoutContextLeft(this); 37 } 38 } 39 40 // AddListener 41 void 42 BLayoutContext::AddListener(BLayoutContextListener* listener) 43 { 44 if (listener) 45 fListeners.AddItem(listener); 46 } 47 48 // RemoveListener 49 void 50 BLayoutContext::RemoveListener(BLayoutContextListener* listener) 51 { 52 if (listener) 53 fListeners.RemoveItem(listener); 54 } 55