KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
LayoutSaver_c.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11#include "LayoutSaver_c.h"
12
13
14#include <iostream>
15
16#include <cassert>
17
18
19namespace Dartagnan {
20
21typedef int (*CleanupCallback)(void *thisPtr);
23
24template<typename T>
25struct ValueWrapper
26{
27 T value;
28};
29
30}
37{
38 return ::KDDockWidgets::LayoutSaver::restoreFromFile(jsonFilename);
39}
41{
42 return ::KDDockWidgets::LayoutSaver::restoreInProgress();
43}
45{
46 return ::KDDockWidgets::LayoutSaver::saveToFile(jsonFilename);
47}
51
52}
54{
55 return reinterpret_cast<KDDockWidgets::LayoutSaver *>(ptr);
56}
61extern "C" {
63{
64 delete reinterpret_cast<KDDockWidgetsBindings_wrappersNS::LayoutSaver_wrapper *>(cppObj);
65}
67{
69 return reinterpret_cast<void *>(ptr);
70}
71// restoreFromFile(const QString & jsonFilename)
72bool c_KDDockWidgets__LayoutSaver__restoreFromFile_QString(void *thisObj, const char *jsonFilename_)
73{
74 const auto jsonFilename = QString::fromUtf8(jsonFilename_);
75 const auto &result = fromPtr(thisObj)->restoreFromFile(jsonFilename);
76 free(( char * )jsonFilename_);
77 return result;
78}
79// restoreInProgress()
85// saveToFile(const QString & jsonFilename)
86bool c_KDDockWidgets__LayoutSaver__saveToFile_QString(void *thisObj, const char *jsonFilename_)
87{
88 const auto jsonFilename = QString::fromUtf8(jsonFilename_);
89 const auto &result = fromPtr(thisObj)->saveToFile(jsonFilename);
90 free(( char * )jsonFilename_);
91 return result;
92}
94{
95 delete fromPtr(thisObj);
96}
97}
static KDDockWidgetsBindings_wrappersNS::LayoutSaver_wrapper * fromWrapperPtr(void *ptr)
bool c_KDDockWidgets__LayoutSaver__saveToFile_QString(void *thisObj, const char *jsonFilename_)
void c_KDDockWidgets__LayoutSaver_Finalizer(void *cppObj)
void * c_KDDockWidgets__LayoutSaver__constructor()
static KDDockWidgets::LayoutSaver * fromPtr(void *ptr)
void c_KDDockWidgets__LayoutSaver__destructor(void *thisObj)
bool c_static_KDDockWidgets__LayoutSaver__restoreInProgress()
bool c_KDDockWidgets__LayoutSaver__restoreFromFile_QString(void *thisObj, const char *jsonFilename_)
bool restoreFromFile(const QString &jsonFilename)
LayoutSaver allows to save or restore layouts.
Definition LayoutSaver.h:56
bool saveToFile(const QString &jsonFilename)
saves the layout to JSON file
bool restoreFromFile(const QString &jsonFilename)
restores the layout from a JSON file
int(* CleanupCallback)(void *thisPtr)
Definition Config_c.cpp:21
static CleanupCallback s_cleanupCallback
Definition Config_c.cpp:22
Class to abstract QAction, so code still works with QtQuick and Flutter.
QString fromUtf8(const char *str, int size)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8