DiaryEntryCreator Class Reference

Handles saving and creating diary entries. More...

#include <DiaryEntryCreator.h>

List of all members.

Static Public Member Functions

static void SaveDate (MyQTextBrowser *editor, const QDir &entryLocationBaseDir)
static int LoadDate (MyQTextBrowser *editor, const QDate &date, const QDir &entryLocationBaseDir)
static QString HandleFileInsertion (const QString &absoluteFilepathAndName, const QDir &entryLocationBaseDir, EmbeddedTextObjectCopyingCallbackAPI *progressBarParent=NULL)
static int GetNextAvailableFileNo (const QDir &targetFolder)
 Get next available number that can be used as a filename in specified directory.
static int GetNextAvailableFileNo ()
 Get next available number that can be used as a filename in [Diary entry storage folder]/[currenlty open date] directory.
static QString GetNextAvailableFilename ()
 Get next available name for file in [Diary entry storage folder]/[currenlty open date] with complete path.

Static Private Member Functions

static void CleanEntryFolder (MyQTextBrowser *editor, const QDir &entryLocationBaseDir)

Static Private Attributes

static QDate iLastEditedDate = QDate(0,0,0)
 Stores the date that was last loaded by DiaryEntryCreator::LoadDate(const QDate &date, const QDir &entryLocationBaseDir).


Detailed Description

Handles saving and creating diary entries.

Handle changing the day:

Handle copying pictures when user wishes to add one to entry:

Member Function Documentation

QString DiaryEntryCreator::GetNextAvailableFilename (  )  [static]

Get next available name for file in [Diary entry storage folder]/[currenlty open date] with complete path.

Uses GetNextAvailableFileNo() to get next available number that can be used as a filename in [Diary entry storage folder]/[currenlty open date] directory and constructs a filename with full path from it. ( [Diary entry storage folder]/[currenlty open date]/[number returned by GetNextAvailableFileNo()] ).

Returns:
Filename with complete path.

int DiaryEntryCreator::GetNextAvailableFileNo (  )  [static]

Get next available number that can be used as a filename in [Diary entry storage folder]/[currenlty open date] directory.

Same as GetNextAvailableFileNo(const QDir &targetFolder) but uses SettingsStorage::GetValue(targetFolder, DIARY_ENTRY_STORAGE_PATH) and iLastEditedDate to construct targetFolder pointing to directory for storing files for currently open date. Determines the lowest possible number that can be used as a name for a file in directory. Will just start from 0 and check if directory allready contains a file named as "0" and increase the number till the first free number is found.

Returns:
First free number that can be used as a filename in the directory

int DiaryEntryCreator::GetNextAvailableFileNo ( const QDir &  targetFolder  )  [static]

Get next available number that can be used as a filename in specified directory.

Parameters:
targetFolder Directory where we want to add the file.
Determines the lowest possible number that can be used as a name for a file in targetFolder. Will just start from 0 and check if targetFolder allready contains a file named as "0" and increase the number till the first free number is found.

Returns:
First free number that can be used as a filename in targetFolder


Member Data Documentation

QDate DiaryEntryCreator::iLastEditedDate = QDate(0,0,0) [static, private]

Stores the date that was last loaded by DiaryEntryCreator::LoadDate(const QDate &date, const QDir &entryLocationBaseDir).

QDate iLastEditedDate [static]


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

Generated on Thu Mar 3 17:42:03 2011 for Xiaoning's Diary by  doxygen 1.5.9