summaryrefslogtreecommitdiff
path: root/examples/uinotification
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2022-01-27 22:43:28 -0500
committerKyleMiles <krm504@nyu.edu>2022-01-28 00:24:06 -0500
commit6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 (patch)
treedace4156d03148bcaf02df138ab4e0d93e61bc6f /examples/uinotification
parent519c9db22367f2659d1a54599fab47e6313be06e (diff)
Format All Files
Diffstat (limited to 'examples/uinotification')
-rw-r--r--examples/uinotification/uinotification.cpp18
-rw-r--r--examples/uinotification/uinotification.h8
2 files changed, 17 insertions, 9 deletions
diff --git a/examples/uinotification/uinotification.cpp b/examples/uinotification/uinotification.cpp
index d9eada8e..5072d98a 100644
--- a/examples/uinotification/uinotification.cpp
+++ b/examples/uinotification/uinotification.cpp
@@ -31,21 +31,24 @@ void NotificationListener::OnContextClose(UIContext* context)
bool NotificationListener::OnBeforeOpenDatabase(UIContext* context, FileMetadataRef metadata)
{
LogInfo("OnBeforeOpenDatabase");
- return QMessageBox::question(context->mainWindow(), "OnBeforeOpenDatabase", "OnBeforeOpenDatabase") == QMessageBox::StandardButton::Yes;
+ return QMessageBox::question(context->mainWindow(), "OnBeforeOpenDatabase", "OnBeforeOpenDatabase")
+ == QMessageBox::StandardButton::Yes;
}
bool NotificationListener::OnAfterOpenDatabase(UIContext* context, FileMetadataRef metadata, BinaryViewRef data)
{
LogInfo("OnAfterOpenDatabase");
- return QMessageBox::question(context->mainWindow(), "OnAfterOpenDatabase", "OnAfterOpenDatabase") == QMessageBox::StandardButton::Yes;
+ return QMessageBox::question(context->mainWindow(), "OnAfterOpenDatabase", "OnAfterOpenDatabase")
+ == QMessageBox::StandardButton::Yes;
}
bool NotificationListener::OnBeforeOpenFile(UIContext* context, FileContext* file)
{
LogInfo("OnBeforeOpenFile");
- return QMessageBox::question(context->mainWindow(), "OnBeforeOpenFile", "OnBeforeOpenFile") == QMessageBox::StandardButton::Yes;
+ return QMessageBox::question(context->mainWindow(), "OnBeforeOpenFile", "OnBeforeOpenFile")
+ == QMessageBox::StandardButton::Yes;
}
@@ -58,7 +61,8 @@ void NotificationListener::OnAfterOpenFile(UIContext* context, FileContext* file
bool NotificationListener::OnBeforeSaveFile(UIContext* context, FileContext* file, ViewFrame* frame)
{
LogInfo("OnBeforeSaveFile");
- return QMessageBox::question(context->mainWindow(), "OnBeforeSaveFile", "OnBeforeSaveFile") == QMessageBox::StandardButton::Yes;
+ return QMessageBox::question(context->mainWindow(), "OnBeforeSaveFile", "OnBeforeSaveFile")
+ == QMessageBox::StandardButton::Yes;
}
@@ -71,7 +75,8 @@ void NotificationListener::OnAfterSaveFile(UIContext* context, FileContext* file
bool NotificationListener::OnBeforeCloseFile(UIContext* context, FileContext* file, ViewFrame* frame)
{
LogInfo("OnBeforeCloseFile");
- return QMessageBox::question(context->mainWindow(), "OnBeforeCloseFile", "OnBeforeCloseFile") == QMessageBox::StandardButton::Yes;
+ return QMessageBox::question(context->mainWindow(), "OnBeforeCloseFile", "OnBeforeCloseFile")
+ == QMessageBox::StandardButton::Yes;
}
@@ -87,7 +92,8 @@ void NotificationListener::OnViewChange(UIContext* context, ViewFrame* frame, co
}
-void NotificationListener::OnAddressChange(UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location)
+void NotificationListener::OnAddressChange(
+ UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location)
{
LogInfo("OnAddressChange: 0x%" PRIx64, location.getOffset());
}
diff --git a/examples/uinotification/uinotification.h b/examples/uinotification/uinotification.h
index 31ffbc34..a359a35a 100644
--- a/examples/uinotification/uinotification.h
+++ b/examples/uinotification/uinotification.h
@@ -2,10 +2,11 @@
#include "uicontext.h"
-class NotificationListener: UIContextNotification
+class NotificationListener : UIContextNotification
{
static NotificationListener* m_instance;
-public:
+
+ public:
virtual void OnContextOpen(UIContext* context) override;
virtual void OnContextClose(UIContext* context) override;
virtual bool OnBeforeOpenDatabase(UIContext* context, FileMetadataRef metadata) override;
@@ -17,7 +18,8 @@ public:
virtual bool OnBeforeCloseFile(UIContext* context, FileContext* file, ViewFrame* frame) override;
virtual void OnAfterCloseFile(UIContext* context, FileContext* file, ViewFrame* frame) override;
virtual void OnViewChange(UIContext* context, ViewFrame* frame, const QString& type) override;
- virtual void OnAddressChange(UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location) override;
+ virtual void OnAddressChange(
+ UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location) override;
virtual bool GetNameForFile(UIContext* context, FileContext* file, QString& name) override;
virtual bool GetNameForPath(UIContext* context, const QString& path, QString& name) override;