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

WDS::CProfileManager Class Reference

Class to load/save, add/delete profiles. More...

#include <profilemanager.h>

Collaboration diagram for WDS::CProfileManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CProfileManager (wxFileConfig *pConfig)
virtual ~CProfileManager ()
void save ()
int size () const
CProfileGetProfile (int index) const
int GetIndexFromProfile (const CProfile *profile)
bool DeleteProfile (int index)
bool DeleteProfile (CProfile *p)
bool AddProfile (CProfile *p)

Static Public Member Functions

CProfileGetCurrentProfile ()
void SetCurrentProfile (CProfile *p)

Protected Member Functions

void Init ()

Detailed Description

Class to load/save, add/delete profiles.

The CProfileManager class provides all functions to manage profiles. Get a profile with GetProfile(), add/delete profiles with AddProfile() and DeleteProfile() and save the configuration with save().

Note:
Get the current profile with the static function CProfileManager::GetCurrentProfile(). The current profile may be NULL.
Author:
Dominik Haumann <dhaumann@users.sf.net>

Definition at line 208 of file profilemanager.h.


Constructor & Destructor Documentation

WDS::CProfileManager::CProfileManager wxFileConfig *  pConfig  ) 
 

Creates new CProfileManager and loads all profiles

Parameters:
pConfig config file to read from

Definition at line 348 of file profilemanager.cpp.

References Init().

Here is the call graph for this function:

WDS::CProfileManager::~CProfileManager  )  [virtual]
 

clears all profiles (all pointers)

Definition at line 356 of file profilemanager.cpp.


Member Function Documentation

bool WDS::CProfileManager::AddProfile CProfile p  ) 
 

Add profile to the profile manager.

Returns:
true on succses, false if the profiel already exists

Definition at line 473 of file profilemanager.cpp.

bool WDS::CProfileManager::DeleteProfile CProfile p  ) 
 

Remove CProfile* p

Returns:
true on success, false, if p does not exist

Definition at line 460 of file profilemanager.cpp.

bool WDS::CProfileManager::DeleteProfile int  index  ) 
 

Remove profile with index index

Returns:
true on success, false, if index is out of range

Definition at line 446 of file profilemanager.cpp.

CProfile* WDS::CProfileManager::GetCurrentProfile  )  [inline, static]
 

Returns:
global static current profile, may be NULL!

Definition at line 247 of file profilemanager.h.

int WDS::CProfileManager::GetIndexFromProfile const CProfile profile  ) 
 

map profile to index,

Returns:
index, or -1 if profile not found/NULL

Definition at line 428 of file profilemanager.cpp.

Referenced by save().

CProfile * WDS::CProfileManager::GetProfile int  index  )  const
 

Returns:
map index to CProfile*. NULL, if index is out of range

Definition at line 420 of file profilemanager.cpp.

Referenced by WDS::CDlgProfileManager::FillListBox(), Init(), and WDS::CDlgProfileManager::OnActivateItem().

void WDS::CProfileManager::Init  )  [protected]
 

load list of profiles from the config file. Called from constructor only

Definition at line 367 of file profilemanager.cpp.

References GetProfile(), WDS::CProfile::Load(), and SetCurrentProfile().

Referenced by CProfileManager().

Here is the call graph for this function:

void WDS::CProfileManager::save  ) 
 

Save all profiles to the config file

Definition at line 395 of file profilemanager.cpp.

References GetIndexFromProfile(), and WDS::CProfile::Save().

Here is the call graph for this function:

void WDS::CProfileManager::SetCurrentProfile CProfile p  )  [inline, static]
 

Set current profile

Parameters:
p new profile or NULL

Definition at line 252 of file profilemanager.h.

Referenced by Init().

int WDS::CProfileManager::size  )  const
 

Returns:
number of profiles

Definition at line 415 of file profilemanager.cpp.

Referenced by WDS::CDlgProfileManager::FillListBox(), and WDS::CDlgProfileManager::OnActivateItem().


The documentation for this class was generated from the following files:
Generated on Sun Jan 16 18:20:28 2005 for WDSMap by  doxygen 1.3.9.1