LibreOffice Module vcl (master) 1
salsession.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_INC_SALSESSION_HXX
21#define INCLUDED_VCL_INC_SALSESSION_HXX
22
23#include <vcl/dllapi.h>
24
26{
30 Quit
31};
32
34{
36
38 : m_eType( eType )
39 {}
40};
41
43{
45
48 m_bInteractionGranted( bGranted )
49 {}
50};
51
53{
55
58 m_bShutdown( bShutdown )
59 {}
60};
61
63{
66 {}
67};
68
70{
73 {}
74};
75
76typedef void(*SessionProc)(void *pData, SalSessionEvent *pEvent);
77
79{
82public:
84 : m_aProc(nullptr)
85 , m_pProcData(nullptr)
86 {
87 }
88 virtual ~SalSession();
89
90 void SetCallback( SessionProc aCallback, void * pCallbackData )
91 {
92 m_aProc = aCallback;
93 m_pProcData = pCallbackData;
94 }
96 {
97 if( m_aProc )
98 m_aProc( m_pProcData, pEvent );
99 }
100
101 // query the session manager for a user interaction slot
102 virtual void queryInteraction() = 0;
103 // signal the session manager that we're done with user interaction
104 virtual void interactionDone() = 0;
105 // signal that we're done saving
106 virtual void saveDone() = 0;
107 // try to cancel the shutdown in progress
108 virtual bool cancelShutdown() = 0;
109};
110
111#endif // INCLUDED_VCL_INC_SALSESSION_HXX
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SessionProc m_aProc
Definition: salsession.hxx:80
virtual void interactionDone()=0
virtual void queryInteraction()=0
virtual bool cancelShutdown()=0
void CallCallback(SalSessionEvent *pEvent)
Definition: salsession.hxx:95
void SetCallback(SessionProc aCallback, void *pCallbackData)
Definition: salsession.hxx:90
virtual void saveDone()=0
void * m_pProcData
Definition: salsession.hxx:81
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
DocumentType eType
std::unique_ptr< sal_Int32[]> pData
SalSessionEventType
Definition: salsession.hxx:26
@ ShutdownCancel
Definition: salsession.hxx:29
@ SaveRequest
Definition: salsession.hxx:28
@ Interaction
Definition: salsession.hxx:27
@ Quit
Definition: salsession.hxx:30
void(* SessionProc)(void *pData, SalSessionEvent *pEvent)
Definition: salsession.hxx:76
SalSessionEventType m_eType
Definition: salsession.hxx:35
SalSessionEvent(SalSessionEventType eType)
Definition: salsession.hxx:37
SalSessionInteractionEvent(bool bGranted)
Definition: salsession.hxx:46
SalSessionSaveRequestEvent(bool bShutdown)
Definition: salsession.hxx:56