1 /*
2  * activeprofiles.h - Class for interacting with other psi instances
3  * Copyright (C) 2006  Maciej Niedzielski
4  * Copyright (C) 2006-2007  Martin Hostettler
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 #ifndef ACTIVEPSIPROFILES_H
23 #define ACTIVEPSIPROFILES_H
24 
25 #include <QObject>
26 #include <QStringList>
27 
28 class ActiveProfiles: public QObject
29 {
30 	Q_OBJECT
31 public:
32 	static ActiveProfiles* instance();
33 
34 	bool setThisProfile(const QString &profile);
35 	void unsetThisProfile();
36 	QString thisProfile() const;
37 
38 	bool isActive(const QString &profile) const;
39 	bool isAnyActive() const;
40 
41 	bool setStatus(const QString &profile, const QString &status, const QString &message) const;
42 	bool openUri(const QString &profile, const QString &uri) const;
43 	bool raise(const QString &profile, bool withUI) const;
44 
45 	~ActiveProfiles();
46 
47 signals:
48 	void setStatusRequested(const QString &status, const QString &message);
49 	void openUriRequested(const QString &uri);
50 	void raiseRequested();
51 
52 protected:
53 	static ActiveProfiles *instance_;
54 
55 private:
56 	class Private;
57 	Private *d;
58 
59 	ActiveProfiles();
60 
61 	friend class PsiConAdapter;
62 	friend class PsiMain;
63 };
64 
65 #endif
66