Incidenceeditor

kweekdaycheckcombo.h
1/*
2 SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
3 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
4 SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <Libkdepim/KCheckComboBox>
12
13#include <QBitArray>
14#include <QDate>
15
16namespace IncidenceEditorNG
17{
18// FIXME: This class assumes all weeks have 7 days. We should use KCalenderSystem instead.
19/**
20 * A combobox that is populated with the days of the week from the current
21 * KCalenderSystem. The days are checkable.
22 * @note: KCalenderSystem numbers weekdays starting with 1, however this widget is 0 indexed and handles the conversion to the 1 based system internally. Use
23 * this widget as a normal 0 indexed container.
24 * @see KCalenderSystem
25 */
27{
29public:
30 /**
31 * @param first5Checked if true the first 5 weekdays will be checked by default
32 */
33 explicit KWeekdayCheckCombo(QWidget *parent = nullptr, bool first5Checked = false);
34 ~KWeekdayCheckCombo() override;
35
36 /**
37 * Retrieve the checked days
38 * @param days a 7 bit array indicating the checked days (bit 0 = Monday, value 1 = checked).
39 */
40 [[nodiscard]] QBitArray days() const;
41
42 /**
43 * Set the checked days on this combobox
44 * @param days a 7 bit array indicating the days to check/uncheck (bit 0 = Monday, value 1 = check).
45 * @param disableDays if not empty, the corresponding days will be disabled, all others enabled (bit 0 = Monday, value 1 = disable).
46 * @see days()
47 */
48 void setDays(const QBitArray &days, const QBitArray &disableDays = QBitArray());
49
50 /**
51 * Returns the index of the weekday represented by the
52 * QDate object.
53 */
54 [[nodiscard]] int weekdayIndex(const QDate &date) const;
55};
56}
A combobox that is populated with the days of the week from the current KCalenderSystem.
QBitArray days() const
Retrieve the checked days.
void setDays(const QBitArray &days, const QBitArray &disableDays=QBitArray())
Set the checked days on this combobox.
KWeekdayCheckCombo(QWidget *parent=nullptr, bool first5Checked=false)
int weekdayIndex(const QDate &date) const
Returns the index of the weekday represented by the QDate object.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.