xref: /haiku/src/kits/interface/LayoutContext.cpp (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
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 void BLayoutContextListener::_ReservedLayoutContextListener1() {}
21 void BLayoutContextListener::_ReservedLayoutContextListener2() {}
22 void BLayoutContextListener::_ReservedLayoutContextListener3() {}
23 void BLayoutContextListener::_ReservedLayoutContextListener4() {}
24 void BLayoutContextListener::_ReservedLayoutContextListener5() {}
25 
26 
27 // #pragma mark -
28 
29 
30 // constructor
31 BLayoutContext::BLayoutContext()
32 {
33 }
34 
35 // destructor
36 BLayoutContext::~BLayoutContext()
37 {
38 	// notify the listeners
39 	for (int32 i = 0;
40 		 BLayoutContextListener* listener
41 		 	= (BLayoutContextListener*)fListeners.ItemAt(i);
42 		 i++) {
43 		listener->LayoutContextLeft(this);
44 	}
45 }
46 
47 // AddListener
48 void
49 BLayoutContext::AddListener(BLayoutContextListener* listener)
50 {
51 	if (listener)
52 		fListeners.AddItem(listener);
53 }
54 
55 // RemoveListener
56 void
57 BLayoutContext::RemoveListener(BLayoutContextListener* listener)
58 {
59 	if (listener)
60 		fListeners.RemoveItem(listener);
61 }
62