xref: /haiku/src/kits/interface/CardView.cpp (revision bab64f65bb775dc23060e276f1f1c4498ab7af6c)
1 /*
2  * Copyright 2015, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  */
5 
6 
7 #include <CardLayout.h>
8 #include <CardView.h>
9 
10 
BCardView()11 BCardView::BCardView()
12 	:
13 	BView(NULL, 0, new BCardLayout())
14 {
15 	AdoptSystemColors();
16 }
17 
18 
BCardView(const char * name)19 BCardView::BCardView(const char* name)
20 	:
21 	BView(name, 0, new BCardLayout())
22 {
23 	AdoptSystemColors();
24 }
25 
26 
BCardView(BMessage * from)27 BCardView::BCardView(BMessage* from)
28 	:
29 	BView(from)
30 {
31 	AdoptSystemColors();
32 }
33 
34 
~BCardView()35 BCardView::~BCardView()
36 {
37 }
38 
39 
40 void
SetLayout(BLayout * layout)41 BCardView::SetLayout(BLayout* layout)
42 {
43 	if (dynamic_cast<BCardLayout*>(layout) == NULL)
44 		return;
45 
46 	BView::SetLayout(layout);
47 }
48 
49 
50 BCardLayout*
CardLayout() const51 BCardView::CardLayout() const
52 {
53 	return static_cast<BCardLayout*>(GetLayout());
54 }
55 
56 
57 BArchivable*
Instantiate(BMessage * from)58 BCardView::Instantiate(BMessage* from)
59 {
60 	if (validate_instantiation(from, "BCardView"))
61 		return new BCardView(from);
62 	return NULL;
63 }
64 
65 
66 status_t
Perform(perform_code d,void * arg)67 BCardView::Perform(perform_code d, void* arg)
68 {
69 	return BView::Perform(d, arg);
70 }
71 
72 
_ReservedCardView1()73 void BCardView::_ReservedCardView1() {}
_ReservedCardView2()74 void BCardView::_ReservedCardView2() {}
_ReservedCardView3()75 void BCardView::_ReservedCardView3() {}
_ReservedCardView4()76 void BCardView::_ReservedCardView4() {}
_ReservedCardView5()77 void BCardView::_ReservedCardView5() {}
_ReservedCardView6()78 void BCardView::_ReservedCardView6() {}
_ReservedCardView7()79 void BCardView::_ReservedCardView7() {}
_ReservedCardView8()80 void BCardView::_ReservedCardView8() {}
_ReservedCardView9()81 void BCardView::_ReservedCardView9() {}
_ReservedCardView10()82 void BCardView::_ReservedCardView10() {}
83