00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.9 $ 00012 00013 License 00014 OSB rating and billing library for communication networks 00015 Copyright (C) 2004, 2005, 2006 OSB systems 00016 00017 This file may be distributed and/or modify under the terms of the 00018 GNU General Public License (GPL) as published by the Free Software 00019 Foundation which is provided in the file LICENSE.GPL included in the 00020 packaging of this file. 00021 00022 The file is distributed in the hope that it will be useful, but WITHOUT 00023 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00024 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00025 for more details. 00026 00027 Holders of a OSB Commercial License may use this file under the terms 00028 and conditions of this commercial license. 00029 */ 00030 #ifndef _TAUTILS_H_ 00031 #define _TAUTILS_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 #include <osbconst.h> 00039 00040 // + local headers 00041 00042 // ************************************************************************ 00043 // class declarations 00044 namespace OSB_LIB { 00045 class ToCfgBase; 00046 class ToCfgTsBase; 00047 class DateTime; 00048 class OsbErrors; 00049 } 00050 00051 // + Qt 00052 class QWidget; 00053 00054 // ************************************************************************ 00055 // namespace extensions 00056 namespace OSB_GUI { 00057 00058 // ************************************************************************ 00059 // class definitions 00060 00065 class ToCfgStatusProxy { 00066 public: 00068 enum Result { 00070 success = 0, 00072 noChange, 00074 error 00075 }; 00076 public: 00078 ToCfgStatusProxy(); 00080 virtual ~ToCfgStatusProxy(); 00081 public: 00083 void setResult(Result result); 00085 Result result() const; 00090 virtual OSB_LIB::CfgStatus status() const = 0; 00095 virtual void setStatus( 00096 OSB_LIB::CfgStatus newStatus, 00097 OSB_LIB::OsbErrors& errors 00098 ) = 0; 00099 private: 00101 Result result_; 00102 }; // class ToCfgStatusProxy 00103 00108 class ToCfgTsStatusProxy { 00109 public: 00111 enum Result { 00113 success = 0, 00115 noChange, 00117 error 00118 }; 00119 public: 00121 ToCfgTsStatusProxy(); 00123 virtual ~ToCfgTsStatusProxy(); 00124 public: 00126 void setResult(Result result); 00128 Result result() const; 00132 virtual OSB_LIB::ToCfgTsBase& toCfgTs() = 0; 00137 virtual void setStatus( 00138 OSB_LIB::CfgStatus newStatus, 00139 OSB_LIB::OsbErrors& errors 00140 ) = 0; 00145 virtual bool setReleaseTs( 00146 const OSB_LIB::DateTime& ts, 00147 OSB_LIB::OsbErrors& errors 00148 ) = 0; 00149 private: 00151 Result result_; 00152 }; // class ToCfgTsStatusProxy 00153 00154 // ************************************************************************ 00155 // free functions 00168 void changeStatus( 00169 QWidget* parent, 00170 ToCfgStatusProxy& proxy 00171 ); 00184 void changeStatus( 00185 QWidget* parent, 00186 ToCfgTsStatusProxy& proxy 00187 ); 00188 } // namespace OSB_GUI 00189 #endif // #ifndef _TAUTILS_H_