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

Configuration Class Reference

Configuration class implements a class for holding and managing configuration settinngs. More...

#include <configuration.h>

List of all members.

Public Types

enum  MessageType { Normal, Debug, Short }
enum  ScaleMode { ScalePercent, ScalePixel }
enum  CaptureMode { FullScreen = 0, WindowUnderCursor = 1 }
enum  CaptionPosition {
  PosTopLeft, PosTopCenter, PosTopRight, PosLeftCenter,
  PosCenter, PosRightCenter, PosBottomLeft, PosBottomCenter,
  PosBottomRight
}

Public Member Functions

void read ()
void write () const
bool validate (QString &error)

Public Attributes

CaptureConfig Capture
 The capture settings.
FileConfig File
 The file settings.
FtpConfig Ftp
 The ftp settings.
LogConfig Log
 The log settings.
CaptionConfig Caption
 The caption settings.
WWWConfig WWW
 The WWW settings.

Static Public Attributes

const DefaultConfig Default
 all the defaults

Friends

ConfigurationConfig ()


Detailed Description

Configuration class implements a class for holding and managing configuration settinngs.

Configuration class holds all the options for the application. It has a private constructor and destructor, and is accessible though the friend function Config() which returns a static reference object. This way we have only one Configuration object for the whole application and it is created at start of the app, before the dialog or anything else that may depend on the config settings. The member functions read() and write() can be used to load and save the properties to the application configuration file.

Author:
Bojan D.

Definition at line 126 of file configuration.h.


Member Enumeration Documentation

enum Configuration::CaptionPosition
 

public constants for caption position

Enumeration values:
PosTopLeft  Caption is to be placed in the top left corner.
PosTopCenter  Caption is to be placed on top, centered horisontally.
PosTopRight  Caption is to be placed in the top right corner.
PosLeftCenter  Caption is to be placed on the left side, centered vertically.
PosCenter  Caption is to be placed in the center.
PosRightCenter  Caption is to be placed in on the right side, centered vertically.
PosBottomLeft  Caption is to be placed in the bottom left corner.
PosBottomCenter  Caption is to be placed at the bottom, centered horisontally.
PosBottomRight  Caption is to be placed in the bottom right corner.

Definition at line 172 of file configuration.h.

enum Configuration::CaptureMode
 

Enumeration values:
FullScreen  Full screen capture.
WindowUnderCursor  Window under cursor.

Definition at line 163 of file configuration.h.

Referenced by ConfigDialog::updateDialog().

enum Configuration::MessageType
 

Message Types

Enumeration values:
Normal  Normal message.
Debug  Debug information.

Definition at line 147 of file configuration.h.

enum Configuration::ScaleMode
 

public constants for scaling mode

Enumeration values:
ScalePercent  Percent scale mode.
ScalePixel  Pixel scale mode.

Definition at line 157 of file configuration.h.

Referenced by ConfigDialog::updateDialog().


Member Function Documentation

void Configuration::read  ) 
 

Reads the configuration data from the application config file. If a property does not already exist in the config file it will be set to a default value.

Definition at line 57 of file configuration.cpp.

References Caption, Capture, CaptureConfig::CaptureDelay, CaptureConfig::CaptureMode, CaptionConfig::Color, CaptionConfig::CustomPos, Default, File, WWWConfig::Files, CaptionConfig::Font, Ftp, FtpConfig::Host, CaptureConfig::IncludeWD, Log, LogConfig::Path, FileConfig::PathMain, FileConfig::PathOffline, FileConfig::PathThumb, CaptureConfig::PictureQuality, WWWConfig::Port, FtpConfig::Port, CaptionConfig::Position, CaptionConfig::PositionX, CaptionConfig::PositionY, CaptureConfig::ScaleMain, CaptureConfig::ScaleMode, CaptureConfig::ScaleThumb, CaptionConfig::Text, FtpConfig::TransferPath, CaptionConfig::UseCaption, FtpConfig::UseFtp, LogConfig::UseLog, FtpConfig::UseOffline, FtpConfig::User, FtpConfig::UseThumb, WWWConfig::UseWWW, and WWW.

bool Configuration::validate QString &  error  ) 
 

validates if the object has valid data.

Parameters:
error QString where error message will be saved.
Returns:
true if object is valid. false otherwise. Error message is saved in error.

Definition at line 167 of file configuration.cpp.

References File, Ftp, FtpConfig::Host, FileConfig::PathMain, WWWConfig::Port, FtpConfig::UseFtp, FtpConfig::User, WWWConfig::UseWWW, and WWW.

Referenced by KWebSnap::slotSnapSend(), and KWebSnap::slotStart().

void Configuration::write  )  const
 

Writes the configuration data to the application config file.

Definition at line 111 of file configuration.cpp.

References Caption, Capture, CaptureConfig::CaptureDelay, CaptureConfig::CaptureMode, CaptionConfig::Color, CaptionConfig::CustomPos, File, WWWConfig::Files, CaptionConfig::Font, Ftp, FtpConfig::Host, CaptureConfig::IncludeWD, Log, LogConfig::Path, FileConfig::PathMain, FileConfig::PathOffline, FileConfig::PathThumb, CaptureConfig::PictureQuality, WWWConfig::Port, FtpConfig::Port, CaptionConfig::Position, CaptionConfig::PositionX, CaptionConfig::PositionY, CaptureConfig::ScaleMain, CaptureConfig::ScaleMode, CaptureConfig::ScaleThumb, CaptionConfig::Text, FtpConfig::TransferPath, CaptionConfig::UseCaption, FtpConfig::UseFtp, LogConfig::UseLog, FtpConfig::UseOffline, FtpConfig::User, FtpConfig::UseThumb, WWWConfig::UseWWW, and WWW.


Friends And Related Function Documentation

Configuration& Config  )  [friend]
 

This function is used to create one instance of a Configuration object, and access the object and the Configuration settings

Definition at line 195 of file configuration.cpp.


Member Data Documentation

const DefaultConfig Configuration::Default [static]
 

Initial value:

 
{
        { FullScreen, 4500, -1, 100, 30, ScalePercent, true },  
        { "", "", "" },                                                 
        { true, false, true, "", 21, "", "", "" },      
        { false, "" },                                                  
        { false, false, Qt::AlignLeft | Qt::AlignTop, 0, 0, "", Qt::black, QFont() }, 
        { false, 8080, QStringList() },                 
}
all the defaults

Definition at line 38 of file configuration.cpp.

Referenced by read(), and ConfigDialog::slotDefault().


The documentation for this class was generated from the following files:
Generated on Mon Sep 5 12:52:34 2005 for kwebsnap.kdevelop by  doxygen 1.3.9.1