2019-09-20 09:34:29 +03:00
|
|
|
/*
|
2020-04-06 23:05:24 +03:00
|
|
|
* Copyright 2020 Haiku, Inc. All rights reserved.
|
2019-09-20 09:34:29 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
2020-04-06 23:05:24 +03:00
|
|
|
* Niels Sascha Reedijk, niels.reedijk@gmail.com
|
|
|
|
*
|
|
|
|
* Reviewers:
|
|
|
|
* Adrien Destugues, pulkomandy@pulkomandy.tk
|
2019-09-20 09:34:29 +03:00
|
|
|
*
|
|
|
|
* Corresponds to:
|
|
|
|
* headers/os/interface/CardView.h hrev49943
|
|
|
|
* src/kits/interface/CardView.cpp hrev49977
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file CardView.h
|
|
|
|
\ingroup layout
|
2020-04-06 23:05:24 +03:00
|
|
|
\brief Provides the BCardView class.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BCardView
|
|
|
|
\ingroup layout
|
|
|
|
\ingroup libbe
|
2020-04-06 23:05:24 +03:00
|
|
|
\brief Container view for a stack of alternating child views.
|
|
|
|
|
|
|
|
This class is a convencience class, that creates a BView with a BCardLayout
|
|
|
|
set up by default.
|
|
|
|
|
|
|
|
The card container holds zero or more child views and organizes them like a
|
|
|
|
stack of cards. Each child view is a card, and only one card can be on top,
|
|
|
|
meaning that it is visible and available for interaction by the user. When
|
|
|
|
there are no cards, or no card is on top, then the system's default gray
|
|
|
|
background is displayed.
|
|
|
|
|
|
|
|
\see BCardLayout for more information on how and when to use this
|
|
|
|
type of container.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BCardView::BCardView()
|
2020-04-06 23:05:24 +03:00
|
|
|
\brief Creates a new card view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BCardView::BCardView(const char *name)
|
2020-04-06 23:05:24 +03:00
|
|
|
\brief Creates a new card view with the given \a name.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-06 23:05:24 +03:00
|
|
|
\param name The name for the card view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BCardView::BCardView(BMessage *from)
|
2020-04-18 09:27:42 +03:00
|
|
|
\brief Constructs a BCardView \a from an archive message.
|
|
|
|
|
|
|
|
This method is usually not called directly, if you want to build a
|
|
|
|
card view from an archived message you should call Instantiate() instead
|
|
|
|
because it can handle errors properly.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-06 23:05:24 +03:00
|
|
|
\param from The \ref BMessage that contains the card view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-06 23:05:24 +03:00
|
|
|
\fn virtual BCardView::~BCardView()
|
|
|
|
\brief Destructor
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-06 23:05:24 +03:00
|
|
|
\fn virtual void BCardView::SetLayout(BLayout *layout)
|
|
|
|
\brief Adopt a given card \a layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-06 23:05:24 +03:00
|
|
|
\param layout The layout to set to. This must be a BCardLayout, or a
|
|
|
|
derivative. Any other layout types will be ignored.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BCardLayout* BCardView::CardLayout() const
|
2020-04-06 23:05:24 +03:00
|
|
|
\brief Get a pointer to the underlying BCardLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-06 23:05:24 +03:00
|
|
|
\return A pointer to the underlying card layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-06 23:05:24 +03:00
|
|
|
\fn virtual status_t BCardView::Perform(perform_code d, void *arg)
|
|
|
|
\brief Perform some action. (Internal Method)
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-06 23:05:24 +03:00
|
|
|
Reimplemented from BView::Perform()
|
2019-09-20 09:34:29 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-06 23:05:24 +03:00
|
|
|
\fn static BArchivable* BCardView::Instantiate(BMessage *from)
|
|
|
|
\brief Instantiate the view from the message \a from.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|