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 {
31 };
32 
34 {
36 
38  : m_eType( eType )
39  {}
40 };
41 
43 {
45 
46  SalSessionInteractionEvent( bool bGranted )
48  m_bInteractionGranted( bGranted )
49  {}
50 };
51 
53 {
54  bool const m_bShutdown;
55 
56  SalSessionSaveRequestEvent( bool bShutdown )
58  m_bShutdown( bShutdown )
59  {}
60 };
61 
63 {
66  {}
67 };
68 
70 {
73  {}
74 };
75 
76 typedef void(*SessionProc)(void *pData, SalSessionEvent *pEvent);
77 
79 {
81  void * m_pProcData;
82 public:
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  }
95  void CallCallback( SalSessionEvent* pEvent )
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: */
void SetCallback(SessionProc aCallback, void *pCallbackData)
Definition: salsession.hxx:90
SalSessionEvent(SalSessionEventType eType)
Definition: salsession.hxx:37
bool const m_bInteractionGranted
Definition: salsession.hxx:44
void * m_pProcData
Definition: salsession.hxx:81
void CallCallback(SalSessionEvent *pEvent)
Definition: salsession.hxx:95
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
SalSessionEventType const m_eType
Definition: salsession.hxx:35
void(* SessionProc)(void *pData, SalSessionEvent *pEvent)
Definition: salsession.hxx:76
SalSessionInteractionEvent(bool bGranted)
Definition: salsession.hxx:46
SalSessionSaveRequestEvent(bool bShutdown)
Definition: salsession.hxx:56
SalSessionEventType
Definition: salsession.hxx:25
SessionProc m_aProc
Definition: salsession.hxx:80
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo