Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+83
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* @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
|
||||
Reference in new issue
Block a user