Eventviews

timelabelszone.h
1/*
2 SPDX-FileCopyrightText: 2007 Bruno Virlet <bruno@virlet.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
5*/
6#pragma once
7
8#include <QWidget>
9
10class QHBoxLayout;
11class QScrollArea;
12class QTimeZone;
13
14namespace EventViews
15{
16class Agenda;
17class AgendaView;
18
19class Prefs;
20using PrefsPtr = QSharedPointer<Prefs>;
21
22class TimeLabelsZone : public QWidget
23{
25public:
26 explicit TimeLabelsZone(QWidget *parent, const PrefsPtr &preferences, Agenda *agenda = nullptr);
27
28 /** Add a new time label with the given time zone.
29 If @p zone is not valid, use the display time zone.
30 */
31 void addTimeLabels(const QTimeZone &zone);
32
33 /**
34 Returns the best width for each TimeLabels widget
35 */
36 [[nodiscard]] int preferedTimeLabelsWidth() const;
37
38 void updateAll();
39 void reset();
40 void init();
41 void setAgendaView(AgendaView *agenda);
42
43 [[nodiscard]] QList<QScrollArea *> timeLabels() const;
44
45 void setPreferences(const PrefsPtr &prefs);
46 [[nodiscard]] PrefsPtr preferences() const;
47
48 /** Checks how much agenda is scrolled relative to it's QScrollArea
49 and makes each TimeLabels scroll that amount
50 */
51 void updateTimeLabelsPosition();
52
53private:
54 void setupTimeLabel(QScrollArea *area);
55 Agenda *mAgenda = nullptr;
56 PrefsPtr mPrefs;
57 AgendaView *mParent = nullptr;
58
59 QHBoxLayout *mTimeLabelsLayout = nullptr;
60 QList<QScrollArea *> mTimeLabelsList;
61};
62}
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.