Files
pilotclient/src/gui/enableforviewbasedindicator.h
2025-10-29 22:46:32 +01:00

49 lines
1.3 KiB
C++

// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
//! \file
#ifndef SWIFT_GUI_ENABLEFORVIEWBASEDINDICATOR_H
#define SWIFT_GUI_ENABLEFORVIEWBASEDINDICATOR_H
#include <chrono>
#include "gui/swiftguiexport.h"
namespace swift::gui::views
{
class CViewBaseNonTemplate;
}
namespace swift::gui
{
//! Hand over indication task to an embedded view
class SWIFT_GUI_EXPORT CEnableForViewBasedIndicator
{
public:
//! Enable loading indicator
void enableLoadIndicator(bool enable);
//! Showing load indicator?
bool isShowingLoadIndicator() const;
//! Show loading indicator
int showLoadIndicator(std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
//! Hide loading indicator
void hideLoadIndicator();
protected:
//! Constructor
CEnableForViewBasedIndicator(views::CViewBaseNonTemplate *viewWithIndicator = nullptr);
//! Set the corresponding view
void setViewWithIndicator(swift::gui::views::CViewBaseNonTemplate *viewWithIndicator);
private:
views::CViewBaseNonTemplate *m_viewWithIndicator = nullptr;
};
} // namespace swift::gui
#endif // SWIFT_GUI_ENABLEFORVIEWBASEDINDICATOR_H