xref: /haiku/src/kits/interface/CardView.cpp (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
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 
11 BCardView::BCardView()
12 	:
13 	BView(NULL, 0, new BCardLayout())
14 {
15 	AdoptSystemColors();
16 }
17 
18 
19 BCardView::BCardView(const char* name)
20 	:
21 	BView(name, 0, new BCardLayout())
22 {
23 	AdoptSystemColors();
24 }
25 
26 
27 BCardView::BCardView(BMessage* from)
28 	:
29 	BView(from)
30 {
31 	AdoptSystemColors();
32 }
33 
34 
35 BCardView::~BCardView()
36 {
37 }
38 
39 
40 void
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*
51 BCardView::CardLayout() const
52 {
53 	return static_cast<BCardLayout*>(GetLayout());
54 }
55 
56 
57 BArchivable*
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
67 BCardView::Perform(perform_code d, void* arg)
68 {
69 	return BView::Perform(d, arg);
70 }
71 
72 
73 void BCardView::_ReservedCardView1() {}
74 void BCardView::_ReservedCardView2() {}
75 void BCardView::_ReservedCardView3() {}
76 void BCardView::_ReservedCardView4() {}
77 void BCardView::_ReservedCardView5() {}
78 void BCardView::_ReservedCardView6() {}
79 void BCardView::_ReservedCardView7() {}
80 void BCardView::_ReservedCardView8() {}
81 void BCardView::_ReservedCardView9() {}
82 void BCardView::_ReservedCardView10() {}
83