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

console/kabcclient

OutputFormat Class Reference

#include <outputformat.h>

Inheritance diagram for OutputFormat:

Inheritance graph
[legend]

List of all members.


Detailed Description

Interface for output formatters.

This is the interface for output formatters. Output formats can used to write only parts of the an addressee object's data to the output stream or to format the data in a specific way.

Note:
Implementations can call writeAddressee() from writeAddresseeList() if that works for their format restrictions. If writeAddressee() is called from an outside caller, it can safely assume that there is no relation between two calls, i.e. the two calls belong to different operations. So in case an implementation needs to write some header or footer it can do so in both writeAddressee() and writeAddresseeList().
Author:
Kevin Krammer, <kevin.krammer@gmx.at>
See also:
InputFormat

Definition at line 53 of file outputformat.h.


Public Member Functions

virtual QString description () const =0
virtual QString optionUsage () const
virtual bool setCodec (QTextCodec *codec)=0
virtual bool setOptions (const QByteArray &options)=0
virtual bool writeAddressee (const KABC::Addressee &addressee, std::ostream &stream)=0
virtual bool writeAddresseeList (const KABC::AddresseeList &addresseeList, std::ostream &stream)=0
virtual ~OutputFormat ()

Constructor & Destructor Documentation

virtual OutputFormat::~OutputFormat (  )  [inline, virtual]

Destroys the instance Defined here because the class contains virtual methods.

Definition at line 60 of file outputformat.h.


Member Function Documentation

virtual QString OutputFormat::description (  )  const [pure virtual]

Returns a translate description of the output format.

Returns a translated description of the formatter and its general capabilities.

Returns:
a short descriptive string how addressee data will be formatted
Note:
Implementations should not include the optional settings a formatter understands, this is what optionUsage() is for. As the description is displayed after the format name, it is recommended to add two tabs after each newline for aligned output

Implemented in UIDOutput, VCardOutput, EmailOutput, MuttOutput, and CSVOutput.

virtual QString OutputFormat::optionUsage (  )  const [inline, virtual]

Returns a translate message about the available format options.

The option description string contains each option and its respective description for displaying to the user.

Returns:
a short description of each option or QString() if the output format does not allow configuration options
Note:
Implementations can return any formatting in the string, but it is recommended to stay consistent with the other format implementations and return the following format: one line per option and each line formatted like this
 option-name tabs option-description
where tabs is either one or two tab characters depending on the length of the option-name, e.g. two tabs for length < 8. Default implementation returns QString()

Reimplemented in VCardOutput, EmailOutput, MuttOutput, and CSVOutput.

Definition at line 114 of file outputformat.h.

virtual bool OutputFormat::setCodec ( QTextCodec *  codec  )  [pure virtual]

Sets the text codec to use.

This allows to have the text recoded to a specific text encoding. Depending on the format's specifications not all technically available codecs might be valid. e.g. VCards in version 3.0 are expected to be encoded in UTF-8

Warning:
Always set a codec, the output formats need it!
Parameters:
codec the text encoding handler to use
Returns:
true if the output format accepts this codec. i.e. can work with it reasonably. Otherwise returns false

Implemented in UIDOutput, VCardOutput, EmailOutput, MuttOutput, and CSVOutput.

virtual bool OutputFormat::setOptions ( const QByteArray &  options  )  [pure virtual]

Configures the output format.

Sets formatter options, e.g. which parts of the addressee data to use or which markup to apply.

Parameters:
options a string as taken from the commandline
Returns:
false if the options are not valid or if the input format doesn't support options. true if the options where valid
Note:
Implementations can use any format in their options string. However it is recommended to stay consistent with the other format implementations and use a comma separated list

Implemented in UIDOutput, VCardOutput, EmailOutput, MuttOutput, and CSVOutput.

virtual bool OutputFormat::writeAddressee ( const KABC::Addressee &  addressee,
std::ostream &  stream 
) [pure virtual]

Writes the data of a given addressee to the given output stream.

Depending on the formatter and its settings it will write all or portions of the available addressee data to the stream.

Warning:
a format could require either header or footer around related addressees so use this only for single addressee output, i.e. not when iterating over a list of related addressees.
Parameters:
addressee the addressee object to take data from
stream the standard output stream to write to
Note:
Implementations that do not need to handle addressee relations can of course implement the writing in this method and just call it from writeAddresseeList() when iterating over the list
See also:
writeAddresseeList()

KABC::Addressee

setCodec()

std::ostream

Implemented in UIDOutput, VCardOutput, EmailOutput, MuttOutput, and CSVOutput.

virtual bool OutputFormat::writeAddresseeList ( const KABC::AddresseeList &  addresseeList,
std::ostream &  stream 
) [pure virtual]

Writes the data from each addressee in the given list to the given output stream.

Depending on the formatter and its settings it will write all or portions of the available addressee data to the stream.

Parameters:
addresseeList a list of addressee objects
stream the standard output stream to write to
Note:
Implementations that do not need to handle each addressee differently for example numbering them, can call the writeAddressee() method on each entry of the given list
See also:
writeAddressee()

KABC::Addressee

setCodec()

std::ostream

Implemented in UIDOutput, VCardOutput, EmailOutput, MuttOutput, and CSVOutput.


The documentation for this class was generated from the following file:
  • outputformat.h

console/kabcclient

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal