LibreOffice Module vcl (master) 1
osx/saltimer.h
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_OSX_SALTIMER_H
21#define INCLUDED_VCL_INC_OSX_SALTIMER_H
22
23#include <premac.h>
24#include <Cocoa/Cocoa.h>
25#include <postmac.h>
26
27#include <saltimer.hxx>
28
33void ImplNSAppPostEvent( short nEventId, BOOL bAtStart, int nUserData = 0 );
34
36{
37 NSAutoreleasePool* mpPool;
38
39public:
40 ReleasePoolHolder() : mpPool( [[NSAutoreleasePool alloc] init] ) {}
41 ~ReleasePoolHolder() { [mpPool release]; }
42};
43
44class AquaSalTimer final : public SalTimer, protected VersionedEvent
45{
48
49 void queueDispatchTimerEvent( bool bAtStart );
51
52public:
54 virtual ~AquaSalTimer() override;
55
56 void Start( sal_uInt64 nMS ) override;
57 void Stop() override;
58
59 void handleStartTimerEvent( NSEvent* pEvent );
60 bool handleDispatchTimerEvent( NSEvent* pEvent );
63
64 bool IsTimerElapsed() const;
65 inline bool IsDirectTimeout() const;
66};
67
69{
70 return m_bDirectTimeout;
71}
72
73#endif // INCLUDED_VCL_INC_OSX_SALTIMER_H
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FILE * init(int, char **)
void Stop() override
virtual ~AquaSalTimer() override
void Start(sal_uInt64 nMS) override
void handleWindowShouldClose()
bool IsTimerElapsed() const
void callTimerCallback()
void handleTimerElapsed()
bool m_bDirectTimeout
timeout can be processed directly
Definition: osx/saltimer.h:47
bool handleDispatchTimerEvent(NSEvent *pEvent)
NSTimer * m_pRunningTimer
Definition: osx/saltimer.h:46
void handleStartTimerEvent(NSEvent *pEvent)
void queueDispatchTimerEvent(bool bAtStart)
bool IsDirectTimeout() const
Definition: osx/saltimer.h:68
NSAutoreleasePool * mpPool
Definition: osx/saltimer.h:37
void ImplNSAppPostEvent(short nEventId, BOOL bAtStart, int nUserData=0)
if NO == bAtStart, then it has to be run in the main thread, e.g.
const wchar_t *typedef BOOL