xref: /haiku/docs/user/interface/CardView.dox (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1/*
2 * Copyright 2020 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Niels Sascha Reedijk, niels.reedijk@gmail.com
7 *
8 * Reviewers:
9 * 		Adrien Destugues, pulkomandy@pulkomandy.tk
10 *
11 * Corresponds to:
12 *		headers/os/interface/CardView.h	hrev49943
13 *		src/kits/interface/CardView.cpp	hrev49977
14 */
15
16
17/*!
18	\file CardView.h
19	\ingroup layout
20	\brief Provides the BCardView class.
21
22	\since Haiku R1
23*/
24
25
26/*!
27	\class BCardView
28	\ingroup layout
29	\ingroup libbe
30	\brief Container view for a stack of alternating child views.
31
32	This class is a convencience class, that creates a BView with a BCardLayout
33	set up by default.
34
35	The card container holds zero or more child views and organizes them like a
36	stack of cards. Each child view is a card, and only one card can be on top,
37	meaning that it is visible and available for interaction by the user. When
38	there are no cards, or no card is on top, then the system's default gray
39	background is displayed.
40
41	\see BCardLayout for more information on how and when to use this
42		type of container.
43
44	\since Haiku R1
45*/
46
47
48/*!
49	\fn BCardView::BCardView()
50	\brief Creates a new card view.
51
52	\since Haiku R1
53*/
54
55
56/*!
57	\fn BCardView::BCardView(const char *name)
58	\brief Creates a new card view with the given \a name.
59
60	\param name The name for the card view.
61
62	\since Haiku R1
63*/
64
65
66/*!
67	\fn BCardView::BCardView(BMessage *from)
68	\brief Constructs a BCardView \a from an archive message.
69
70	This method is usually not called directly, if you want to build a
71	card view from an archived message you should call Instantiate() instead
72	because it can handle errors properly.
73
74	\param from The \ref BMessage that contains the card view.
75
76	\since Haiku R1
77*/
78
79
80/*!
81	\fn virtual BCardView::~BCardView()
82	\brief Destructor
83
84	\since Haiku R1
85*/
86
87
88/*!
89	\fn virtual void BCardView::SetLayout(BLayout *layout)
90	\brief Adopt a given card \a layout.
91
92	\param layout The layout to set to. This must be a BCardLayout, or a
93		derivative. Any other layout types will be ignored.
94
95	\since Haiku R1
96*/
97
98
99/*!
100	\fn BCardLayout* BCardView::CardLayout() const
101	\brief Get a pointer to the underlying BCardLayout.
102
103	\return A pointer to the underlying card layout.
104
105	\since Haiku R1
106*/
107
108
109/*!
110	\fn virtual status_t BCardView::Perform(perform_code d, void *arg)
111	\brief Perform some action. (Internal Method)
112
113	Reimplemented from BView::Perform()
114*/
115
116
117/*!
118	\fn static BArchivable* BCardView::Instantiate(BMessage *from)
119	\brief Instantiate the view from the message \a from.
120
121	\since Haiku R1
122*/
123