• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • services
  • filewatch
kinotify.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2007-2010 Sebastian Trueg <trueg@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
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 _KINOTIFY_H_
21 #define _KINOTIFY_H_
22 
23 #include <QtCore/QObject>
24 #include <QtCore/QFlags>
25 
33 class KInotify : public QObject
34 {
35  Q_OBJECT
36 
37 public:
38  KInotify( QObject* parent = 0 );
39  virtual ~KInotify();
40 
47  enum WatchEvent {
48  EventAccess = 0x00000001,
49  EventAttributeChange = 0x00000004,
50  EventCloseWrite = 0x00000008,
51  EventCloseRead = 0x00000010,
52  EventCreate = 0x00000100,
53  EventDelete = 0x00000200,
54  EventDeleteSelf = 0x00000400,
55  EventModify = 0x00000002,
56  EventMoveSelf = 0x00000800,
57  EventMoveFrom = 0x00000040,
58  EventMoveTo = 0x00000080,
59  EventOpen = 0x00000020,
60  EventUnmount = 0x00002000,
61  EventQueueOverflow = 0x00004000,
62  EventIgnored = 0x00008000,
63  EventMove = ( EventMoveFrom|EventMoveTo),
64  EventAll = ( EventAccess|
65  EventAttributeChange|
66  EventCloseWrite|
67  EventCloseRead|
68  EventCreate|
69  EventDelete|
70  EventDeleteSelf|
71  EventModify|
72  EventMoveSelf|
73  EventMoveFrom|
74  EventMoveTo|
75  EventOpen )
76  };
77  Q_DECLARE_FLAGS(WatchEvents, WatchEvent)
78 
79 
84  enum WatchFlag {
85  FlagOnlyDir = 0x01000000,
86  FlagDoNotFollow = 0x02000000,
87  FlagOneShot = 0x80000000,
88  FlagExclUnlink = 0x04000000
89  };
90  Q_DECLARE_FLAGS(WatchFlags, WatchFlag)
91 
92 
95  bool available() const;
96 
97  bool watchingPath( const QString& path ) const;
98 
102  void resetUserLimit();
103 
104 protected:
109  virtual bool filterWatch( const QString & path, WatchEvents & modes, WatchFlags & flags );
110 
111 public Q_SLOTS:
112  virtual bool addWatch( const QString& path, WatchEvents modes, WatchFlags flags = WatchFlags() );
113  bool removeWatch( const QString& path );
114 
115 Q_SIGNALS:
119  void accessed( const QString& file );
120 
124  void attributeChanged( const QString& file );
125 
129  void closedWrite( const QString& file );
130 
134  void closedRead( const QString& file );
135 
140  void created( const QString& file, bool isDir );
141 
146  void deleted( const QString& file, bool isDir );
147 
151  void modified( const QString& file );
152 
159  void moved( const QString& oldName, const QString& newName );
160 
164  void opened( const QString& file );
165 
169  void unmounted( const QString& file );
170 
182  void watchUserLimitReached( const QString& path );
183 
184 private Q_SLOTS:
185  void slotEvent( int );
186  void slotClearCookies();
187 
188 private:
189  class Private;
190  Private* const d;
191 
192  Q_PRIVATE_SLOT( d, bool _k_addWatches() )
193 };
194 
195 #endif
KInotify::EventOpen
File was opened (compare inotify's IN_OPEN)
Definition: kinotify.h:59
KInotify::EventQueueOverflow
Event queued overflowed (compare inotify's IN_Q_OVERFLOW)
Definition: kinotify.h:61
KInotify::EventAttributeChange
Metadata changed (permissions, timestamps, extended attributes, etc., compare inotify's IN_ATTRIB) ...
Definition: kinotify.h:49
KInotify
A simple wrapper around inotify which only allows to add folders recursively.
Definition: kinotify.h:33
KInotify::FlagDoNotFollow
Don't follow a sym link (IN_DONT_FOLLOW)
Definition: kinotify.h:86
KInotify::modified
void modified(const QString &file)
Emitted if a watched file is modified (KInotify::EventModify)
KInotify::EventMoveSelf
Watched file/directory was itself moved (compare inotify's IN_MOVE_SELF)
Definition: kinotify.h:56
KInotify::EventModify
File was modified (compare inotify's IN_MODIFY)
Definition: kinotify.h:55
KInotify::EventDelete
File/directory created in watched directory (compare inotify's IN_CREATE)
Definition: kinotify.h:53
KInotify::deleted
void deleted(const QString &file, bool isDir)
Emitted if a watched file or folder has been deleted.
KInotify::WatchEvent
WatchEvent
Inotify events that can occur.
Definition: kinotify.h:47
KInotify::created
void created(const QString &file, bool isDir)
Emitted if a new file has been created in one of the watched folders (KInotify::EventCreate) ...
QObject
KInotify::EventCreate
Definition: kinotify.h:52
KInotify::opened
void opened(const QString &file)
Emitted if a file is opened (KInotify::EventOpen)
KInotify::watchingPath
bool watchingPath(const QString &path) const
Definition: kinotify.cpp:260
KInotify::FlagOneShot
Only send event once (IN_ONESHOT)
Definition: kinotify.h:87
KInotify::unmounted
void unmounted(const QString &file)
Emitted if a watched path has been unmounted (KInotify::EventUnmount)
KInotify::EventDeleteSelf
Watched file/directory was itself deleted (compare inotify's IN_DELETE_SELF)
Definition: kinotify.h:54
KInotify::moved
void moved(const QString &oldName, const QString &newName)
Emitted if a file or folder has been moved or renamed.
KInotify::removeWatch
bool removeWatch(const QString &path)
Definition: kinotify.cpp:293
KInotify::accessed
void accessed(const QString &file)
Emitted if a file is accessed (KInotify::EventAccess)
KInotify::filterWatch
virtual bool filterWatch(const QString &path, WatchEvents &modes, WatchFlags &flags)
Called for every folder that is being watched.
Definition: kinotify.cpp:322
KInotify::EventCloseWrite
File opened for writing was closed (compare inotify's IN_CLOSE_WRITE)
Definition: kinotify.h:50
KInotify::watchUserLimitReached
void watchUserLimitReached(const QString &path)
Emitted if during updating the internal watch structures (recursive watches) the inotify user watch l...
KInotify::attributeChanged
void attributeChanged(const QString &file)
Emitted if file attributes are changed (KInotify::EventAttributeChange)
KInotify::EventMove
Definition: kinotify.h:63
KInotify::EventUnmount
Backing fs was unmounted (compare inotify's IN_UNMOUNT)
Definition: kinotify.h:60
KInotify::closedRead
void closedRead(const QString &file)
Emitted if FIXME (KInotify::EventCloseRead)
KInotify::~KInotify
virtual ~KInotify()
Definition: kinotify.cpp:227
KInotify::available
bool available() const
Definition: kinotify.cpp:233
KInotify::FlagExclUnlink
Do not generate events for unlinked files (IN_EXCL_UNLINK)
Definition: kinotify.h:88
KInotify::EventMoveTo
File moved into watched directory (compare inotify's IN_MOVED_TO)
Definition: kinotify.h:58
KInotify::EventAccess
File was accessed (read, compare inotify's IN_ACCESS)
Definition: kinotify.h:48
KInotify::closedWrite
void closedWrite(const QString &file)
Emitted if FIXME (KInotify::EventCloseWrite)
KInotify::EventCloseRead
File not opened for writing was closed (compare inotify's IN_CLOSE_NOWRITE)
Definition: kinotify.h:51
KInotify::addWatch
virtual bool addWatch(const QString &path, WatchEvents modes, WatchFlags flags=WatchFlags())
Definition: kinotify.cpp:271
KInotify::FlagOnlyDir
Only watch the path if it is a directory (IN_ONLYDIR)
Definition: kinotify.h:85
KInotify::WatchFlag
WatchFlag
Watch flags.
Definition: kinotify.h:84
KInotify::EventIgnored
File was ignored (compare inotify's IN_IGNORED)
Definition: kinotify.h:62
KInotify::EventMoveFrom
File moved out of watched directory (compare inotify's IN_MOVED_FROM)
Definition: kinotify.h:57
KInotify::KInotify
KInotify(QObject *parent=0)
Definition: kinotify.cpp:215
KInotify::EventAll
Definition: kinotify.h:64
KInotify::resetUserLimit
void resetUserLimit()
Call this when the inotify limit has been increased.
Definition: kinotify.cpp:266
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal