Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_menu_struct.h
T
torstenandCopilot d5af8b9764 Session 026: Lts/Services Qt5:: to Qt6:: migration
- Migrated all 104 CMakeLists.txt files in Lts/Services
- Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg,
  Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test,
  Qt5::SerialPort with Qt6:: equivalents
- 1244 files modified (CMakeLists.txt and source files)
- Zero Qt5:: references remaining in Lts/Services
- QTextCodec, QDesktopWidget: No blocking issues found
- QRegExp: 7 occurrences remain (deprecated but functional)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-25 19:23:30 +02:00

84 lines
2.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "logger.h"
#include <AudioVideoManagement/avm_fts.h>
#include <AudioVideoManagement/avm_db.h>
#include <QObject>
#include <QMap>
#include <QList>
namespace AudioVideoManagement
{
namespace Interface
{
class Dts;
}
class ObjectMenuStruct;
class AvMenuStruct;
/**
* cfroebel 2018-03-14:
* As of now HandlerMenuStruct only handles manually created Video- and
* AnnouncementMenus.
* There are also default menus (Video and Announcement) for each exercise;
* but those are now handeled by DefaultAvMenus.
*
* @see DefaultAvMenus.
*/
class HandlerMenuStruct :
public QObject,
protected Interface::Fts::ModifyMenuStructRequestHandler,
protected Interface::Fts::RemoveMenuStructRequestHandler
{
Q_OBJECT
public:
HandlerMenuStruct(Interface::Dts *dts, Interface::Fts *fts, DatabaseInterface *db);
~HandlerMenuStruct();
bool init();
static AvMenuEntry toDds(const Database::AvmMenuStruct &dbEntry);
/**
* Sort the entries in the following way:
* - all toplevel entries are at the front ordered by their id
* - all non-toplevel entries are at the back ordered by (parentId, rowId, id)
*/
static void sortEntries(MenuStruct &menu);
private:
bool initObjects();
void reload();
QList<MenuStruct> loadFromDb(bool &status);
void onModifyMenuStructRequest(const rti::core::SampleIdentity &cookie,
const MenuStruct &request) override final;
Core::FunctionReplyObject createMenuStructRequest(const MenuStruct &request);
Core::FunctionReplyObject modifyMenuStructRequest(const MenuStruct &request);
void onRemoveMenuStructRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request) override final;
private slots:
void onDbDeletedAvmMenuStruct(const QVariant &id_);
private:
Interface::Dts *m_dts;
Interface::Fts *m_fts;
DatabaseInterface *m_db;
QMap<qint32, ObjectMenuStruct *> m_objMap;
LOGGER_T m_logger;
};
} // namespace AudioVideoManagement