libqutim  0.3.1.0
systemintegration.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef SYSTEMINTEGRATION_H
27 #define SYSTEMINTEGRATION_H
28 
29 #include "libqutim_global.h"
30 #include <QVariant>
31 
32 class QAbstractSocket;
33 class QDialog;
34 
35 namespace qutim_sdk_0_3
36 {
37 class SettingsItem;
38 class ObjectGenerator;
39 
40 class LIBQUTIM_EXPORT SystemIntegration : public QObject
41 {
42  Q_OBJECT
43 public:
44  enum Attribute {
47  CurrentLanguage, // not the same as locale
48  ExtensionsForMimeType, // /etc/mime.types
52  IconSize, //default icon size
53  CurrentProxyInfo
54  };
55 
56  enum Operation
57  {
61  OpenDialog
62  };
63 
65  {
66  //By size
71  //By Role
75  IconSizeIconView
76  };
77 
78  enum Priority
79  {
80  BaseSystem = 0, // Unix
81  WindowManager = 127, // X11
82  DesktopEnvironment = 255 // KDE
83  };
84 
86  virtual ~SystemIntegration();
87 
88  virtual void init() = 0;
89  virtual bool isAvailable() const = 0;
90  virtual int priority() = 0;
91 
92  static void show(QWidget *widget);
93  static void open(QDialog *dialog);
94  static void keepAlive(QAbstractSocket *socket);
95  static ObjectGenerator *settingsGenerator(SettingsItem *item);
96  static QVariant value(Attribute attr, const QVariant &data = QVariant());
97  static QVariant process(Operation act, const QVariant &data = QVariant());
98 // virtual void show(QWidget *widget);
99 
100 protected:
101  virtual QVariant doGetValue(Attribute attr, const QVariant &data) const = 0;
102  virtual QVariant doProcess(Operation act, const QVariant &data) const = 0;
103  virtual bool canHandle(Attribute attribute) const = 0;
104  virtual bool canHandle(Operation operation) const = 0;
105  virtual void virtual_hook(int, void *);
106  friend struct IntegrationData;
107 };
108 }
109 
111 
112 #endif // SYSTEMINTEGRATION_H
113 

Generated by Doxygen