nodeguy/src/cpp/include/nodegui/QtWidgets/QScrollArea/qscrollarea_wrap.h
Simon Edwards 1bc346d22c
Add QEvent methods to all subclasses + some random methods (#848)
* Add `clearFocus()` to `QWidget`

* Add `Alignment` param to `QBoxLayout.addWidget()`

* Add `setViewportMargins()` & `viewportMargins()` to `QScrollArea`

* Add `QEvent` methods to all event related subclasses

* Tell C++ that our 0 is zero and not a null pointer
2021-07-08 22:45:41 +02:00

32 lines
1.0 KiB
C++

#pragma once
#include <napi.h>
#include <QPointer>
#include "Extras/Export/export.h"
#include "QtWidgets/QAbstractScrollArea/qabstractscrollarea_macro.h"
#include "nscrollarea.hpp"
class DLL_EXPORT QScrollAreaWrap : public Napi::ObjectWrap<QScrollAreaWrap> {
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
private:
QPointer<NScrollArea> instance;
YGNodeRef scrollNode;
public:
static Napi::Object init(Napi::Env env, Napi::Object exports);
QScrollAreaWrap(const Napi::CallbackInfo& info);
~QScrollAreaWrap();
NScrollArea* getInternalInstance();
// class constructor
static Napi::FunctionReference constructor;
// wrapped methods
Napi::Value ensureVisible(const Napi::CallbackInfo& info);
Napi::Value ensureWidgetVisible(const Napi::CallbackInfo& info);
Napi::Value setWidget(const Napi::CallbackInfo& info);
Napi::Value takeWidget(const Napi::CallbackInfo& info);
Napi::Value setViewportMargins(const Napi::CallbackInfo& info);
Napi::Value viewportMargins(const Napi::CallbackInfo& info);
};