00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 13561 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKSOCKETCLIENT_H 00020 #define MITKSOCKETCLIENT_H 00021 #include <itkObject.h> 00022 #include "MitkExtExports.h" 00023 #include "mitkCommon.h" 00024 00025 #include "mitkSocketClientImplementation.h" 00026 00027 00028 namespace mitk 00029 { 00030 00031 //##Documentation 00032 //## @brief Sending a message to the applications ProgressBar 00033 //## 00034 //## Holds a GUI dependent ProgressBarImplementation and sends the progress further. 00035 //## All mitk-classes use this class to display progress on GUI-ProgressBar. 00036 //## The mainapplication has to set the internal held ProgressBarImplementation with SetImplementationInstance(..). 00037 //## @ingroup Interaction 00038 class MitkExt_EXPORT SocketClient : public itk::Object 00039 { 00040 00041 public: 00042 00043 itkTypeMacro(ProgressBar, itk::Object); 00044 00045 static SocketClient* GetInstance(); 00046 00047 static void SetImplementationInstance(SocketClientImplementation* implementation); 00048 00049 void open( const char* ipAdress, unsigned short port ); 00050 00051 void setMaxConnectionAdvance( int maxConnectionAdvance ); 00052 00053 bool send( unsigned int messagetype, unsigned int bodySize = 0, char* body = NULL ); 00054 00055 protected: 00056 SocketClient(); 00057 virtual ~SocketClient(); 00058 static SocketClientImplementation* m_Implementation; 00059 static SocketClient* m_Instance; 00060 }; 00061 00062 }// end namespace mitk 00063 00064 #endif /* define MITKSOCKETCLIENT_H */