libqutim 0.2.80.1

systemintegration.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** qutIM - instant messenger
00004 **
00005 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
00006 **
00007 *****************************************************************************
00008 **
00009 ** $QUTIM_BEGIN_LICENSE$
00010 ** This program is free software: you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation, either version 3 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018 ** See the GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program.  If not, see http://www.gnu.org/licenses/.
00022 ** $QUTIM_END_LICENSE$
00023 **
00024 ****************************************************************************/
00025 
00026 #ifndef SYSTEMINTEGRATION_H
00027 #define SYSTEMINTEGRATION_H
00028 
00029 #include "libqutim_global.h"
00030 #include <QVariant>
00031 
00032 namespace qutim_sdk_0_3
00033 {
00034 class LIBQUTIM_EXPORT SystemIntegration : public QObject
00035 {
00036     Q_OBJECT
00037 public:
00038     enum Attribute {
00039         UserLogin,
00040         UserName,
00041         CurrentLanguage, // not the same as locale
00042         ExtensionsForMimeType, // /etc/mime.types
00043         TimeZone,
00044         TimeZoneName,
00045         TimeZoneShortName,
00046         IconSize, //default icon size
00047         CurrentProxyInfo
00048     };
00049     
00050     enum Operation
00051     {
00052         ShowWidget
00053     };
00054 
00055     enum IconSizeEnum
00056     {
00057         //By size
00058         IconSizeSmall,
00059         IconSizeMedium,
00060         IconSizeLarge,
00061         IconSizeHuge,
00062         //By Role
00063         IconSizeToolBar,
00064         IconSizeContactsView,
00065         IconSizeListView,
00066         IconSizeIconView
00067     };
00068 
00069     enum Priority
00070     {
00071         BaseSystem = 0, // Unix
00072         WindowManager = 127, // X11
00073         DesktopEnvironment = 255 // KDE
00074     };
00075 
00076     SystemIntegration();
00077     virtual ~SystemIntegration();
00078 
00079     virtual void init() = 0;
00080     virtual bool isAvailable() const = 0;
00081     virtual int priority() = 0;
00082     
00083     static void show(QWidget *widget);
00084     static QVariant value(Attribute attr, const QVariant &data = QVariant());
00085     static QVariant process(Operation act, const QVariant &data = QVariant());
00086 //  virtual void show(QWidget *widget);
00087 
00088 protected:
00089     virtual QVariant doGetValue(Attribute attr, const QVariant &data) const = 0;
00090     virtual QVariant doProcess(Operation act, const QVariant &data) const = 0;
00091     virtual bool canHandle(Attribute attribute) const = 0;
00092     virtual bool canHandle(Operation operation) const = 0;
00093     virtual void virtual_hook(int, void *);
00094     friend struct IntegrationData;
00095 };
00096 }
00097 
00098 #endif // SYSTEMINTEGRATION_H
00099