ladybird/Userland/Applications/Spreadsheet/ConditionalFormatting.h
Andreas Kling 8a48246ed1 Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00

58 lines
1.1 KiB
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "Forward.h"
#include <AK/DeprecatedString.h>
#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGfx/Color.h>
namespace Spreadsheet {
struct Format {
Optional<Color> foreground_color;
Optional<Color> background_color;
};
struct ConditionalFormat : public Format {
DeprecatedString condition;
};
enum class FormatType {
Background = 0,
Foreground = 1
};
class ConditionView : public GUI::Widget {
C_OBJECT(ConditionView)
public:
virtual ~ConditionView() override;
private:
ConditionView(ConditionalFormat&);
ConditionalFormat& m_format;
};
class ConditionsView : public GUI::Widget {
C_OBJECT(ConditionsView)
public:
virtual ~ConditionsView() override;
void set_formats(Vector<ConditionalFormat>*);
void add_format();
void remove_top();
private:
ConditionsView();
Vector<ConditionalFormat>* m_formats { nullptr };
Vector<NonnullRefPtr<GUI::Widget>> m_widgets;
};
}