1 /* 2 skypewindow.h - Kopete Skype Protocol 3 4 Copyright (c) 2009 by Pali Rohár <pali.rohar@gmail.com> 5 6 ************************************************************************* 7 * * 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2 of the License, or (at your option) any later version. * 12 * * 13 ************************************************************************* 14 */ 15 16 #ifndef SKYPEWINDOW_H 17 #define SKYPEWINDOW_H 18 19 #include <QObject> 20 #include <QWidgetList> //for WId 21 #include <QProcess> //for Q_PID 22 23 class SkypeWindowPrivate; 24 25 /** 26 * @author Pali Rohár 27 * This class contains methods for manipulating with linux skype client 28 * !!! Only work if ENGLISH language is setup in skype client and kwin is running !!! 29 */ 30 class SkypeWindow : public QObject 31 { 32 Q_OBJECT 33 public: 34 /** 35 * Constructor 36 * @param pid process id of skype 37 * If you use 0, all functions will check all processes 38 */ 39 SkypeWindow(Q_PID pid = 0); 40 /** 41 * Destructor 42 **/ 43 ~SkypeWindow(); 44 /** 45 * This will try hide call dialog created by linux skype client 46 * @param user audio/video call session with this skype user name 47 */ 48 void hideCallDialog(const QString &user); 49 /** 50 * This show hidden call dialog 51 * @param user audio/video call session with this skype user name 52 */ 53 void showCallDialog(const QString &user); 54 /** 55 * This permanently delete call dialog 56 * @param user audio/video call session with this skype user name 57 */ 58 void deleteCallDialog(const QString &user); 59 /** 60 * This will try move webcam stream widget from linux skype client to other specified window at position x, y 61 * @param user audio/video call session with this skype user name 62 * @param otherWId Oter window Id for move 63 * @param x, y position 64 */ 65 void moveWebcamWidget(const QString &user, WId otherWId, int x = 0, int y = 0); 66 /** 67 * This revert webcam stream widget back to skype call dialog 68 * @param user audio/video call session with this skype user name 69 */ 70 void revertWebcamWidget(const QString &user); 71 private: 72 /** 73 * This check if window is skype call dialog 74 * @param user audio/video call session with this skype user name 75 * @param wid window id for check 76 * @return true if it is 77 */ 78 bool isCallDialog(const QString &user, WId wid); 79 /** 80 * This get window id of call dialog from linux skype client 81 * @param user audio/video call session with this skype user name 82 * @return window id of call dialog 83 */ 84 WId getCallDialogWId(const QString &user); 85 /** 86 * This check if window is skype webcam stream widget 87 * @param wid window id for check 88 * @return true if it is 89 */ 90 bool isWebcamWidget(WId wid); 91 /** 92 * This will try find webcam stream widget 93 * It browse all children windows of actualWId 94 * @param actualWId window id for start 95 * @return webcam stream widget 96 */ 97 WId getWebcamWidgetWId(WId actualWId); 98 ///d pointer 99 SkypeWindowPrivate * d; 100 private slots: 101 ///Called when new window is added to kwin manager 102 void windowAdded(WId wid); 103 signals: 104 ///Emitted when we found skype call dialog 105 void foundCallDialog(); 106 }; 107 108 #endif 109