Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
tdecore
tdecore
tdecore
klockfile.h
1
/*
2
This file is part of the KDE libraries
3
Copyright (c) 2004 Waldo Bastian <bastian@kde.org>
4
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
8
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
13
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
18
*/
19
20
#ifndef _KLOCKFILE_H_
21
#define _KLOCKFILE_H_
22
23
#include <tqstring.h>
24
#include <tqdatetime.h>
25
26
#include <ksharedptr.h>
33
class
TDECORE_EXPORT
TDELockFile
:
public
TDEShared
34
{
35
public
:
36
typedef
TDESharedPtr<TDELockFile>
Ptr
;
37
38
TDELockFile
(
const
TQString &file);
39
43
~
TDELockFile
();
44
48
enum
LockResult
{
52
LockOK = 0,
53
57
LockFail
,
58
62
LockError
,
63
67
LockStale
68
};
69
70
enum
LockOptions
{
74
LockNoBlock = 1,
75
80
LockForce = 2
81
};
82
88
LockResult lock(
int
options=0);
89
93
bool
isLocked()
const
;
94
98
void
unlock();
99
104
int
staleTime()
const
;
105
109
void
setStaleTime(
int
_staleTime);
110
116
bool
getLockInfo(
int
&pid, TQString &hostname, TQString &appname);
117
118
private
:
119
class
TDELockFilePrivate;
120
TDELockFilePrivate *d;
121
};
122
123
#endif
tdecore
Skip menu "tdecore"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
tdecore
Skip menu "tdecore"
arts
dcop
dnssd
interfaces
kspeech
interface
library
tdetexteditor
kate
kded
kdoctools
kimgio
kjs
libtdemid
libtdescreensaver
tdeabc
tdecmshell
tdecore
tdefx
tdehtml
tdeinit
tdeio
bookmarks
httpfilter
kpasswdserver
kssl
tdefile
tdeio
tdeioexec
tdeioslave
http
tdemdi
tdemdi
tdenewstuff
tdeparts
tdeprint
tderandr
tderesources
tdespell2
tdesu
tdeui
tdeunittest
tdeutils
tdewallet