xref: /haiku/src/kits/interface/LayoutContext.cpp (revision 25a7b01d15612846f332751841da3579db313082)
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
BLayoutContextListener()10 BLayoutContextListener::BLayoutContextListener()
11 {
12 }
13 
14 // destructor
~BLayoutContextListener()15 BLayoutContextListener::~BLayoutContextListener()
16 {
17 }
18 
19 
_ReservedLayoutContextListener1()20 void BLayoutContextListener::_ReservedLayoutContextListener1() {}
_ReservedLayoutContextListener2()21 void BLayoutContextListener::_ReservedLayoutContextListener2() {}
_ReservedLayoutContextListener3()22 void BLayoutContextListener::_ReservedLayoutContextListener3() {}
_ReservedLayoutContextListener4()23 void BLayoutContextListener::_ReservedLayoutContextListener4() {}
_ReservedLayoutContextListener5()24 void BLayoutContextListener::_ReservedLayoutContextListener5() {}
25 
26 
27 // #pragma mark -
28 
29 
30 // constructor
BLayoutContext()31 BLayoutContext::BLayoutContext()
32 {
33 }
34 
35 // destructor
~BLayoutContext()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
AddListener(BLayoutContextListener * listener)49 BLayoutContext::AddListener(BLayoutContextListener* listener)
50 {
51 	if (listener)
52 		fListeners.AddItem(listener);
53 }
54 
55 // RemoveListener
56 void
RemoveListener(BLayoutContextListener * listener)57 BLayoutContext::RemoveListener(BLayoutContextListener* listener)
58 {
59 	if (listener)
60 		fListeners.RemoveItem(listener);
61 }
62