~ubuntu-branches/ubuntu/dapper/psi/dapper

« back to all changes in this revision

Viewing changes to cutestuff/dirwatch/dirwatch.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2004-06-15 00:10:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040615001041-enywb6pcpe4sjsw6
Tags: 0.9.2-1
* New upstream release
* Set KDEDIR for ./configure so kde specific files get installed
* Don't install libpsiwidgets.so. It got installed in /usr/share
  where it doesn't belong. May be included (at a better location)
  later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * dirwatch.h - detect changes of directory content
 
3
 * Copyright (C) 2003  Justin Karneges
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2.1 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef CS_DIRWATCH_H
 
22
#define CS_DIRWATCH_H
 
23
 
 
24
#ifndef _GNU_SOURCE
 
25
#define _GNU_SOURCE
 
26
#endif
 
27
 
 
28
#include<qobject.h>
 
29
 
 
30
class FileWatch : public QObject
 
31
{
 
32
        Q_OBJECT
 
33
public:
 
34
        FileWatch(const QString &fname="", QObject *parent=0);
 
35
        ~FileWatch();
 
36
 
 
37
        QString fileName() const;
 
38
        void setFileName(const QString &);
 
39
 
 
40
signals:
 
41
        void changed();
 
42
 
 
43
private slots:
 
44
        void dirChanged();
 
45
 
 
46
private:
 
47
        class Private;
 
48
        Private *d;
 
49
};
 
50
 
 
51
class DirWatch : public QObject
 
52
{
 
53
        Q_OBJECT
 
54
public:
 
55
        DirWatch(const QString &dir="", QObject *parent=0);
 
56
        ~DirWatch();
 
57
 
 
58
        QString dir() const;
 
59
        void setDir(const QString &);
 
60
 
 
61
        bool usingPlatform() const;
 
62
 
 
63
signals:
 
64
        void changed();
 
65
 
 
66
private slots:
 
67
        void doCheck();
 
68
        void pf_dirChanged(int);
 
69
 
 
70
private:
 
71
        class Private;
 
72
        Private *d;
 
73
};
 
74
 
 
75
class DirWatchPlatform : public QObject
 
76
{
 
77
        Q_OBJECT
 
78
public:
 
79
        DirWatchPlatform();
 
80
        ~DirWatchPlatform();
 
81
 
 
82
        bool init();
 
83
        int addDir(const QString &);
 
84
        void removeDir(int);
 
85
 
 
86
signals:
 
87
        void dirChanged(int);
 
88
 
 
89
public:
 
90
        class Private;
 
91
private:
 
92
        Private *d;
 
93
 
 
94
        friend class Private;
 
95
private slots:
 
96
        void triggerDirChanged(int x) { dirChanged(x); }
 
97
};
 
98
 
 
99
#endif