~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to src/uniquewindow.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2005-01-10 17:41:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050110174143-ltocv5zapl6blf5d
Tags: 0.9.3-1
* New upstream release
* Cleaned up debian/rules (some things are done by upstream Makefiles now)
* Fixed some lintian warnings:
  - removed executable bit from some .png files
  - moved psi.desktop to /usr/share/applications
* Updated menu files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
** uniquewindow.h - helps keep track of unique windows
3
 
** Copyright (C) 2001, 2002  Justin Karneges
4
 
**
5
 
** This program is free software; you can redistribute it and/or
6
 
** modify it under the terms of the GNU General Public License
7
 
** as published by the Free Software Foundation; either version 2
8
 
** of the License, or (at your option) any later version.
9
 
**
10
 
** This program 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
13
 
** GNU General Public License for more details.
14
 
**
15
 
** You should have received a copy of the GNU General Public License
16
 
** along with this program; 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 UNIQUEWINDOW_H
22
 
#define UNIQUEWINDOW_H
23
 
 
24
 
#include<qstring.h>
25
 
#include<qdict.h>
26
 
#include<qptrlist.h>
27
 
 
28
 
class UniqueWindow
29
 
{
30
 
public:
31
 
        UniqueWindow(bool isUnique, const QString &type, void *p, const QString &key);
32
 
        ~UniqueWindow();
33
 
 
34
 
        QString & key() { return v_key; }
35
 
        QString & type() { return v_type; }
36
 
 
37
 
private:
38
 
        bool v_isUnique;
39
 
        QString v_key;
40
 
        QString v_type;
41
 
};
42
 
 
43
 
 
44
 
struct UniqueWindowBankItem
45
 
{
46
 
        QString type;
47
 
        QDict<void> *dict;
48
 
};
49
 
 
50
 
class UniqueWindowBank
51
 
{
52
 
public:
53
 
        UniqueWindowBank();
54
 
        ~UniqueWindowBank();
55
 
 
56
 
        void add(const QString &type, void *p, const QString &);
57
 
        void remove(const QString &type, const QString &);
58
 
 
59
 
        void * finditem(const QString &type, const QString &key);
60
 
        static void * find(const QString &type, const QString &key);
61
 
 
62
 
private:
63
 
        QPtrList<UniqueWindowBankItem> list;
64
 
};
65
 
 
66
 
#endif