00001 /* 00002 * Copyright (C) 2009, Edmundo Albuquerque de Souza e Silva. 00003 * 00004 * This file may be distributed under the terms of the Q Public License 00005 * as defined by Trolltech AS of Norway and appearing in the file 00006 * LICENSE.QPL included in the packaging of this file. 00007 * 00008 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 00009 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00010 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00012 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00013 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00014 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 * 00016 */ 00017 00018 #ifndef __RIOQT_H__ 00019 #define __RIOQT_H__ 00020 00021 #include <qmainwindow.h> 00022 #include <qworkspace.h> 00023 #include <qtoolbar.h> 00024 #include <qtoolbutton.h> 00025 00026 #include "ConfigData.h" 00027 #include "FileWindow.h" 00028 00029 #define STR_TTL_ABOUT "About riosh" 00030 #define STR_TXT_ABOUT "RIO Multimedia Server\nLAND/UFRJ\nhttp://www.land.ufrj.br/rio" 00031 00032 class Editor; 00033 00034 class FileWindow; 00035 00036 class RioQt : public QMainWindow 00037 { 00038 Q_OBJECT 00039 00040 private: 00041 QWorkspace *workspace; 00042 ConfigData *config; 00043 QPtrList<Editor> editorList; 00044 int windows_arrangement; 00045 00046 QToolButton *tbTileHorizontally; 00047 QToolButton *tbTileVertically; 00048 QToolButton *tbCascade; 00049 00050 // Monitor Connection update interval. 00051 00052 int UpIntMonConnection; 00053 00054 void arrangeWindows( void ); 00055 00056 void customEvent( QCustomEvent * ); 00057 void resizeEvent( QResizeEvent * ); 00058 00059 public slots: 00060 void createConnectionWindow( void ); 00061 void createConfigureWindow( void ); 00062 00063 void arrangeHorizontally( void ); 00064 void arrangeVertically( void ); 00065 void arrangeCascade( void ); 00066 00067 void closeEvent( QCloseEvent * ); 00068 void about( void ); 00069 00070 public: 00071 RioQt(); 00072 00073 ConfigData *getConfig( void ); 00074 00075 void handle_SIGCHLD( int, int ); 00076 void appendEditor( Editor * ); 00077 bool hasPendingEditor( FileWindow * ); 00078 00079 int showMessage( int, string, string ); 00080 00081 // Constants 00082 static const int HORIZONTAL = 0; 00083 static const int VERTICAL = 1; 00084 static const int CASCADE = 2; 00085 }; 00086 00087 /******************************************************************************/ 00088 /******************************** Class Editor ********************************/ 00089 /******************************************************************************/ 00090 class Editor 00091 { 00092 public: 00093 Editor( pid_t , QString, QString, FileWindow * ); 00094 00095 pid_t editorPID; 00096 QString file; 00097 QString remoteFile; 00098 FileWindow *fileWindow; 00099 }; 00100 00101 #endif