Main Page | Class List | File List | Class Members | File Members | Related Pages

configuration.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Bojan D.                                        *
00003  *   bojan_d@users.sourceforge.net                                         *
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 
00030 #ifndef CONFIGURATION_H
00031 #define CONFIGURATION_H
00032 
00033 #include <qcolor.h>
00034 #include <qfont.h>
00035 
00038 struct CaptureConfig
00039 {
00040         int CaptureMode;                
00041         int CaptureDelay;               
00042         int PictureQuality;             
00043 
00044         int ScaleMain;                  
00045         int ScaleThumb;                 
00046         int ScaleMode;                  
00047         bool IncludeWD;                 
00048 };
00049 
00052 struct FileConfig
00053 {
00054         QString PathMain;               
00055         QString PathThumb;              
00056         QString PathOffline;    
00057 };
00058 
00061 struct FtpConfig
00062 {
00063         bool UseFtp;                    
00064         bool UseThumb;                  
00065         bool UseOffline;                
00066         QString Host;                   
00067         int Port;                               
00068         QString User;                   
00069         QString Password;               
00070         QString TransferPath;   
00071 };
00072 
00074 struct LogConfig
00075 {
00076         bool UseLog;                    
00077         QString Path;                   
00078 };
00079 
00081 struct CaptionConfig
00082 {
00083         bool UseCaption;                
00084         bool CustomPos;                 
00085         int Position;                   
00086         int PositionX;                  
00087         int PositionY;                  
00088         QString Text;                   
00089         QColor Color;                   
00090         QFont Font;                             
00091 };
00092 
00094 struct WWWConfig
00095 {
00096         bool UseWWW;                    
00097         int Port;                               
00098         QStringList Files;              
00099 };
00100 
00102 struct DefaultConfig
00103 {
00104         const CaptureConfig Capture;    
00105         const FileConfig File;                  
00106         const FtpConfig Ftp;                    
00107         const LogConfig Log;                    
00108         const CaptionConfig Caption;    
00109         const WWWConfig WWW;                    
00110 };
00111 
00126 class Configuration
00127 {
00128         public:
00134                 void read();
00135                 
00137                 void write() const;
00138                 
00144                 bool validate(QString& error);
00145                 
00147                 enum MessageType 
00148                 { 
00149                         Normal,         
00150                         Debug,          
00151                         Short,
00152                 };
00153                 
00157                 enum ScaleMode
00158                 {
00159                         ScalePercent,           
00160                         ScalePixel,                     
00161                 };
00162                 
00163                 enum CaptureMode 
00164                 { 
00165                         FullScreen = 0,                 
00166                         WindowUnderCursor = 1   
00167                 };
00168         
00172                 enum CaptionPosition
00173                 {
00174                         PosTopLeft,                     
00175                         PosTopCenter,           
00176                         PosTopRight,            
00177                         PosLeftCenter,          
00178                         PosCenter,                      
00179                         PosRightCenter,         
00180                         PosBottomLeft,          
00181                         PosBottomCenter,        
00182                         PosBottomRight,         
00183                 };
00184                 
00185                 CaptureConfig Capture;  
00186                 FileConfig File;                
00187                 FtpConfig Ftp;                  
00188                 LogConfig Log;                  
00189                 CaptionConfig Caption;  
00190                 WWWConfig WWW;                  
00191                 
00192                 static const DefaultConfig Default;             
00193         
00194         private:
00196                 Configuration();
00198                 Configuration(const Configuration&);
00200                 ~Configuration();
00201                 
00204         friend Configuration& Config();
00205 };
00206 
00209 Configuration& Config();
00210 
00211 #endif

Generated on Mon Sep 5 12:52:33 2005 for kwebsnap.kdevelop by  doxygen 1.3.9.1