• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

console/kabcclient

Public Member Functions | List of all members
CSVTemplateFactory Class Reference

#include <csvtemplatefactory.h>

Public Member Functions

 CSVTemplateFactory ()
 
 ~CSVTemplateFactory ()
 
CSVTemplate * createCachedTemplate (const QString &name)
 
CSVTemplate * createTemplate (const QString &name)
 
QMap< QString, QString > templateNames ()
 

Detailed Description

Factory for creation CSV template handlers.

KAddressBook supports configurable CSV (comma separated values) input/output through so-called "templates", i.e. KDE style (INI style) config files, which describe how columns of the CSV input are to be mapped from/to contact fields. See Handling of CSV (comma separated values) input/output for details.

This class is used by the CSVInput parser and CSVOutput formatter to create and configure a template handler based on the name specified by the user.

Author
Kevin Krammer, kevin.nosp@m..kra.nosp@m.mmer@.nosp@m.gmx..nosp@m.at
See also
CSVTemplate

Definition at line 44 of file csvtemplatefactory.h.

Constructor & Destructor Documentation

CSVTemplateFactory::CSVTemplateFactory ( )

Creates the factory instance.

Definition at line 36 of file csvtemplatefactory.cpp.

CSVTemplateFactory::~CSVTemplateFactory ( )

Destroys the instance.

Autodeletes the cached template instances created by createCachedTemplate()

Definition at line 42 of file csvtemplatefactory.cpp.

Member Function Documentation

CSVTemplate * CSVTemplateFactory::createCachedTemplate ( const QString &  name)

Creates a template handler for a given name and caches the instance.

Basically equal to createTemplate(), but only creates an instance on the first call for each name, i.e. keeps one instance per name.

Warning
Cached instances are owned by the factory and will be deleted on its destruction
Parameters
namethe name of the CSV template to create a handler for
Returns
a CSV handler instance or 0 if the name was empty or there is no template with such a name
See also
templateNames()
findTemplateFile()

Definition at line 74 of file csvtemplatefactory.cpp.

CSVTemplate * CSVTemplateFactory::createTemplate ( const QString &  name)

Creates a template handler for a given name.

The template's name is the basic file name (without the .desktop extension) of the template configuration file. It is the key of the respective entry in the map returned by templateNames()

Note
The caller becomes the owner of the returned instance
Parameters
namethe name of the CSV template to create a handler for
Returns
a CSV handler instance or 0 if the name was empty or there is no template with such a name
See also
createCachedTemplate()
findTemplateFile()

Definition at line 55 of file csvtemplatefactory.cpp.

QMap< QString, QString > CSVTemplateFactory::templateNames ( )

Returns a set of available templates.

On the first call this method will check the current working directory and all of KAddressBook's data directories, as returned by KStandardDirs::findDirs(), for template configuration files.

The resulting map's keys are the identifiers used to create template handlers through createTemplate() or createCachedTemplate().

The map's values are the potentially localized name specified in the template configuration file itself.

Note
Only queries the filesystem on the first call and later on just returns the cached information of this first call
Returns
map of template identifiers to templates' UI names

Definition at line 96 of file csvtemplatefactory.cpp.


The documentation for this class was generated from the following files:
  • csvtemplatefactory.h
  • csvtemplatefactory.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

console/kabcclient

Skip menu "console/kabcclient"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal