#include <ClientFolder.h>
Public Member Functions | |
ClientFolder () | |
Constructor. | |
ClientFolder (ClientFolder &f) | |
Copy Constructor. | |
ClientFolder | operator= (ClientFolder &f) |
Operator =. | |
~ClientFolder () | |
Destructor. | |
void | setCOMPtr (MAPIFolderPtr &f, const std::wstring &type) |
Set a COM pointer to this object: refresh all members. | |
void | setCOMPtr (MAPIFolderPtr &f) |
Here itemType is derived from the defaultItemType of the folder. | |
MAPIFolderPtr & | getCOMPtr () |
Returns a reference to the internal COM pointer. | |
const std::wstring & | getID () |
const std::wstring & | getType () |
const std::wstring & | getName () |
const std::wstring & | getPath () |
const int | getSubfoldersCount () |
const int | getSubfoldersIndex () |
ClientFolder * | getFirstSubfolder () |
Returns the first subfolder of this folder. | |
ClientFolder * | getNextSubfolder () |
Returns the next subfolder of this folder. | |
ClientFolder * | getPreviousSubfolder () |
Returns the previous subfolder of this folder. | |
ClientFolder * | getLastSubfolder () |
Returns the last subfolder of this folder. | |
ClientFolder * | getSubfolder (const int index) |
Returns the subfolder from its index. | |
ClientFolder * | getSubfolderFromName (const std::wstring &subName) |
Returns the subfolder from its name. | |
ClientFolder * | addSubFolder (const std::wstring &subName, const std::wstring &type) |
Adds a new Subfolder for this folder, then a pointer is returned. | |
const int | getItemsCount () |
const int | getItemsIndex () |
ClientItem * | getFirstItem () |
Returns the first item of this folder. | |
ClientItem * | getNextItem () |
Returns the next item of this folder. | |
ClientItem * | getPreviousItem () |
Returns the previous item of this folder. | |
ClientItem * | getLastItem () |
Returns the last item of this folder. | |
ClientItem * | getItem (const int index) |
ClientItem * | addItem () |
Adds a new Item for this folder, then a pointer is returned. | |
Private Member Functions | |
ClientItem * | setInternalItem (IDispatchPtr &pItem) |
Set the appropriate internal item, based on the item type. | |
Private Attributes | |
std::wstring | ID |
The object entry-ID. | |
std::wstring | itemType |
The item-type of all items contained in the folder (contact/task/mail. | |
std::wstring | name |
std::wstring | path |
int | subfoldersCount |
Subfolders for this folder. | |
int | subfoldersIndex |
int | itemsCount |
Items inside folder. | |
int | itemsIndex |
MAPIFolderPtr | pFolder |
COM Pointers to microsoft outlook objects. | |
_FoldersPtr | pSubFolders |
MAPIFolderPtr | pSubFolder |
_ItemsPtr | pItems |
IDispatchPtr | pItem |
_ContactItemPtr | pContact |
_AppointmentItemPtr | pAppointment |
_MailItemPtr | pMail |
_NoteItemPtr | pNote |
_TaskItemPtr | pTask |
ClientFolder * | subFolder |
Internal Objects: 'get. | |
ClientMail * | |
ClientContact * | contact |
ClientAppointment * | appointment |
ClientTask * | task |
ClientNote * | note |
HRESULT | hr |
Result of COM pointers operations. |
Contains pointers of eventual items and folders inside this folder.
ClientFolder::ClientFolder | ( | ) |
Constructor.
Constructor: initialize all members.
References hr, ID, itemsCount, subFolder, and subfoldersCount.
Referenced by addSubFolder(), ClientFolder(), getFirstSubfolder(), getLastSubfolder(), getNextSubfolder(), getPreviousSubfolder(), getSubfolder(), and operator=().
ClientFolder::~ClientFolder | ( | ) |
ClientItem * ClientFolder::addItem | ( | ) |
Adds a new Item for this folder, then a pointer is returned.
The pointer returned is a generic ClientItem, but it is casted from a specific Item based on the folder item type (contact / task / ...) In case of errors throws a ClientException.
References itemsCount, setInternalItem(), and throwClientException().
Referenced by WindowsSyncSource::addItem().
ClientFolder * ClientFolder::addSubFolder | ( | const std::wstring & | subName, | |
const std::wstring & | type | |||
) |
Adds a new Subfolder for this folder, then a pointer is returned.
'type' param is required because the subfolder could not be of the same type of the parent folder. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, subfoldersCount, and throwClientException().
Referenced by ClientApplication::getFolderFromPath().
ClientItem * ClientFolder::getFirstItem | ( | ) |
Returns the first item of this folder.
The pointer returned is a generic ClientItem, but it is casted from a specific Item based on the folder item type (contact / task / ...) If item not found returns NULL. In case of errors throws a ClientException.
References itemsCount, setInternalItem(), and throwClientException().
Referenced by WindowsSyncSource::pushAllItemsToList().
ClientFolder * ClientFolder::getFirstSubfolder | ( | ) |
Returns the first subfolder of this folder.
If subfolder not found returns NULL. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, subfoldersCount, and throwClientException().
Referenced by WindowsSyncSource::pushAllSubfolderItemsToList().
ClientItem * ClientFolder::getLastItem | ( | ) |
Returns the last item of this folder.
The pointer returned is a generic ClientItem, but it is casted from a specific Item based on the folder item type (contact / task / ...) If item not found returns NULL. In case of errors throws a ClientException.
References itemsCount, setInternalItem(), and throwClientException().
Referenced by WindowsSyncSource::deleteAppointment().
ClientFolder * ClientFolder::getLastSubfolder | ( | ) |
Returns the last subfolder of this folder.
If subfolder not found returns NULL. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, subfoldersCount, and throwClientException().
ClientItem * ClientFolder::getNextItem | ( | ) |
Returns the next item of this folder.
The pointer returned is a generic ClientItem, but it is casted from a specific Item based on the folder item type (contact / task / ...) If item not found returns NULL. In case of errors throws a ClientException.
References itemsCount, setInternalItem(), and throwClientException().
Referenced by WindowsSyncSource::pushAllItemsToList().
ClientFolder * ClientFolder::getNextSubfolder | ( | ) |
Returns the next subfolder of this folder.
If subfolder not found returns NULL. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, subfoldersCount, and throwClientException().
Referenced by WindowsSyncSource::pushAllSubfolderItemsToList().
ClientItem * ClientFolder::getPreviousItem | ( | ) |
Returns the previous item of this folder.
The pointer returned is a generic ClientItem, but it is casted from a specific Item based on the folder item type (contact / task / ...) If item not found returns NULL. In case of errors throws a ClientException.
References itemsCount, setInternalItem(), and throwClientException().
Referenced by WindowsSyncSource::deleteAppointment().
ClientFolder * ClientFolder::getPreviousSubfolder | ( | ) |
Returns the previous subfolder of this folder.
If subfolder not found returns NULL. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, subfoldersCount, and throwClientException().
ClientFolder * ClientFolder::getSubfolder | ( | const int | index | ) |
Returns the subfolder from its index.
If subfolder not found returns NULL. In case of errors throws a ClientException.
References ClientFolder(), setCOMPtr(), subFolder, and subfoldersCount.
Referenced by getSubfolderFromName().
ClientFolder * ClientFolder::getSubfolderFromName | ( | const std::wstring & | subName | ) |
Returns the subfolder from its name.
If subfolder not found returns NULL.
References getName(), getSubfolder(), subFolder, and subfoldersCount.
Referenced by ClientApplication::getFolderFromPath().
void ClientFolder::setCOMPtr | ( | MAPIFolderPtr & | f, | |
const std::wstring & | type | |||
) |
Set a COM pointer to this object: refresh all members.
Set a COM pointer to this object.
This method is used to link the object to the correspondent outlook COM pointer. All class members are overwrited by this call. The method MUST be called before using this object, as the constructor doesn't link the class COM pointer. If 'type' parameter is an empty string, then item type is derived from the defaultItemType of the folder.
References hr, ID, itemsCount, pFolder, subfoldersCount, and throwClientException().
Referenced by addSubFolder(), ClientApplication::getDefaultFolder(), getFirstSubfolder(), ClientApplication::getFolderFromID(), getLastSubfolder(), getNextSubfolder(), getPreviousSubfolder(), ClientApplication::getRootFolder(), getSubfolder(), ClientApplication::pickFolder(), and setCOMPtr().
ClientItem * ClientFolder::setInternalItem | ( | IDispatchPtr & | pItem | ) | [private] |
Set the appropriate internal item, based on the item type.
If the internal item is NULL, it is created new. Then the item is linked with the COM pointer passed.
pItem | the generic Item COM pointer to link the item object <-- *** NOW class member / remove parameter... |
References ClientMail::setCOMPtr(), ClientNote::setCOMPtr(), ClientTask::setCOMPtr(), ClientContact::setCOMPtr(), ClientAppointment::setCOMPtr(), and throwClientException().
Referenced by addItem(), getFirstItem(), getLastItem(), getNextItem(), and getPreviousItem().
std::wstring ClientFolder::ID [private] |
std::wstring ClientFolder::itemType [private] |
The item-type of all items contained in the folder (contact/task/mail.
..)
Referenced by ClientFolder(), and operator=().
ClientFolder* ClientFolder::subFolder [private] |
Internal Objects: 'get.
..' methods always return references to these objects
Referenced by addSubFolder(), ClientFolder(), getFirstSubfolder(), getLastSubfolder(), getNextSubfolder(), getPreviousSubfolder(), getSubfolder(), getSubfolderFromName(), operator=(), and ~ClientFolder().