OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB::PIMItem Class Referenceabstract

Class representing PIM item. More...

#include <PIMItem.hpp>

Inheritance diagram for OpenAB::PIMItem:
Collaboration diagram for OpenAB::PIMItem:

Public Types

typedef std::string ID
 
typedef std::string Revision
 
typedef std::vector
< OpenAB::PIMItem::ID
IDs
 
typedef std::vector
< OpenAB::PIMItem::Revision
Revisions
 

Public Member Functions

 PIMItem (PIMItemType t)
 Constructor. More...
 
virtual ~PIMItem ()
 Destructor, virtual by default. More...
 
virtual bool parse (const std::string &raw)=0
 Parses item from string. Format of string to be parsed from depends on type of item. More...
 
virtual SmartPtr< PIMItemIndexgetIndex ()=0
 Returns index for given item. More...
 
virtual std::string getRawData () const =0
 Returns raw data of item. Format of raw data depends on type of item. More...
 
virtual ID getId () const
 Returns Source/Storage specific id of item. Can be empty, as not all Sources/Storages provides id of items. More...
 
virtual void setId (const ID &id, bool replace=false)
 Sets id of item. More...
 
virtual Revision getRevision () const
 Returns Source/Storage specific revision of item. Can be empty, as not all Sources/Storages provides revision of items. More...
 
virtual void setRevision (const Revision &rev)
 Sets revision of item. More...
 
PIMItemType getType () const
 Returns type of item. More...
 

Protected Attributes

PIMItemType type
 
ID id
 
Revision revision
 

Detailed Description

Class representing PIM item.

Member Typedef Documentation

typedef std::string OpenAB::PIMItem::ID
typedef std::string OpenAB::PIMItem::Revision

Constructor & Destructor Documentation

OpenAB::PIMItem::PIMItem ( PIMItemType  t)
inline

Constructor.

Parameters
[in]ttype of item
virtual OpenAB::PIMItem::~PIMItem ( )
inlinevirtual

Destructor, virtual by default.

Member Function Documentation

virtual ID OpenAB::PIMItem::getId ( ) const
inlinevirtual

Returns Source/Storage specific id of item. Can be empty, as not all Sources/Storages provides id of items.

Returns
id of item
virtual SmartPtr<PIMItemIndex> OpenAB::PIMItem::getIndex ( )
pure virtual

Returns index for given item.

Returns
index for given item.

Implemented in OpenAB::PIMCalendarItem, and OpenAB::PIMContactItem.

virtual std::string OpenAB::PIMItem::getRawData ( ) const
pure virtual

Returns raw data of item. Format of raw data depends on type of item.

Returns
raw data of item

Implemented in OpenAB::PIMCalendarItem, and OpenAB::PIMContactItem.

virtual Revision OpenAB::PIMItem::getRevision ( ) const
inlinevirtual

Returns Source/Storage specific revision of item. Can be empty, as not all Sources/Storages provides revision of items.

Returns
revision of item
PIMItemType OpenAB::PIMItem::getType ( ) const
inline

Returns type of item.

Returns
type of item
virtual bool OpenAB::PIMItem::parse ( const std::string &  raw)
pure virtual

Parses item from string. Format of string to be parsed from depends on type of item.

Note
during parsing new fields (not defined by standard format from which item is being parsed) can be added to improve matching and comparison of items. For more details see documentation of classes implementing PIMItem interface.
Parameters
[in]rawraw data to be parsed.
Returns
true if item was parsed successfully, false otherwise.

Implemented in OpenAB::PIMCalendarItem, and OpenAB::PIMContactItem.

virtual void OpenAB::PIMItem::setId ( const ID id,
bool  replace = false 
)
inlinevirtual

Sets id of item.

Parameters
[in]idto be assigned
[in]replaceshould id in raw metadata be replaced with provided id.
Note
default implementation ignores replace parameter

Reimplemented in OpenAB::PIMContactItem.

virtual void OpenAB::PIMItem::setRevision ( const Revision rev)
inlinevirtual

Sets revision of item.

Parameters
[in]revisionrevision to be set

Member Data Documentation

ID OpenAB::PIMItem::id
protected
Revision OpenAB::PIMItem::revision
protected
PIMItemType OpenAB::PIMItem::type
protected

The documentation for this class was generated from the following file: