client/clientsocket.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Daniel Rocher                                   *
00003  *   daniel.rocher@adella.org                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 
00022 #ifndef CLIENTSOCKET_H
00023 #define CLIENTSOCKET_H
00024 
00025 #include <Q3CString>
00026 
00027 #include "server.h"
00028 #include "clientssl.h"
00029 #include "smbstatus.h"
00030 #include "../common/core_syntax.h"
00031 
00032 extern void debugQt(const QString & message);
00033 
00034 extern int interval;
00035 extern QString host;
00036 extern Q_UINT16 port_server;
00037 extern bool view_hidden_shares;
00038 
00039 class ClientSocket : public QObject
00040 {
00041         Q_OBJECT
00042 public:
00043         ClientSocket(Q3ListView * mylistView,QObject *parent=0);
00044         virtual ~ClientSocket();
00045         void Disconnect();
00046         void connectionToServer(const QString & username, const QString & passwd);
00047         static int compteur_objet;
00048 private slots:
00049         void slot_timer();
00050         void socketconnected();
00051         void socketclosed();
00052         void UnreachableHost();
00053         void slotPopupMenu( Q3ListViewItem*, const QPoint &, int );
00054         void slotSendMessage();
00055         void slotSendMessageAllUsers();
00056         void slotDisconnectUser();
00057         void InfoServer();
00058         void InfoUser();
00059         void InfoService();
00060         void InfoMachine();
00061         void core(const Q3CString & rcv_txt);
00062         void setSambaVersion (const QString &);
00063         void add_user (const QString &,const QString &,const QString &,const QString &,const QString &);
00064         void add_share(const QString &,const QString &,const QString &);
00065         void add_lockedfile(const QString &,const QString &,const QString &,const QString &,const QString &,const QString &);
00066         void AnalysisSmbDestroyed();
00067         void slot_echo_timer();
00068 signals:
00070         void SignalConnected();
00072         void SignalClosed();
00074         void SignalErrorAuth();
00076         void SignalShortMessage(const QString &);
00077 
00078 private: // Private methods
00079         void sendToServer(int cmd,const QString & inputText="");
00080         void infoserver(const QString & text);
00081         void AnalysisSmbstatus();
00082 
00083 private: // Private attributes
00084         bool permitDisconnectUser;
00085         bool permitSendMsg;
00086         ClientSSL* socketclient;
00087         bool ssl_connected;
00088         int echo;
00089         static int TimoutTimerEcho;
00090         QTimer * echo_timer;
00091         Q3PopupMenu* menu;
00092         Q3ListView * listView;
00093         QString passwd_login;
00094         QString username_login;
00095         server * item_server;
00096         QStringList ListSmbstatus;
00097         smbstatus * InstanceSmbstatus;
00098         QTimer* timer;
00099         QErrorMessage * msgError;
00100         Q3ListViewItem* currentPopupMenuItem;
00105         enum command {auth_rq,auth_ack,end,kill_user,send_msg,smb_rq,smb_data,end_smb_rq,not_imp1,server_info,error_auth,error_command,error_obj,echo_request,echo_reply};
00106 };
00107 
00108 #endif

Generated on Fri Nov 2 21:44:58 2007 for qtsmbstatus.kdevelop by  doxygen 1.5.3