summaryrefslogtreecommitdiff
path: root/zen/shutdown.h
blob: b4d51f69eafe2a6c92c7be5a75ba7b6614aac42b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// *****************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under    *
// * GNU General Public License: https://www.gnu.org/licenses/gpl-3.0          *
// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
// *****************************************************************************

#ifndef SHUTDOWN_H_3423847870238407783265
#define SHUTDOWN_H_3423847870238407783265

#include <functional>
#include "file_error.h"


namespace zen
{
void shutdownSystem(); //throw FileError
void suspendSystem();  //
[[noreturn]] void terminateProcess(int exitCode);

void onSystemShutdownRegister(const SharedRef<std::function<void()>>& task /*noexcept*/); //save important/user data!
void onSystemShutdownRegister(      SharedRef<std::function<void()>>&& task) = delete; //no temporaries! shared_ptr should manage life time!
void onSystemShutdownRunTasks(); //call at appropriate time, e.g. when receiving wxEVT_QUERY_END_SESSION/wxEVT_END_SESSION
//+ also called by shutdownSystem()
}

#endif //SHUTDOWN_H_3423847870238407783265
bgstack15